}
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();
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() {
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;
}
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() {