diff options
3 files changed, 22 insertions, 9 deletions
diff --git a/src/components/application_manager/include/application_manager/state_controller_impl.h b/src/components/application_manager/include/application_manager/state_controller_impl.h index 9de4abd686..c6121f5d1d 100644 --- a/src/components/application_manager/include/application_manager/state_controller_impl.h +++ b/src/components/application_manager/include/application_manager/state_controller_impl.h @@ -112,6 +112,11 @@ class StateControllerImpl : public event_engine::EventObserver, void OnVideoStreamingStopped(ApplicationConstSharedPtr app) OVERRIDE; + void OnStateChanged(ApplicationSharedPtr app, + const WindowID window_id, + HmiStatePtr old_state, + HmiStatePtr new_state) OVERRIDE; + bool IsStateActive(HmiState::StateID state_id) const OVERRIDE; // EventObserver interface @@ -122,11 +127,6 @@ class StateControllerImpl : public event_engine::EventObserver, void ExitDefaultWindow(ApplicationSharedPtr app) OVERRIDE; private: - void OnStateChanged(ApplicationSharedPtr app, - const WindowID window_id, - HmiStatePtr old_state, - HmiStatePtr new_state); - int64_t RequestHMIStateChange(ApplicationConstSharedPtr app, hmi_apis::Common_HMILevel::eType level, bool send_policy_priority); @@ -423,9 +423,6 @@ class StateControllerImpl : public event_engine::EventObserver, const mobile_apis::HMILevel::eType hmi_level) const; typedef std::list<HmiState::StateID> StateIDList; - /** - * @brief active_states_ list of active temporary states(system events) - */ StateIDList active_states_; mutable sync_primitives::Lock active_states_lock_; std::map<uint32_t, HmiStatePtr> waiting_for_response_; diff --git a/src/components/include/application_manager/state_controller.h b/src/components/include/application_manager/state_controller.h index dc9e8b6c5d..2fa4b0c218 100644 --- a/src/components/include/application_manager/state_controller.h +++ b/src/components/include/application_manager/state_controller.h @@ -192,6 +192,18 @@ class StateController { virtual void OnVideoStreamingStopped(ApplicationConstSharedPtr app) = 0; /** + * @brief OnStateChanged send HMIStatusNotification if needed + * @param app application + * @param window_id id of applicaion's window to apply HMI state + * @param old_state state before change + * @param new_state state after change + */ + virtual void OnStateChanged(ApplicationSharedPtr app, + const WindowID window_id, + HmiStatePtr old_state, + HmiStatePtr new_state) = 0; + + /** * @brief Checks activity of Deactivate HMI state. * @return Returns TRUE if deactivate HMI state is active, otherwise returns * FALSE. diff --git a/src/components/include/test/application_manager/mock_state_controller.h b/src/components/include/test/application_manager/mock_state_controller.h index ae4deb8a46..545090bf30 100644 --- a/src/components/include/test/application_manager/mock_state_controller.h +++ b/src/components/include/test/application_manager/mock_state_controller.h @@ -100,7 +100,11 @@ class MockStateController : public am::StateController { void(am::ApplicationConstSharedPtr app)); MOCK_METHOD1(OnVideoStreamingStopped, void(am::ApplicationConstSharedPtr app)); - + MOCK_METHOD4(OnStateChanged, + void(am::ApplicationSharedPtr app, + const am::WindowID window_id, + am::HmiStatePtr old_state, + am::HmiStatePtr new_state)); MOCK_CONST_METHOD1(IsStateActive, bool(am::HmiState::StateID state_id)); MOCK_METHOD1(ActivateDefaultWindow, void(am::ApplicationSharedPtr app)); MOCK_METHOD1(ExitDefaultWindow, void(am::ApplicationSharedPtr app)); |