Fix get setup-appid bug 42/178842/2
authorhyunho <hhstark.kang@samsung.com>
Mon, 14 May 2018 08:12:29 +0000 (17:12 +0900)
committerHyunho Kang <hhstark.kang@samsung.com>
Mon, 14 May 2018 08:34:25 +0000 (08:34 +0000)
Change-Id: Ic204c38cbb461324c5dc44da968413d07cb22301
Signed-off-by: hyunho <hhstark.kang@samsung.com>
watchface-complication/design-element.cc
watchface-complication/editables-container.cc
watchface-complication/received-editable-implementation.h
watchface-complication/received-editable.cc

index e50f36f..d64d7d3 100644 (file)
@@ -172,8 +172,7 @@ IEditable::EditableState DesignElement::GetState() {
 }
 
 const std::string DesignElement::GetSetupAppId() {
-  std::string setup_appid = "org.tizen.comp_setting";
-  // TODO(?) : from DB
+  std::string setup_appid = "";
   return setup_appid;
 }
 
index 2a05be7..ed8d46c 100644 (file)
@@ -149,6 +149,8 @@ int EditablesContainer::RequestEdit() {
       return WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY;
     }
 
+
+    bundle_add(ed, "SETUP_APPID", i.get()->GetSetupAppId().c_str());
     bundle_add(ed, "EDITABLE_ID", std::to_string(i.get()->GetEditableId()).c_str());
 
     int cur_data_idx = i.get()->GetCurDataIdx();
index 438bc48..3f0375e 100644 (file)
@@ -47,6 +47,7 @@ class ReceivedEditable::Impl {
   std::shared_ptr<IEditable::Geometry> geo_;
   EditableShapeType shape_type_ = Circle;
   std::string name_;
+  std::string setup_appid_;
   int cur_data_idx_ = -1;
   int last_data_idx_ = -1;
   IEditable::EditableState ed_state_ = Complete;
index 91e8c0e..985532c 100644 (file)
@@ -57,6 +57,10 @@ ReceivedEditable::Impl::Impl(ReceivedEditable* parent, std::string raw)
   bundle_get_str(data, "CUR_DATA_IDX", &cur_data_idx_str);
   cur_data_idx_ = atoi(cur_data_idx_str);
 
+  char* setup_appid = NULL;
+  bundle_get_str(data, "SETUP_APPID", &setup_appid);
+  setup_appid_ = std::string(setup_appid);
+
   char* editable_id_str = NULL;
   bundle_get_str(data, "EDITABLE_ID", &editable_id_str);
   id_ = atoi(editable_id_str);
@@ -181,8 +185,7 @@ IEditable::EditableState ReceivedEditable::GetState() {
 }
 
 const std::string ReceivedEditable::GetSetupAppId() {
-  // TODO(?): from db
-  return "org.tizen.comp_setting";
+  return impl_->setup_appid_;
 }
 
 int ReceivedEditable::SetContext(std::unique_ptr<Bundle> context) {