Implement lightuser feature 98/274098/1
authorJunghyun Yeon <jungh.yeon@samsung.com>
Thu, 21 Apr 2022 07:40:32 +0000 (16:40 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Thu, 21 Apr 2022 07:40:32 +0000 (16:40 +0900)
Change-Id: Ic0d3223a51e147ad7f6eb1292decc2b4d50e68c6
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
src/wgt/step/configuration/step_parse.cc
src/wgt/step/configuration/step_parse.h

index c7d17e6..f9e1615 100644 (file)
@@ -25,6 +25,7 @@
 #include <wgt_manifest_handlers/category_handler.h>
 #include <wgt_manifest_handlers/content_handler.h>
 #include <wgt_manifest_handlers/ime_handler.h>
+#include <wgt_manifest_handlers/lightuser_handler.h>
 #include <wgt_manifest_handlers/metadata_handler.h>
 #include <wgt_manifest_handlers/provides_appdefined_privilege_handler.h>
 #include <wgt_manifest_handlers/service_handler.h>
@@ -858,8 +859,22 @@ bool StepParse::FillImeInfo() {
   return true;
 }
 
+bool StepParse::FillLightUserInfo(manifest_x* manifest) {
+  auto lightuser_info = GetManifestDataForKey<
+      const wgt::parse::LightUserInfo>(app_keys::kTizenLightUserKey);
+  if (!lightuser_info) {
+    manifest->light_user_switch_mode = strdup("default");
+    return true;
+  }
+
+  manifest->light_user_switch_mode = strdup(
+      lightuser_info->switch_mode().c_str());
+
+  return true;
+}
+
 bool StepParse::FillExtraManifestInfo(manifest_x* manifest) {
-  return FillAccounts(manifest) && FillImeInfo() && FillAppWidget();
+  return FillAccounts(manifest) && FillImeInfo() && FillAppWidget() && FillLightUserInfo(manifest);
 }
 
 bool StepParse::FillManifestX(manifest_x* manifest) {
index 0480048..ddf6b7e 100644 (file)
@@ -77,6 +77,7 @@ class StepParse : public common_installer::Step {
   bool FillAdditionalApplications(manifest_x* manifest);
   bool FillManifestX(manifest_x* manifest);
   bool FillTrustAnchorInfo(manifest_x* manifest);
+  bool FillLightUserInfo(manifest_x* manifest);
 
   std::unique_ptr<wgt::parse::WidgetConfigParser> parser_;
   ConfigLocation config_location_;