From 20e3cdecb81174916bd57de04e84d7d3da060650 Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Mon, 19 Aug 2019 10:43:46 +0900 Subject: [PATCH] Use comp_statue_e instead of app_status Change-Id: If870206a53a2a37a58835f1d0d6c467b74087825 Signed-off-by: Hwankyu Jhun --- component_based/base/component.cc | 15 +++++---------- component_based/base/frame_component.cc | 9 ++------- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/component_based/base/component.cc b/component_based/base/component.cc index 93c1e0e..3c5e7a5 100644 --- a/component_based/base/component.cc +++ b/component_based/base/component.cc @@ -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() { diff --git a/component_based/base/frame_component.cc b/component_based/base/frame_component.cc index 1aafc98..4101f00 100644 --- a/component_based/base/frame_component.cc +++ b/component_based/base/frame_component.cc @@ -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() { -- 2.34.1