Remove frame, service dependency from component 84/209984/1
authorhyunho <hhstark.kang@samsung.com>
Mon, 15 Jul 2019 02:31:16 +0000 (11:31 +0900)
committerhyunho <hhstark.kang@samsung.com>
Mon, 15 Jul 2019 02:31:16 +0000 (11:31 +0900)
Change-Id: I69cd4c1c0dcafdc983cc3f348d49ddfa2999e980
Signed-off-by: hyunho <hhstark.kang@samsung.com>
component_based/base/component.cc
component_based/base/component.h
component_based/base/component_implementation.h
component_based/base/frame_component.cc
component_based/base/frame_component.h
component_based/base/service_component.cc
component_based/base/service_component.h
component_based/efl_base/stub.cc

index 25bb68df251d240cb55a67be02bf6d09b9b35f3f..52b211702123692d103c4d06cd2802fd5b214ddb 100644 (file)
@@ -25,8 +25,6 @@
 #include "component_based/base/component.h"
 #include "component_based/base/component_implementation.h"
 #include "component_based/base/dlog_internal.h"
-#include "component_based/base/frame_component.h"
-#include "component_based/base/service_component.h"
 
 namespace component_based {
 
@@ -47,34 +45,9 @@ bool Component::Impl::OnCreate() {
     return false;
   }
 
-  if (parent_->GetType() == Component::Type::Frame) {
-    FrameComponent* component = static_cast<FrameComponent*>(parent_);
-    std::unique_ptr<IWindow> win = component->OnCreate();
-    if (win == nullptr) {
-      LOGE("OnCreate() returns nullptr");
-      return false;
-    }
-
-    auto& mgr = internal::ComponentManager::GetInst();
-    if (!mgr.Bind(component->GetInstanceID(), std::move(win))) {
-      LOGE("Bind window fail");
-      return false;
-    }
-
-    ret = aul_comp_status_update(inst_id_.c_str(), STATUS_CREATED);
-    if (ret != AUL_R_OK) {
-      LOGE("Fail to update status (%d)", ret);
-      return false;
-    }
-
-  } else {
-    ServiceComponent* component = static_cast<ServiceComponent*>(parent_);
-    bool r = component->OnCreate();
-    if (!r) {
-      LOGE("OnCreate() returns false");
-      return false;
-    }
-  }
+  if (!parent_->OnBaseCreate())
+    return false;
+
   state_ = State::Created;
   return true;
 }
@@ -87,57 +60,22 @@ void Component::Impl::OnDestroy() {
   }
 
   state_ = State::Dying;
-  if (parent_->GetType() == Component::Type::Frame) {
-    FrameComponent* component = static_cast<FrameComponent*>(parent_);
-    component->OnDestroy();
-  } else {
-    ServiceComponent* component = static_cast<ServiceComponent*>(parent_);
-    component->OnDestroy();
-  }
+  parent_->OnBaseDestroy();
 
   aul_comp_notify_exit(inst_id_.c_str());
 }
 
 void Component::Impl::OnStart(AppControl control, bool restarted) {
-  if (parent_->GetType() == Component::Type::Frame) {
-    FrameComponent* component = static_cast<FrameComponent*>(parent_);
-    tizen_base::Bundle content = GetContent();
-    component->OnRestoreContent(content);
-    component->OnStart(control, restarted);
-  } else {
-    ServiceComponent* component = static_cast<ServiceComponent*>(parent_);
-    tizen_base::Bundle content = GetContent();
-    component->OnRestoreContent(content);
-    component->OnStartCommand(control, restarted);
-    component->OnSaveContent(content);
-    SetContent(std::move(content));
-  }
-
+  parent_->OnBaseStart(control, restarted);
   state_ = State::Started;
 }
 
 void Component::Impl::OnResume() {
-  if (parent_->GetType() == Component::Type::Frame) {
-    if (state_ == State::Paused ||
-        state_ == State::Started ||
-        state_ == State::Stopped) {
-      FrameComponent* component = static_cast<FrameComponent*>(parent_);
-      component->OnResume();
-      state_ = State::Running;
-    }
-    aul_comp_status_update(inst_id_.c_str(), STATUS_VISIBLE);
-  }
+  parent_->OnBaseResume();
 }
 
 void Component::Impl::OnPause() {
-  if (parent_->GetType() == Component::Type::Frame) {
-    if (state_ == State::Running) {
-      FrameComponent* component = static_cast<FrameComponent*>(parent_);
-      component->OnPause();
-      state_ = State::Paused;
-    }
-    aul_comp_status_update(inst_id_.c_str(), STATUS_BG);
-  }
+  parent_->OnBasePause();
 }
 
 void Component::Impl::OnStop() {
@@ -146,43 +84,84 @@ void Component::Impl::OnStop() {
       state_ == State::Stopped)
     return;
 
-  if (parent_->GetType() == Component::Type::Frame) {
-    FrameComponent* component = static_cast<FrameComponent*>(parent_);
-    component->OnStop();
-    tizen_base::Bundle content = GetContent();
-    component->OnSaveContent(content);
-    SetContent(std::move(content));
-  }
+  parent_->OnBaseStop();
   state_ = State::Stopped;
 }
 
 void Component::Impl::OnAction(std::string action, AppControl app_control) {
-  parent_->OnAction(std::move(action), std::move(app_control));
+  parent_->OnBaseAction(std::move(action), std::move(app_control));
 }
 
 void Component::Impl::OnLowMemory(LowMemory::Status status) {
-  parent_->OnLowMemory(status);
+  parent_->OnBaseLowMemory(status);
 }
 
 void Component::Impl::OnLowBattery(LowBattery::Status status) {
-  parent_->OnLowBattery(status);
+  parent_->OnBaseLowBattery(status);
 }
 
 void Component::Impl::OnDeviceOrientationChanged(
        DeviceOrientation::Orientation orientation) {
-  parent_->OnDeviceOrientationChanged(orientation);
+  parent_->OnBaseDeviceOrientationChanged(orientation);
 }
 
 void Component::Impl::OnLanguageChanged(std::string lang) {
-  parent_->OnLanguageChanged(std::move(lang));
+  parent_->OnBaseLanguageChanged(std::move(lang));
 }
 
 void Component::Impl::OnRegionFormatChanged(std::string region) {
-  parent_->OnRegionFormatChanged(std::move(region));
+  parent_->OnBaseRegionFormatChanged(std::move(region));
 }
 
 void Component::Impl::OnSuspendedStateChanged(SuspendedState::State state) {
-  parent_->OnSuspendedStateChanged(state);
+  parent_->OnBaseSuspendedStateChanged(state);
+}
+
+bool Component::OnBaseCreate() {
+  return true;
+}
+
+void Component::OnBaseDestroy() {
+}
+
+void Component::OnBaseStart(AppControl control, bool restarted) {
+}
+
+void Component::OnBaseResume() {
+}
+
+void Component::OnBasePause() {
+}
+
+void Component::OnBaseStop() {
+}
+
+void Component::OnBaseRestoreContent(tizen_base::Bundle content) {
+}
+
+void Component::OnBaseSaveContent(tizen_base::Bundle& content) {
+}
+
+void Component::OnBaseAction(std::string action, AppControl app_control) {
+}
+
+void Component::OnBaseDeviceOrientationChanged(
+    DeviceOrientation::Orientation orientation) {
+}
+
+void Component::OnBaseLanguageChanged(std::string language) {
+}
+
+void Component::OnBaseRegionFormatChanged(std::string region) {
+}
+
+void Component::OnBaseLowBattery(LowBattery::Status status) {
+}
+
+void Component::OnBaseLowMemory(LowMemory::Status status) {
+}
+
+void Component::OnBaseSuspendedStateChanged(SuspendedState::State state) {
 }
 
 void Component::Impl::RegisterAction(std::string app_control_name) {
@@ -248,6 +227,22 @@ void Component::Impl::OnAppControlResult(app_control_h request,
   }
 }
 
+Component::State Component::GetState() {
+  return impl_->state_;
+}
+
+void Component::SetState(Component::State state) {
+  impl_->state_ = state;
+}
+
+tizen_base::Bundle Component::GetContent() {
+  return impl_->content_mgr_->GetContent();
+}
+
+void Component::SetContent(tizen_base::Bundle content) {
+  impl_->content_mgr_->SetContent(std::move(content));
+}
+
 void Component::Impl::SendAsync(AppControl control,
                                 AppControl::IEventListener* ev) {
   if (ev == nullptr)
@@ -307,34 +302,6 @@ Component::Component(Component::Type type, std::string comp_id,
 
 Component::~Component() = default;
 
-void Component::OnRestoreContent(tizen_base::Bundle content) {
-}
-
-void Component::OnSaveContent(tizen_base::Bundle& content) {
-}
-
-void Component::OnAction(std::string action, AppControl app_control) {
-}
-
-void Component::OnDeviceOrientationChanged(
-    DeviceOrientation::Orientation orientation) {
-}
-
-void Component::OnLanguageChanged(std::string language) {
-}
-
-void Component::OnRegionFormatChanged(std::string region) {
-}
-
-void Component::OnLowBattery(LowBattery::Status status) {
-}
-
-void Component::OnLowMemory(LowMemory::Status status) {
-}
-
-void Component::OnSuspendedStateChanged(SuspendedState::State state) {
-}
-
 std::string Component::GetComponentID() {
   return impl_->GetComponentID();
 }
index 2469014409c1a3bc8156e4ea38b31ed19ae7b891..8b9a58a9b49f5e8c861be2a9f92043d6fce94015 100644 (file)
@@ -37,6 +37,16 @@ namespace component_based {
 
 class EXPORT_API Component {
  public:
+  enum class State {
+    None,
+    Created,
+    Started,
+    Running,
+    Paused,
+    Stopped,
+    Dying,
+  };
+
   enum class Type {
     Frame,
     Service,
@@ -51,16 +61,22 @@ class EXPORT_API Component {
   Component(Type type, std::string comp_id, std::string inst_id);
   virtual ~Component();
 
-  virtual void OnRestoreContent(tizen_base::Bundle content);
-  virtual void OnSaveContent(tizen_base::Bundle& content);
-  virtual void OnAction(std::string action, AppControl app_control);
-  virtual void OnDeviceOrientationChanged(
+  virtual bool OnBaseCreate();
+  virtual void OnBaseDestroy();
+  virtual void OnBaseStart(AppControl control, bool restarted);
+  virtual void OnBaseResume();
+  virtual void OnBasePause();
+  virtual void OnBaseStop();
+  virtual void OnBaseRestoreContent(tizen_base::Bundle content);
+  virtual void OnBaseSaveContent(tizen_base::Bundle& content);
+  virtual void OnBaseAction(std::string action, AppControl app_control);
+  virtual void OnBaseDeviceOrientationChanged(
       DeviceOrientation::Orientation orientation);
-  virtual void OnLanguageChanged(std::string language);
-  virtual void OnRegionFormatChanged(std::string region);
-  virtual void OnLowBattery(LowBattery::Status status);
-  virtual void OnLowMemory(LowMemory::Status status);
-  virtual void OnSuspendedStateChanged(SuspendedState::State state);
+  virtual void OnBaseLanguageChanged(std::string language);
+  virtual void OnBaseRegionFormatChanged(std::string region);
+  virtual void OnBaseLowBattery(LowBattery::Status status);
+  virtual void OnBaseLowMemory(LowMemory::Status status);
+  virtual void OnBaseSuspendedStateChanged(SuspendedState::State state);
 
   std::string GetComponentID();
   std::string GetInstanceID();
@@ -72,6 +88,12 @@ class EXPORT_API Component {
   void SendAsync(AppControl control, AppControl::IEventListener* ev);
   AppControl Send(AppControl control);
 
+ protected:
+  State GetState();
+  void SetState(State state);
+  tizen_base::Bundle GetContent();
+  void SetContent(tizen_base::Bundle content);
+
  private:
   class Impl;
   std::unique_ptr<Impl> impl_;
index e1d0c3936364af205855fbf4c63e7ba661c4985e..568aec4e5a420ee7c9bb10622f3484cde003e4bb 100644 (file)
@@ -37,15 +37,6 @@ class Component::Impl : internal::ComponentManager::IEventListener,
                         internal::SystemEvent::IEventListener,
                         internal::Action::IEventListener {
  public:
-  enum class State {
-    None,
-    Created,
-    Started,
-    Running,
-    Paused,
-    Stopped,
-    Dying,
-  };
 
   virtual ~Impl() = default;
   bool OnCreate() override;
@@ -84,14 +75,6 @@ class Component::Impl : internal::ComponentManager::IEventListener,
     return res_mgr_;
   }
 
-  tizen_base::Bundle GetContent() {
-    return content_mgr_->GetContent();
-  }
-
-  void SetContent(tizen_base::Bundle content) {
-    content_mgr_->SetContent(std::move(content));
-  }
-
   void SendAsync(AppControl control, AppControl::IEventListener* ev);
   AppControl Send(AppControl control);
 
index 982e0be1f996932006218a608ba8da23cd16c11c..d003277db4a6bbec3787c5c6f8deb31397fb0aa3 100644 (file)
@@ -15,6 +15,8 @@
  */
 
 #include <app_common.h>
+#include <aul.h>
+#include <aul_comp_status.h>
 
 #include <memory>
 
@@ -50,6 +52,91 @@ const IWindow* FrameComponent::GetWindow() {
   return mgr.GetWindow(GetInstanceID());
 }
 
+bool FrameComponent::OnBaseCreate() {
+  std::unique_ptr<IWindow> win = OnCreate();
+  if (win == nullptr) {
+    LOGE("OnCreate() returns nullptr");
+    return false;
+  }
+
+  auto& mgr = internal::ComponentManager::GetInst();
+  if (!mgr.Bind(GetInstanceID(), std::move(win))) {
+    LOGE("Bind window fail");
+    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;
+}
+
+void FrameComponent::OnBaseDestroy() {
+  OnDestroy();
+}
+
+void FrameComponent::OnBaseStart(AppControl control, bool restarted) {
+    tizen_base::Bundle content = GetContent();
+    OnBaseRestoreContent(content);
+    OnStart(control, restarted);
+}
+
+void FrameComponent::OnBaseResume() {
+
+  if (GetState() == State::Paused ||
+      GetState() == State::Started ||
+      GetState() == State::Stopped) {
+    OnResume();
+    SetState(State::Running);
+  }
+  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(), STATUS_BG);
+}
+
+void FrameComponent::OnBaseStop() {
+  OnStop();
+  tizen_base::Bundle content = GetContent();
+  OnBaseSaveContent(content);
+  SetContent(std::move(content));
+}
+
+void FrameComponent::OnBaseRestoreContent(tizen_base::Bundle content) {
+}
+
+void FrameComponent::OnBaseSaveContent(tizen_base::Bundle& content) {
+}
+
+void FrameComponent::OnBaseAction(std::string action, AppControl app_control) {
+}
+
+void FrameComponent::OnBaseDeviceOrientationChanged(
+    DeviceOrientation::Orientation orientation) {
+}
+
+void FrameComponent::OnBaseLanguageChanged(std::string language) {
+}
+
+void FrameComponent::OnBaseRegionFormatChanged(std::string region) {
+}
+
+void FrameComponent::OnBaseLowBattery(LowBattery::Status status) {
+}
+
+void FrameComponent::OnBaseLowMemory(LowMemory::Status status) {
+}
+
+void FrameComponent::OnBaseSuspendedStateChanged(SuspendedState::State state) {
+}
+
 std::unique_ptr<IWindow> FrameComponent::OnCreate() {
   return nullptr;
 }
index d8ebb44914039a1febcd2dbc26c16e8522819ba6..26125df24a831e1fbb38001f4a2459dc6887d47a 100644 (file)
@@ -52,6 +52,23 @@ class EXPORT_API FrameComponent : public Component {
   DisplayStatus GetDisplayStatus();
   const IWindow* GetWindow();
 
+  bool OnBaseCreate() override;
+  void OnBaseDestroy() override;
+  void OnBaseStart(AppControl control, bool restarted) override;
+  void OnBaseResume() override;
+  void OnBasePause() override;
+  void OnBaseStop() override;
+  void OnBaseRestoreContent(tizen_base::Bundle content) override;
+  void OnBaseSaveContent(tizen_base::Bundle& content) override;
+  void OnBaseAction(std::string action, AppControl app_control) override;
+  void OnBaseDeviceOrientationChanged(
+      DeviceOrientation::Orientation orientation) override;
+  void OnBaseLanguageChanged(std::string language) override;
+  void OnBaseRegionFormatChanged(std::string region) override;
+  void OnBaseLowBattery(LowBattery::Status status) override;
+  void OnBaseLowMemory(LowMemory::Status status) override;
+  void OnBaseSuspendedStateChanged(SuspendedState::State state) override;
+
   virtual std::unique_ptr<IWindow> OnCreate();
   virtual void OnStart(AppControl app_control, bool restarted);
   virtual void OnResume();
index 6c8daa909fe8f4e490c6eedc48559997b146da39..b57e7b5f8fb7c7db65b40953913264f7ecc7e5a2 100644 (file)
@@ -27,6 +27,64 @@ ServiceComponent::ServiceComponent(std::string comp_id, std::string inst_id)
 
 ServiceComponent::~ServiceComponent() = default;
 
+bool ServiceComponent::OnBaseCreate() {
+  bool r = OnCreate();
+  if (!r) {
+    LOGE("OnCreate() returns false");
+    return false;
+  }
+  return true;
+}
+
+void ServiceComponent::OnBaseDestroy() {
+  OnDestroy();
+}
+
+void ServiceComponent::OnBaseStart(AppControl control, bool restarted) {
+  tizen_base::Bundle content = GetContent();
+  OnBaseRestoreContent(content);
+  OnStartCommand(control, restarted);
+  OnBaseSaveContent(content);
+  SetContent(std::move(content));
+}
+
+void ServiceComponent::OnBaseResume() {
+}
+
+void ServiceComponent::OnBasePause() {
+}
+
+void ServiceComponent::OnBaseStop() {
+}
+
+void ServiceComponent::OnBaseRestoreContent(tizen_base::Bundle content) {
+}
+
+void ServiceComponent::OnBaseSaveContent(tizen_base::Bundle& content) {
+}
+
+void ServiceComponent::OnBaseAction(std::string action, AppControl app_control) {
+}
+
+void ServiceComponent::OnBaseDeviceOrientationChanged(
+    DeviceOrientation::Orientation orientation) {
+}
+
+void ServiceComponent::OnBaseLanguageChanged(std::string language) {
+}
+
+void ServiceComponent::OnBaseRegionFormatChanged(std::string region) {
+}
+
+void ServiceComponent::OnBaseLowBattery(LowBattery::Status status) {
+}
+
+void ServiceComponent::OnBaseLowMemory(LowMemory::Status status) {
+}
+
+void ServiceComponent::OnBaseSuspendedStateChanged(SuspendedState::State state) {
+}
+
 bool ServiceComponent::OnCreate() {
   return false;
 }
index fbf6b729b44a2b0fb465fef6569802700652e90d..5e2f1ef89eec64edb33028c5aa997675bd657314 100644 (file)
@@ -42,6 +42,23 @@ class EXPORT_API ServiceComponent : public Component {
   ServiceComponent(std::string comp_id, std::string inst_id);
   virtual ~ServiceComponent();
 
+  bool OnBaseCreate() override;
+  void OnBaseDestroy() override;
+  void OnBaseStart(AppControl control, bool restarted) override;
+  void OnBaseResume() override;
+  void OnBasePause() override;
+  void OnBaseStop() override;
+  void OnBaseRestoreContent(tizen_base::Bundle content) override;
+  void OnBaseSaveContent(tizen_base::Bundle& content) override;
+  void OnBaseAction(std::string action, AppControl app_control) override;
+  void OnBaseDeviceOrientationChanged(
+      DeviceOrientation::Orientation orientation) override;
+  void OnBaseLanguageChanged(std::string language) override;
+  void OnBaseRegionFormatChanged(std::string region) override;
+  void OnBaseLowBattery(LowBattery::Status status) override;
+  void OnBaseLowMemory(LowMemory::Status status) override;
+  void OnBaseSuspendedStateChanged(SuspendedState::State state) override;
+
   virtual bool OnCreate();
   virtual void OnStartCommand(AppControl app_control, bool restarted);
   virtual void OnDestroy();
index 788187b17e46f053acb317c0fd99920af5b91ba7..1e311f701c6913ba0a3841457d445939008413e7 100644 (file)
@@ -216,23 +216,23 @@ class StubFrameComponent : public component_based::FrameComponent {
       cb_.destroy(this, user_data_);
   }
 
-  void OnRestoreContent(tizen_base::Bundle content) override {
+  void OnBaseRestoreContent(tizen_base::Bundle content) override {
     if (cb_.restore_content)
       cb_.restore_content(this, content.GetHandle(), user_data_);
   }
 
-  void OnSaveContent(tizen_base::Bundle& content) override {
+  void OnBaseSaveContent(tizen_base::Bundle& content) override {
     if (cb_.save_content)
       cb_.save_content(this, content.GetHandle(), user_data_);
   }
 
-  void OnAction(std::string action,
+  void OnBaseAction(std::string action,
                 component_based::AppControl app_control) override {
     if (cb_.action)
       cb_.action(this, action.c_str(), app_control.GetHandle(), user_data_);
   }
 
-  void OnDeviceOrientationChanged(
+  void OnBaseDeviceOrientationChanged(
       component_based::DeviceOrientation::Orientation orientation) override {
     if (cb_.device_orientation_changed) {
       cb_.device_orientation_changed(this,
@@ -241,17 +241,17 @@ class StubFrameComponent : public component_based::FrameComponent {
     }
   }
 
-  void OnLanguageChanged(std::string language) override {
+  void OnBaseLanguageChanged(std::string language) override {
     if (cb_.language_changed)
       cb_.language_changed(this, language.c_str(), user_data_);
   }
 
-  void OnRegionFormatChanged(std::string region) override {
+  void OnBaseRegionFormatChanged(std::string region) override {
     if (cb_.region_format_changed)
       cb_.region_format_changed(this, region.c_str(), user_data_);
   }
 
-  void OnLowBattery(component_based::LowBattery::Status status) override {
+  void OnBaseLowBattery(component_based::LowBattery::Status status) override {
     if (cb_.low_battery) {
       cb_.low_battery(this,
           static_cast<component_low_battery_status_e>(status),
@@ -259,7 +259,7 @@ class StubFrameComponent : public component_based::FrameComponent {
     }
   }
 
-  void OnLowMemory(component_based::LowMemory::Status status) override {
+  void OnBaseLowMemory(component_based::LowMemory::Status status) override {
     if (cb_.low_memory) {
       cb_.low_memory(this,
           static_cast<component_low_memory_status_e>(status),
@@ -267,7 +267,7 @@ class StubFrameComponent : public component_based::FrameComponent {
     }
   }
 
-  void OnSuspendedStateChanged(
+  void OnBaseSuspendedStateChanged(
       component_based::SuspendedState::State state) override {
     if (cb_.suspended_state_changed) {
       cb_.suspended_state_changed(this,
@@ -328,23 +328,23 @@ class StubServiceComponent : public component_based::ServiceComponent {
       cb_.destroy(this, user_data_);
   }
 
-  void OnRestoreContent(tizen_base::Bundle content) override {
+  void OnBaseRestoreContent(tizen_base::Bundle content) override {
     if (cb_.restore_content)
       cb_.restore_content(this, content.GetHandle(), user_data_);
   }
 
-  void OnSaveContent(tizen_base::Bundle& content) override {
+  void OnBaseSaveContent(tizen_base::Bundle& content) override {
     if (cb_.save_content)
       cb_.save_content(this, content.GetHandle(), user_data_);
   }
 
-  void OnAction(std::string action,
+  void OnBaseAction(std::string action,
                 component_based::AppControl app_control) override {
     if (cb_.action)
       cb_.action(this, action.c_str(), app_control.GetHandle(), user_data_);
   }
 
-  void OnDeviceOrientationChanged(
+  void OnBaseDeviceOrientationChanged(
       component_based::DeviceOrientation::Orientation orientation) override {
     if (cb_.device_orientation_changed) {
       cb_.device_orientation_changed(this,
@@ -353,17 +353,17 @@ class StubServiceComponent : public component_based::ServiceComponent {
     }
   }
 
-  void OnLanguageChanged(std::string language) override {
+  void OnBaseLanguageChanged(std::string language) override {
     if (cb_.language_changed)
       cb_.language_changed(this, language.c_str(), user_data_);
   }
 
-  void OnRegionFormatChanged(std::string region) override {
+  void OnBaseRegionFormatChanged(std::string region) override {
     if (cb_.region_format_changed)
       cb_.region_format_changed(this, region.c_str(), user_data_);
   }
 
-  void OnLowBattery(component_based::LowBattery::Status status) override {
+  void OnBaseLowBattery(component_based::LowBattery::Status status) override {
     if (cb_.low_battery) {
       cb_.low_battery(this,
           static_cast<component_low_battery_status_e>(status),
@@ -371,7 +371,7 @@ class StubServiceComponent : public component_based::ServiceComponent {
     }
   }
 
-  void OnLowMemory(component_based::LowMemory::Status status) override {
+  void OnBaseLowMemory(component_based::LowMemory::Status status) override {
     if (cb_.low_memory) {
       cb_.low_memory(this,
           static_cast<component_low_memory_status_e>(status),
@@ -379,7 +379,7 @@ class StubServiceComponent : public component_based::ServiceComponent {
     }
   }
 
-  void OnSuspendedStateChanged(
+  void OnBaseSuspendedStateChanged(
       component_based::SuspendedState::State state) override {
     if (cb_.suspended_state_changed) {
       cb_.suspended_state_changed(this,