+int
+_ServiceAppImpl::GetPrivilegeLevel(void)
+{
+ const AppId appId = _AppInfo::GetApplicationId();
+
+ _PackageManagerImpl* pPkg = _PackageManagerImpl::GetInstance();
+ SysTryReturn(NID_APP, pPkg != null, _API_VISIBILITY_PUBLIC, E_INVALID_STATE, "Invalid PackageManager instance.");
+
+ String pkgId = _PackageManagerImpl::GetPackageIdByAppId(appId);
+ SysTryReturn(NID_APP, !pkgId.IsEmpty(), _API_VISIBILITY_PUBLIC, E_INVALID_STATE, "Invalid appId(%ls).", appId.GetPointer() );
+
+ PackageInfo* pInfo = pPkg->GetPackageInfoN(pkgId);
+ SysTryReturn(NID_APP, pInfo != null, _API_VISIBILITY_PUBLIC, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+ const _PackageInfoImpl* pPkgInfo = _PackageInfoImpl::GetInstance(pInfo);
+ SysTryReturn(NID_APP, pPkgInfo != null, _API_VISIBILITY_PUBLIC, E_INVALID_STATE, "Invalid PackageInfo instance.");
+
+ return pPkgInfo->GetApiVisibility();
+}
+