Set nodisplay for downloadable_font and tts category apps 27/89727/5
authorTomasz Iwanek <t.iwanek@samsung.com>
Mon, 26 Sep 2016 12:22:38 +0000 (14:22 +0200)
committerTomasz Iwanek <t.iwanek@samsung.com>
Wed, 28 Sep 2016 07:56:37 +0000 (00:56 -0700)
These apps aren't supposed to be run.

Change-Id: I332a5dae817d627db764086baf2413878da9fe95

src/wgt/step/configuration/step_parse.cc

index 914bbc3..d2c9b0c 100644 (file)
@@ -53,6 +53,9 @@ const char kCategoryWatchClock[] = "com.samsung.wmanager.WATCH_CLOCK";
 const std::string kManifestVersion = "1.0.0";
 const char kTizenPackageXmlNamespace[] = "http://tizen.org/ns/packages";
 const char kImeCategoryName[] = "http://tizen.org/category/ime";
+const char kDownloadableFontCategoryName[] =
+    "http://tizen.org/category/downloadable_font";
+const char kTTSCategoryName[] = "http://tizen.org/category/tts";
 
 const char kResWgt[] = "res/wgt";
 const char kConfigFileName[] = "config.xml";
@@ -291,6 +294,8 @@ bool StepParse::FillMainApplicationInfo(manifest_x* manifest) {
   }
   bool has_watch_category = false;
   bool has_ime = false;
+  bool has_downloadable_font = false;
+  bool has_tts = false;
   auto category_info =
       GetManifestDataForKey<const wgt::parse::CategoryInfoList>(
              app_keys::kTizenCategoryKey);
@@ -306,6 +311,14 @@ bool StepParse::FillMainApplicationInfo(manifest_x* manifest) {
                                        category_info->categories.end(),
                                        kImeCategoryName)
         != category_info->categories.end();
+    has_downloadable_font = std::find(category_info->categories.begin(),
+                                       category_info->categories.end(),
+                                       kDownloadableFontCategoryName)
+        != category_info->categories.end();
+    has_tts = std::find(category_info->categories.begin(),
+                                       category_info->categories.end(),
+                                       kTTSCategoryName)
+        != category_info->categories.end();
   }
 
   // application data
@@ -318,11 +331,16 @@ bool StepParse::FillMainApplicationInfo(manifest_x* manifest) {
   auto settings_info =
       GetManifestDataForKey<const wgt::parse::SettingInfo>(
              wgt::application_widget_keys::kTizenSettingKey);
+
   bool no_display = settings_info ? settings_info->no_display() : false;
-  application->nodisplay = (has_watch_category || has_ime || no_display) ?
+  bool has_no_display_category =
+      has_watch_category || has_ime || has_tts || has_downloadable_font;
+
+  application->nodisplay = (has_no_display_category || no_display) ?
       strdup("true") : strdup("false");
-  application->taskmanage = (has_watch_category || has_ime) ? strdup("false") :
+  application->taskmanage = has_no_display_category ? strdup("false") :
       strdup("true");
+
   SetApplicationXDefaults(application);
   if (has_watch_category)
     application->ambient_support =