ASSERT_EQ(EnablePackage(pkgid, PackageType::WGT),
ci::AppInstaller::Result::OK);
- ASSERT_TRUE(ci::QueryIsPackageInstalled(pkgid,
- ci::GetRequestMode(kTestUserId),
- kTestUserId));
+ ci::PkgQueryInterface pkg_query(pkgid, kTestUserId);
+ ASSERT_TRUE(pkg_query.IsPackageInstalled(ci::GetRequestMode(kTestUserId)));
}
TEST_F(SmokeTest, DisablePkg) {
ASSERT_EQ(Install(path, PackageType::WGT), ci::AppInstaller::Result::OK);
ASSERT_TRUE(ValidatePackage(pkgid, {appid}));
std::vector<std::string> res;
- ASSERT_TRUE(ci::QueryPrivilegesForPkgId(pkgid, kTestUserId, &res));
+ ci::PkgQueryInterface pkg_query(pkgid, kTestUserId);
+ ASSERT_TRUE(pkg_query.PrivilegesForPkgId(&res));
ASSERT_TRUE(std::find(res.begin(), res.end(), call_privilege) != res.end());
ASSERT_TRUE(std::find(res.begin(), res.end(), location_privilege)
!= res.end());
bf::path pkg_path = ci::GetRootAppPath(false, kTestUserId);
CopyDir(src_path / pkgid, pkg_path / pkgid);
- ASSERT_FALSE(QueryIsPackageInstalled(pkgid, ci::GetRequestMode(kTestUserId),
- kTestUserId));
+ ci::PkgQueryInterface pkg_query(pkgid, kTestUserId);
+ ASSERT_FALSE(pkg_query.IsPackageInstalled(ci::GetRequestMode(kTestUserId)));
ASSERT_EQ(ManifestDirectInstall(pkgid, PackageType::WGT),
ci::AppInstaller::Result::OK);
ASSERT_TRUE(ValidatePackage(pkgid, {appid}));
bf::path pkg_path = ci::GetRootAppPath(false, kTestUserId);
CopyDir(src_path / pkgid, pkg_path / pkgid);
- ASSERT_FALSE(QueryIsPackageInstalled(pkgid, ci::GetRequestMode(kTestUserId),
- kTestUserId));
+ ci::PkgQueryInterface pkg_query(pkgid, kTestUserId);
+ ASSERT_FALSE(pkg_query.IsPackageInstalled(ci::GetRequestMode(kTestUserId)));
ASSERT_EQ(ManifestDirectInstall(pkgid, PackageType::HYBRID),
ci::AppInstaller::Result::OK);
ASSERT_TRUE(ValidatePackage(pkgid, {appid}));
bool ValidatePackage(const std::string& pkgid,
const std::vector<std::string>& appids, bool is_readonly) {
- EXTENDED_ASSERT_TRUE(ci::QueryIsPackageInstalled(
- pkgid, ci::GetRequestMode(kTestUserId), kTestUserId));
+ ci::PkgQueryInterface pkg_query(pkgid, kTestUserId);
+ EXTENDED_ASSERT_TRUE(pkg_query.IsPackageInstalled(
+ ci::GetRequestMode(kTestUserId)));
EXTENDED_ASSERT_TRUE(ValidatePackageFS(
pkgid, appids, kTestUserId, kTestGroupId, is_readonly));
if (kTestUserId == kGlobalUserUid) {
void ValidateExternalPackage(const std::string& pkgid,
const std::vector<std::string>& appids) {
- ASSERT_TRUE(ci::QueryIsPackageInstalled(
- pkgid, ci::GetRequestMode(kTestUserId),
- kTestUserId));
- std::string storage = ci::QueryStorageForPkgId(pkgid, kTestUserId);
+ ci::PkgQueryInterface pkg_query(pkgid, kTestUserId);
+ ASSERT_TRUE(pkg_query.IsPackageInstalled(ci::GetRequestMode(kTestUserId)));
+ std::string storage = pkg_query.StorageForPkgId();
bf::path ext_mount_path = ci::GetExternalCardPath();
if (bf::is_empty(ext_mount_path)) {
LOG(INFO) << "Sdcard not exists!";
bool CheckPackageNonExistance(const std::string& pkgid,
const std::vector<std::string>& appids) {
- EXTENDED_ASSERT_FALSE(ci::QueryIsPackageInstalled(
- pkgid, ci::GetRequestMode(kTestUserId),
- kTestUserId));
+ ci::PkgQueryInterface pkg_query(pkgid, kTestUserId);
+ EXTENDED_ASSERT_FALSE(pkg_query.IsPackageInstalled(
+ ci::GetRequestMode(kTestUserId)));
PackageCheckCleanup(pkgid, appids);
if (kTestUserId == kGlobalUserUid) {
ci::UserList list = ci::GetUserList();
void CheckPackageReadonlyNonExistance(const std::string& pkgid,
const std::vector<std::string>& appids) {
- ASSERT_FALSE(ci::QueryIsPackageInstalled(
- pkgid, ci::GetRequestMode(kTestUserId), kTestUserId));
+ ci::PkgQueryInterface pkg_query(pkgid, kTestUserId);
+ ASSERT_FALSE(pkg_query.IsPackageInstalled(ci::GetRequestMode(kTestUserId)));
PackageCheckCleanup(pkgid, appids, true);
}
if (!context_->pkgid.get().empty()) {
// set update true if package is updated preload package
ci::RequestType req_type = context_->request_type.get();
- if (ci::QueryIsUpdatedPackage(context_->pkgid.get(), context_->uid.get()))
+ ci::PkgQueryInterface pkg_query(manifest->package, context_->uid.get());
+ if (pkg_query.IsUpdatedPackage())
manifest->update = strdup("true");
- else if (ci::QueryIsPreloadPackage(context_->pkgid.get(),
- context_->uid.get()) &&
+ else if (pkg_query.IsPreloadPackage() &&
(req_type == ci::RequestType::Update ||
- req_type == ci::RequestType::Delta ||
- req_type == ci::RequestType::MountUpdate ||
- req_type == ci::RequestType::ReadonlyUpdateInstall))
+ req_type == ci::RequestType::Delta ||
+ req_type == ci::RequestType::MountUpdate ||
+ req_type == ci::RequestType::ReadonlyUpdateInstall))
manifest->update = strdup("true");
else
manifest->update = strdup("false");
- } else {
- manifest->update = strdup("false");
}
return true;
info = ReadPkgidFromRecovery(arg);
else
info = arg;
-
- if (ci::QueryIsPackageInstalled(info, ci::GetRequestMode(uid), uid)) {
+ ci::PkgQueryInterface pkg_query(info, uid);
+ if (pkg_query.IsPackageInstalled(ci::GetRequestMode(uid))) {
bf::path package_directory(ci::GetRootAppPath(false, uid));
if (bf::exists(package_directory / info / kTizenManifestLocation) &&
bf::exists(package_directory / info / kHybridConfigLocation))