summaryrefslogtreecommitdiff
path: root/NativeLauncher/installer-plugin/prefer_dotnet_aot_plugin.cc
diff options
context:
space:
mode:
Diffstat (limited to 'NativeLauncher/installer-plugin/prefer_dotnet_aot_plugin.cc')
-rw-r--r--NativeLauncher/installer-plugin/prefer_dotnet_aot_plugin.cc22
1 files changed, 17 insertions, 5 deletions
diff --git a/NativeLauncher/installer-plugin/prefer_dotnet_aot_plugin.cc b/NativeLauncher/installer-plugin/prefer_dotnet_aot_plugin.cc
index 91928a7..a2e3659 100644
--- a/NativeLauncher/installer-plugin/prefer_dotnet_aot_plugin.cc
+++ b/NativeLauncher/installer-plugin/prefer_dotnet_aot_plugin.cc
@@ -33,6 +33,11 @@
bool aotPluginInstalled = false;
bool aotPluginFinished = false;
+typedef struct metadata_s {
+ const char* key;
+ const char* value;
+} metadata_t;
+
extern "C" int PKGMGR_MDPARSER_PLUGIN_INSTALL(const char *pkgId, const char *appId, GList *list)
{
// Can be multiple apps in one package
@@ -50,13 +55,20 @@ extern "C" int PKGMGR_MDPARSER_PLUGIN_INSTALL(const char *pkgId, const char *app
}
}
- std::string metaValue = getMetadataValue(std::string(pkgId), AOT_METADATA_KEY);
- if (metaValue.empty()) {
- _ERR("Failed to get metadata from [%s]", pkgId);
- return -1;
+ bool doAOT = false;
+ GList* iter = list;
+ while (iter) {
+ metadata_t* md = static_cast<metadata_t*>(iter->data);
+ if (strcmp(AOT_METADATA_KEY, md->key) == 0) {
+ if (strcmp(METADATA_VALUE_TRUE, md->value) == 0) {
+ doAOT = true;
+ }
+ break;
+ }
+ iter = g_list_next(iter);
}
- if (metaValue == METADATA_VALUE_TRUE) {
+ if (doAOT) {
_DBG("Prefer dotnet application AOT set TRUE");
if (initNICommon() != NI_ERROR_NONE) {