From: Woongsuk Cho Date: Wed, 6 Mar 2019 04:05:52 +0000 (+0900) Subject: Enable r2r/fnv selection for -regen-all-app option. X-Git-Tag: accepted/tizen/unified/20190403.064844~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=047b3e81ee5f8062e23c98c9f742c17d0ace4ebd;p=platform%2Fcore%2Fdotnet%2Flauncher.git Enable r2r/fnv selection for -regen-all-app option. Previous implemenataion supports r2r mode only for --regen-all-app. For convinence of development enable --r2r option for --regen-all-app. ex) nitool --r2r --rege-all-app --- diff --git a/NativeLauncher/installer-plugin/ni_common.cc b/NativeLauncher/installer-plugin/ni_common.cc index 9ca229e..8384fea 100644 --- a/NativeLauncher/installer-plugin/ni_common.cc +++ b/NativeLauncher/installer-plugin/ni_common.cc @@ -208,6 +208,7 @@ static int appAotCb(pkgmgrinfo_appinfo_h handle, void *userData) { char *pkgId = NULL; int ret = 0; + bool* enableR2R = (bool*)userData; ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgId); if (ret != PMINFO_R_OK) { @@ -221,7 +222,7 @@ static int appAotCb(pkgmgrinfo_appinfo_h handle, void *userData) } // Regenerate ni files with R2R mode forcibiliy. (there is no way to now which option is used) - if (createNiUnderPkgRoot(pkgId, true) != 0) { + if (createNiUnderPkgRoot(pkgId, *enableR2R) != 0) { fprintf(stderr, "Failed to get root path from [%s]\n", pkgId); return -1; } else { @@ -464,7 +465,7 @@ int removeNiUnderPkgRoot(const std::string& pkgName) return 0; } -int regenerateAppNI() +int regenerateAppNI(bool enableR2R) { int ret = 0; pkgmgrinfo_appinfo_metadata_filter_h handle; @@ -479,7 +480,7 @@ int regenerateAppNI() return -1; } - ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, appAotCb, NULL); + ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, appAotCb, &enableR2R); if (ret != PMINFO_R_OK) { fprintf(stderr, "Failed pkgmgrinfo_appinfo_metadata_filter_foreach\n"); pkgmgrinfo_appinfo_metadata_filter_destroy(handle); diff --git a/NativeLauncher/installer-plugin/ni_common.h b/NativeLauncher/installer-plugin/ni_common.h index d142f7d..4b17905 100644 --- a/NativeLauncher/installer-plugin/ni_common.h +++ b/NativeLauncher/installer-plugin/ni_common.h @@ -122,6 +122,6 @@ int removeNiUnderPkgRoot(const std::string& pkgId); /** * @brief regenerate native image for all installed application */ -int regenerateAppNI(); +int regenerateAppNI(bool enableR2R); #endif /* __NI_COMMON_H__ */ diff --git a/NativeLauncher/installer-plugin/nitool.cc b/NativeLauncher/installer-plugin/nitool.cc index 5c1ea0a..5339bae 100644 --- a/NativeLauncher/installer-plugin/nitool.cc +++ b/NativeLauncher/installer-plugin/nitool.cc @@ -98,7 +98,7 @@ int main(int argc, char* argv[]) } else if (cmdOptionExists(argv, argv+argc, "--reset-pkg")) { rmPkgMode = true; } else if (cmdOptionExists(argv, argv+argc, "--regen-all-app")) { - regenerateAppNI(); + regenerateAppNI(enableR2R); return 0; } else if (cmdOptionExists(argv, argv+argc, "--pkg-dll")) { pkgDllMode = true;