Fix codes for ManifestDirectInstall in Hybrid pkg 02/147402/2
authorJunghyun Yeon <jungh.yeon@samsung.com>
Mon, 4 Sep 2017 08:09:17 +0000 (17:09 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Mon, 4 Sep 2017 08:14:55 +0000 (17:14 +0900)
- Backend couldn't detect hybrid pkg if pkginfo doesn't exist in db.
- ManifestDirectInstall cannot be performed because of reason above.
- So change if statement to check designated directory even if
  there are no information in db.
- RO path will be checked only if given uid is privileged one.

Change-Id: Ic4855cfa1090b1e5bac1b98d6ca69507657de357
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
src/wgt/wgt_app_query_interface.cc

index 5f931e08d97be6c4bb1a0c1422f8f34c628360dd..4afdc3d9a35bf8ce5db4b47c7d8db7cb233941fa 100644 (file)
@@ -91,11 +91,14 @@ bool WgtAppQueryInterface::IsHybridApplication(const std::string& arg,
     info = ReadPkgidFromRecovery(arg);
   else
     info = arg;
-  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))
+  bf::path rw_package_directory(ci::GetRootAppPath(false, uid));
+  bf::path ro_package_directory;
+  if (uid == tzplatform_getuid(TZ_SYS_GLOBALAPP_USER) || uid == 0)
+    ro_package_directory = ci::GetRootAppPath(true, uid);
+  if ((bf::exists(rw_package_directory / info / kTizenManifestLocation) &&
+        bf::exists(rw_package_directory / info / kHybridConfigLocation)) ||
+       (bf::exists(ro_package_directory / info / kTizenManifestLocation) &&
+        bf::exists(ro_package_directory / info / kHybridConfigLocation))) {
       return true;
   } else if (!is_recovery) {
     bool tizen_manifest_found = false;