Signed-off-by: Seungha Son <seungha.son@samsung.com>
Change-Id: I63d0f8a956bda8b9974dcfa0a2231a69fa05654c
}
bool PkgQueryInterface::IsPackageInstalled() {
- return IsValid();
+ if (!IsValid())
+ return false;
+ bool is_global = false;
+ if (pkgmgrinfo_pkginfo_is_for_all_users(handle_, &is_global) != PMINFO_R_OK) {
+ LOG(ERROR) << "pkgmgrinfo_pkginfo_is_for_all_users failed";
+ return false;
+ }
+
+ if (uid_ == kGlobalUserUid && is_global)
+ return true;
+ if (uid_ != kGlobalUserUid && is_global)
+ return false;
+ return true;
}
bool PkgQueryInterface::IsPackageInstalled(RequestMode mode) {