Use comp_statue_e instead of app_status 11/212211/1
authorHwankyu Jhun <h.jhun@samsung.com>
Mon, 19 Aug 2019 01:43:46 +0000 (10:43 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Mon, 19 Aug 2019 01:55:05 +0000 (10:55 +0900)
Change-Id: If870206a53a2a37a58835f1d0d6c467b74087825
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
component_based/base/component.cc
component_based/base/frame_component.cc

index 93c1e0e1b62d4bcad4839470d381f34748eaf356..3c5e7a568b78343feaead43ec920f725500b5236 100644 (file)
@@ -43,25 +43,19 @@ Component::Impl::Impl(Component* parent, Component::Type type,
 }
 
 bool Component::Impl::OnCreate() {
-  int ret = aul_comp_notify_start(inst_id_.c_str());
-  if (ret != AUL_R_OK) {
-    LOGE("Fail to start notify (%d)", ret);
-    return false;
-  }
+  aul_comp_notify_start(inst_id_.c_str());
 
   if (!parent_->OnBaseCreate())
     return false;
 
   state_ = State::Created;
+  aul_comp_status_update(inst_id_.c_str(), COMP_STATUS_CREATED);
+
   return true;
 }
 
 void Component::Impl::OnDestroy() {
-  int ret = aul_comp_status_update(inst_id_.c_str(), STATUS_DYING);
-  if (ret != AUL_R_OK) {
-    LOGE("Fail to update status (%d)", ret);
-    return;
-  }
+  aul_comp_status_update(inst_id_.c_str(), COMP_STATUS_DESTROYED);
 
   state_ = State::Dying;
   parent_->OnBaseDestroy();
@@ -72,6 +66,7 @@ void Component::Impl::OnDestroy() {
 void Component::Impl::OnStart(AppControl control, bool restarted) {
   parent_->OnBaseStart(control, restarted);
   state_ = State::Started;
+  aul_comp_status_update(inst_id_.c_str(), COMP_STATUS_STARTED);
 }
 
 void Component::Impl::OnResume() {
index 1aafc981b9f9fae813173d3bdfb461bc0b2f43c8..4101f0025c518841023276ef42a98d98a3bb9535 100644 (file)
@@ -65,11 +65,6 @@ bool FrameComponent::OnBaseCreate() {
     return false;
   }
 
-  int ret = aul_comp_status_update(GetInstanceID().c_str(), STATUS_CREATED);
-  if (ret != AUL_R_OK) {
-    LOGE("Fail to update status (%d)", ret);
-    return false;
-  }
   return true;
 }
 
@@ -89,16 +84,16 @@ void FrameComponent::OnBaseResume() {
       GetState() == State::Stopped) {
     OnResume();
     SetState(State::Running);
+    aul_comp_status_update(GetInstanceID().c_str(), COMP_STATUS_RESUMED);
   }
-  aul_comp_status_update(GetInstanceID().c_str(), STATUS_VISIBLE);
 }
 
 void FrameComponent::OnBasePause() {
   if (GetState() == State::Running) {
     OnPause();
     SetState(State::Paused);
+    aul_comp_status_update(GetInstanceID().c_str(), COMP_STATUS_PAUSED);
   }
-  aul_comp_status_update(GetInstanceID().c_str(), STATUS_BG);
 }
 
 void FrameComponent::OnBaseStop() {