Fix codes for ManifestDirectInstall in Hybrid pkg 06/147406/1
authorJunghyun Yeon <jungh.yeon@samsung.com>
Mon, 4 Sep 2017 08:15:59 +0000 (17:15 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Mon, 4 Sep 2017 08:15:59 +0000 (17:15 +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.
- Cherry-pick https://review.tizen.org/gerrit/#/c/147402/ manually.

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

index 8c75226..b429046 100644 (file)
@@ -107,10 +107,12 @@ bool WgtAppQueryInterface::IsHybridApplication(const std::string& arg,
   else
     info = arg;
 
-  if (ci::QueryIsPackageInstalled(info, ci::GetRequestMode(uid), 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(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 {
     bool tizen_manifest_found = false;