Fix theme plugin for vitalness 55/235155/2
authorJunghyun Yeon <jungh.yeon@samsung.com>
Tue, 2 Jun 2020 08:10:50 +0000 (17:10 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Wed, 3 Jun 2020 05:01:36 +0000 (14:01 +0900)
theme plugin will return negative integer when it fails to do something.

Change-Id: Icb693b23b55c3f60dbe85e34de630bb01598a2de
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
src/theme_plugin/theme_metadata_plugin.cc

index 0236eb7..8ada18a 100644 (file)
@@ -55,7 +55,8 @@ extern "C" int PKGMGR_MDPARSER_PLUGIN_INSTALL(
 
   for (__metadata_t* md : GListRange<__metadata_t*>(metadata)) {
     if (!strcmp(md->key, kThemeMetadataKey)) {
-      InstallTheme(appid, (root_path + md->value));
+      if (!InstallTheme(appid, (root_path + md->value)))
+        return -1;
     }
   }
   return 0;
@@ -77,7 +78,8 @@ extern "C" int PKGMGR_MDPARSER_PLUGIN_UPGRADE(
 
   for (__metadata_t* md : GListRange<__metadata_t*>(metadata)) {
     if (!strcmp(md->key, kThemeMetadataKey)) {
-      UpgradeTheme(appid, (root_path + md->value));
+      if (!UpgradeTheme(appid, (root_path + md->value)))
+        return -1;
     }
   }
   return 0;
@@ -99,7 +101,8 @@ extern "C" int PKGMGR_MDPARSER_PLUGIN_UNINSTALL(
 
   for (__metadata_t* md : GListRange<__metadata_t*>(metadata)) {
     if (!strcmp(md->key, kThemeMetadataKey)) {
-      UninstallTheme(appid, (root_path + md->value));
+      if (!UninstallTheme(appid, (root_path + md->value)))
+        return -1;
     }
   }
   return 0;