I got this using SharePoint API. Find the following code.
string privacyvalue = string.Empty;
SPUser AdminUser = SPContext.Current.Web.AllUsers[@"SHAREPOINT\SYSTEM"];
var superToken = AdminUser.UserToken;
HttpContext con = HttpContext.Current;
SPSecurity.RunWithElevatedPrivileges(delegate()
{
using (SPSite site = new SPSite(SPContext.Current.Site.Url, superToken))
{
SPServiceContext context1 = SPServiceContext.GetContext(site);
HttpContext.Current = null;
UserProfileManager upm = new UserProfileManager(context1, false);
this.userProfile = upm.GetUserProfile(this.UserAccount);
Privacy privacy = this.userProfile[PropertyName].Privacy;
privacyvalue = privacy.ToString();
}
});
HttpContext.Current = con;