From aee8ca1c89e3d9ecb4f45da7e8c2b44a98acffa7 Mon Sep 17 00:00:00 2001 From: Changgyu Choi Date: Mon, 4 Sep 2023 16:49:19 +0900 Subject: [PATCH] Add new apis Adds: - frame_component_time_zone_changed_cb - service_component_time_zone_changed_cb Change-Id: If95cedd1fcd75aac4d7be5c5899e52087725ce55 Signed-off-by: Changgyu Choi --- component_based/base/api/base_component.h | 7 ++++++ .../base/api/base_frame_component.h | 7 ++++++ .../base/api/base_service_component.h | 7 ++++++ component_based/base/component.cc | 4 ++++ component_based/base/component.h | 2 ++ component_based/base/stub.cc | 10 +++++++++ component_based/base/system_event_interface.h | 2 ++ component_based/base/system_event_internal.h | 22 +++++++++++++++++++ .../efl_base/api/frame_component.h | 19 ++++++++++++++++ .../efl_base/api/service_component.h | 19 ++++++++++++++++ component_based/efl_base/stub.cc | 10 +++++++++ .../efl_widget_base/api/widget_component.h | 19 ++++++++++++++++ component_based/efl_widget_base/stub.cc | 8 +++++++ .../widget_base/api/base_widget_component.h | 7 ++++++ component_based/widget_base/stub.cc | 11 ++++++++++ .../test_component_based_application_base.cc | 1 + .../efl_base/test_component_based_app.cc | 1 + .../mock/base_component_callback_mock.cc | 9 ++++++++ .../mock/base_component_callback_mock.h | 2 ++ .../base_frame_component_callback_mock.cc | 9 ++++++++ .../mock/base_frame_component_callback_mock.h | 2 ++ .../base_service_component_callback_mock.cc | 9 ++++++++ .../base_service_component_callback_mock.h | 2 ++ .../mock/frame_component_callback_mock.cc | 8 +++++++ .../mock/frame_component_callback_mock.h | 2 ++ .../mock/service_component_callback_mock.cc | 8 +++++++ .../mock/service_component_callback_mock.h | 2 ++ 27 files changed, 209 insertions(+) diff --git a/component_based/base/api/base_component.h b/component_based/base/api/base_component.h index d1e8ae8..a557e3e 100644 --- a/component_based/base/api/base_component.h +++ b/component_based/base/api/base_component.h @@ -66,6 +66,12 @@ typedef void (*base_component_suspended_state_changed_cb)( component_suspended_state_e state, void *user_data); +typedef void (*base_component_time_zone_changed_cb)( + component_h context, + const char *time_zone, + const char *time_zone_id, + void *user_data); + typedef struct { base_component_restore_content_cb restore_content; base_component_save_content_cb save_content; @@ -75,6 +81,7 @@ typedef struct { base_component_low_battery_cb low_battery; base_component_low_memory_cb low_memory; base_component_suspended_state_changed_cb suspended_state_changed; + base_component_time_zone_changed_cb time_zone_changed; } base_component_lifecycle_callback_s; #ifdef __cplusplus diff --git a/component_based/base/api/base_frame_component.h b/component_based/base/api/base_frame_component.h index 767b61e..762a932 100644 --- a/component_based/base/api/base_frame_component.h +++ b/component_based/base/api/base_frame_component.h @@ -107,6 +107,12 @@ typedef void (*base_frame_component_suspended_state_changed_cb)( component_suspended_state_e state, void *user_data); +typedef void (*base_frame_component_time_zone_changed_cb)( + component_h context, + const char *time_zone, + const char *time_zone_id, + void *user_data); + typedef struct { base_frame_component_create_cb create; base_frame_component_start_cb start; @@ -123,6 +129,7 @@ typedef struct { base_frame_component_low_battery_cb low_battery; base_frame_component_low_memory_cb low_memory; base_frame_component_suspended_state_changed_cb suspended_state_changed; + base_frame_component_time_zone_changed_cb time_zone_changed; } base_frame_component_lifecycle_callback_s; #ifdef __cplusplus diff --git a/component_based/base/api/base_service_component.h b/component_based/base/api/base_service_component.h index c9cbd9c..13ce71e 100644 --- a/component_based/base/api/base_service_component.h +++ b/component_based/base/api/base_service_component.h @@ -86,6 +86,12 @@ typedef void (*base_service_component_suspended_state_changed_cb)( component_suspended_state_e state, void *user_data); +typedef void (*base_service_component_time_zone_changed_cb)( + component_h context, + const char *time_zone, + const char *time_zone_id, + void *user_data); + typedef struct { base_service_component_create_cb create; base_service_component_start_command_cb start_command; @@ -99,6 +105,7 @@ typedef struct { base_service_component_low_battery_cb low_battery; base_service_component_low_memory_cb low_memory; base_service_component_suspended_state_changed_cb suspended_state_changed; + base_service_component_time_zone_changed_cb time_zone_changed; } base_service_component_lifecycle_callback_s; #ifdef __cplusplus diff --git a/component_based/base/component.cc b/component_based/base/component.cc index 2d4c167..cb522d7 100644 --- a/component_based/base/component.cc +++ b/component_based/base/component.cc @@ -259,6 +259,10 @@ void Component::OnLowMemory(LowMemory::Status status) { void Component::OnSuspendedStateChanged(SuspendedState::State state) { } +void Component::OnTimeZoneChanged(const std::string& time_zone, + const std::string& time_zone_id) { +} + Component::State Component::GetState() { return impl_->state_; } diff --git a/component_based/base/component.h b/component_based/base/component.h index 8ec0f63..d7fc34e 100644 --- a/component_based/base/component.h +++ b/component_based/base/component.h @@ -82,6 +82,8 @@ class EXPORT_API Component : public tizen_cpp::AppCoreMultiWindowBase::Context, void OnLowBattery(LowBattery::Status status) override; void OnLowMemory(LowMemory::Status status) override; void OnSuspendedStateChanged(SuspendedState::State state) override; + void OnTimeZoneChanged(const std::string& time_zone, + const std::string& time_zone_id) override; void Finish(); void RegisterAction(std::string app_control_name); bool DeregisterAction(std::string app_control_name); diff --git a/component_based/base/stub.cc b/component_based/base/stub.cc index 3ecf364..3a33300 100644 --- a/component_based/base/stub.cc +++ b/component_based/base/stub.cc @@ -250,6 +250,16 @@ class StubBaseComponent : public Component { } } + void OnTimeZoneChanged(const std::string& time_zone, + const std::string& time_zone_id) override { + Component::OnTimeZoneChanged(time_zone, time_zone_id); + + if (cb_.time_zone_changed) { + cb_.time_zone_changed(this, time_zone.c_str(), + time_zone_id.c_str(), user_data_); + } + } + private: base_component_lifecycle_callback_s cb_; void* user_data_; diff --git a/component_based/base/system_event_interface.h b/component_based/base/system_event_interface.h index 145ad84..6a3c250 100644 --- a/component_based/base/system_event_interface.h +++ b/component_based/base/system_event_interface.h @@ -39,6 +39,8 @@ class ISystemEvent { DeviceOrientation::Orientation orientation) = 0; virtual void OnRegionFormatChanged(std::string region) = 0; virtual void OnSuspendedStateChanged(SuspendedState::State state) = 0; + virtual void OnTimeZoneChanged(const std::string& time_zone, + const std::string& time_zone_id) = 0; }; } // namespace component_based diff --git a/component_based/base/system_event_internal.h b/component_based/base/system_event_internal.h index 235bdc5..7036167 100644 --- a/component_based/base/system_event_internal.h +++ b/component_based/base/system_event_internal.h @@ -190,6 +190,27 @@ class SuspendedStateChangeEvent : public tizen_cpp::AppCoreBase::EventBase { ISystemEvent* ev_; }; +class TimeZoneChangedEvent : public tizen_cpp::AppCoreBase::EventBase { + public: + TimeZoneChangedEvent(ISystemEvent* ev) + : tizen_cpp::AppCoreBase::EventBase( + tizen_cpp::AppCoreBase::IEvent::Type::TIME_ZONE_CHANGED), ev_(ev) { + } + + void OnEvent(const std::string& val) override { + size_t split_pos = val.find('|'); + std::string time_zone = val.substr(0, split_pos); + std::string time_zone_id = val.substr(split_pos + 1); + ev_->OnTimeZoneChanged(time_zone, time_zone_id); + } + + void OnEvent(int val) override { + } + + private: + ISystemEvent* ev_; +}; + class SystemEvent { public: explicit SystemEvent(ISystemEvent* ev, tizen_cpp::AppCoreBase* app) { @@ -199,6 +220,7 @@ class SystemEvent { app->AddEvent(std::make_shared(ev)); app->AddEvent(std::make_shared(ev)); app->AddEvent(std::make_shared(ev)); + app->AddEvent(std::make_shared(ev)); } }; diff --git a/component_based/efl_base/api/frame_component.h b/component_based/efl_base/api/frame_component.h index 1e8577d..e9c9f02 100644 --- a/component_based/efl_base/api/frame_component.h +++ b/component_based/efl_base/api/frame_component.h @@ -255,6 +255,24 @@ typedef void (*frame_component_suspended_state_changed_cb)( component_suspended_state_e state, void *user_data); +/** + * @brief Called when the time zone of the frame component is changed. + * @details An application can obtain a changed time zone (e.g., "+9:00") and a time zone id (e.g., "Asia/Seoul"). + * @since_tizen 8.0 + * @remarks The @a context should not be released. The @a context can be used only in the callback. + * @remarks @a time_zone and @a time_zone_id must not be deallocated by the component. @a time_zone and @a time_zone_id can be used only in the callback. + * + * @param[in] context The context of the frame component instance + * @param[in] time_zone The time zone + * @param[in] time_zone_id The time zone id + * @param[in] user_data The user data passed from component_based_app_add_frame_component() function + */ +typedef void (*frame_component_time_zone_changed_cb)( + component_h context, + const char *time_zone, + const char *time_zone_id, + void *user_data); + /** * @brief The structure type containing the set of callback functions for lifecycle of a frame component instance. * @since_tizen 5.5 @@ -275,6 +293,7 @@ typedef struct { frame_component_low_battery_cb low_battery; /**< The callback function called when the battery status is changed. */ frame_component_low_memory_cb low_memory; /**< The callback function called when the memory status is changed */ frame_component_suspended_state_changed_cb suspended_state_changed; /**< The callback function called when the suspended state of the frame component is changed */ + frame_component_time_zone_changed_cb time_zone_changed; /**< The callback function called when the time zone of the frame component is changed (Since 8.0) */ } frame_component_lifecycle_callback_s; /** diff --git a/component_based/efl_base/api/service_component.h b/component_based/efl_base/api/service_component.h index 06d60a6..95a2f9b 100644 --- a/component_based/efl_base/api/service_component.h +++ b/component_based/efl_base/api/service_component.h @@ -218,6 +218,24 @@ typedef void (*service_component_suspended_state_changed_cb)( component_suspended_state_e state, void *user_data); +/** + * @brief Called when the time zone of the service component is changed. + * @details An application can obtain a changed time zone (e.g., "+9:00") and a time zone id (e.g., "Asia/Seoul"). + * @since_tizen 8.0 + * @remarks The @a context should not be released. The @a context can be used only in the callback. + * @remarks @a time_zone and @a time_zone_id must not be deallocated by the component. @a time_zone and @a time_zone_id can be used only in the callback. + * + * @param[in] context The context of the service component instance + * @param[in] time_zone The time zone + * @param[in] time_zone_id The time zone id + * @param[in] user_data The user data passed from component_based_app_add_service_component() function + */ +typedef void (*service_component_time_zone_changed_cb)( + component_h context, + const char *time_zone, + const char *time_zone_id, + void *user_data); + /** * @brief The structure type containing the set of callback functions for lifecycle of a service component instance. * @since_tizen 5.5 @@ -235,6 +253,7 @@ typedef struct { service_component_low_battery_cb low_battery; /**< The callback function called when the battery status is changed. */ service_component_low_memory_cb low_memory; /**< The callback function called when the memory status is changed */ service_component_suspended_state_changed_cb suspended_state_changed; /**< The callback function called when the suspended state of the service component is changed */ + service_component_time_zone_changed_cb time_zone_changed; /**< The callback function called when the time zone of the service component is changed (Since 8.0) */ } service_component_lifecycle_callback_s; diff --git a/component_based/efl_base/stub.cc b/component_based/efl_base/stub.cc index 07b2067..e1691cf 100644 --- a/component_based/efl_base/stub.cc +++ b/component_based/efl_base/stub.cc @@ -284,6 +284,16 @@ class StubFrameComponent : public FrameComponent { } } + void OnTimeZoneChanged(const std::string& time_zone, const std::string& time_zone_id) override { + FrameComponent::OnTimeZoneChanged(time_zone, time_zone_id); + if (cb_.time_zone_changed) { + cb_.time_zone_changed(this, + time_zone.c_str(), + time_zone_id.c_str(), + user_data_); + } + } + private: frame_component_lifecycle_callback_s cb_; void* user_data_; diff --git a/component_based/efl_widget_base/api/widget_component.h b/component_based/efl_widget_base/api/widget_component.h index ac69ff0..dbb443e 100644 --- a/component_based/efl_widget_base/api/widget_component.h +++ b/component_based/efl_widget_base/api/widget_component.h @@ -232,6 +232,24 @@ typedef void (*widget_component_suspended_state_changed_cb)( component_suspended_state_e state, void *user_data); +/** + * @brief Called when the time zone of the widget component is changed. + * @details An application can obtain a changed time zone (e.g., "+9:00") and a time zone id (e.g., "Asia/Seoul"). + * @since_tizen 8.0 + * @remarks The @a context should not be released. The @a context can be used only in the callback. + * @remarks @a time_zone and @a time_zone_id must not be deallocated by the component. @a time_zone and @a time_zone_id can be used only in the callback. + * + * @param[in] context The context of the frame component instance + * @param[in] time_zone The time zone + * @param[in] time_zone_id The time zone id + * @param[in] user_data The user data passed from component_based_app_add_widget_component() function + */ +typedef void (*widget_component_time_zone_changed_cb)( + component_h context, + const char *time_zone, + const char *time_zone_id, + void *user_data); + /** * @brief The structure type containing the set of callback functions for lifecycle of a widget component instance. * @since_tizen 6.5 @@ -251,6 +269,7 @@ typedef struct { widget_component_low_battery_cb low_battery; widget_component_low_memory_cb low_memory; widget_component_suspended_state_changed_cb suspended_state_changed; + widget_component_time_zone_changed_cb time_zone_changed; } widget_component_lifecycle_callback_s; /** diff --git a/component_based/efl_widget_base/stub.cc b/component_based/efl_widget_base/stub.cc index 746ecd0..9c5bb3f 100644 --- a/component_based/efl_widget_base/stub.cc +++ b/component_based/efl_widget_base/stub.cc @@ -195,6 +195,14 @@ class StubWidgetComponent : public WidgetComponent { } } + void OnTimeZoneChanged(const std::string& time_zone, + const std::string& time_zone_id) override { + if (cb_.time_zone_changed) { + cb_.time_zone_changed(this, time_zone.c_str(), + time_zone_id.c_str(), user_data_); + } + } + private: widget_component_lifecycle_callback_s cb_; void* user_data_; diff --git a/component_based/widget_base/api/base_widget_component.h b/component_based/widget_base/api/base_widget_component.h index cd012fc..e139153 100644 --- a/component_based/widget_base/api/base_widget_component.h +++ b/component_based/widget_base/api/base_widget_component.h @@ -100,6 +100,12 @@ typedef void (*base_widget_component_suspended_state_changed_cb)( component_suspended_state_e state, void *user_data); +typedef void (*base_widget_component_time_zone_changed_cb)( + component_h context, + const char *time_zone, + const char *time_zone_id, + void *user_data); + typedef struct { base_widget_component_create_cb create; base_widget_component_start_cb start; @@ -115,6 +121,7 @@ typedef struct { base_widget_component_low_battery_cb low_battery; base_widget_component_low_memory_cb low_memory; base_widget_component_suspended_state_changed_cb suspended_state_changed; + base_widget_component_time_zone_changed_cb time_zone_changed; } base_widget_component_lifecycle_callback_s; #ifdef __cplusplus diff --git a/component_based/widget_base/stub.cc b/component_based/widget_base/stub.cc index 63cd5d1..ef2335b 100644 --- a/component_based/widget_base/stub.cc +++ b/component_based/widget_base/stub.cc @@ -216,6 +216,17 @@ class StubWidgetComponent : public WidgetComponent { } } + void OnTimeZoneChanged(const std::string& time_zone, + const std::string& time_zone_id) override { + WidgetComponent::OnTimeZoneChanged(time_zone, time_zone_id); + if (cb_.time_zone_changed) { + cb_.time_zone_changed(this, + time_zone.c_str(), + time_zone_id.c_str(), + user_data_); + } + } + private: base_widget_component_lifecycle_callback_s cb_; void* user_data_; diff --git a/test/unit_tests/base/test_component_based_application_base.cc b/test/unit_tests/base/test_component_based_application_base.cc index 9b1acc3..9ff5c77 100644 --- a/test/unit_tests/base/test_component_based_application_base.cc +++ b/test/unit_tests/base/test_component_based_application_base.cc @@ -156,6 +156,7 @@ ACTION_P2(SendEvents, mock, id) { com->OnLowBattery(LowBattery::Status::CriticalLow); com->OnLowMemory(LowMemory::Status::SoftWarning); com->OnSuspendedStateChanged(SuspendedState::State::Will_Enter); + com->OnTimeZoneChanged("+9:00", "Asia/Seoul"); } ACTION_P(RegisterAction, id) { diff --git a/test/unit_tests/efl_base/test_component_based_app.cc b/test/unit_tests/efl_base/test_component_based_app.cc index e4ee6ab..cd7ebdc 100644 --- a/test/unit_tests/efl_base/test_component_based_app.cc +++ b/test/unit_tests/efl_base/test_component_based_app.cc @@ -159,6 +159,7 @@ ACTION_P2(SendEvents, mock, id) { com->OnLowBattery(LowBattery::Status::CriticalLow); com->OnLowMemory(LowMemory::Status::SoftWarning); com->OnSuspendedStateChanged(SuspendedState::State::Will_Enter); + com->OnTimeZoneChanged("+9:00", "Asia/Seoul"); } } // namespace diff --git a/test/unit_tests/mock/base_component_callback_mock.cc b/test/unit_tests/mock/base_component_callback_mock.cc index 5f8f407..466ba17 100644 --- a/test/unit_tests/mock/base_component_callback_mock.cc +++ b/test/unit_tests/mock/base_component_callback_mock.cc @@ -72,6 +72,13 @@ void __base_component_suspended_state_changed_cb(component_h context, base_component_suspended_state_changed_cb, context, state, user_data); } +void __base_component_time_zone_changed_cb(component_h context, + const char* time_zone, const char* time_zone_id, void* user_data) { + MOCK_HOOK_P4(BaseComponentCallbackMock, + base_component_time_zone_changed_cb, + context, time_zone, time_zone_id, user_data); +} + } // namespace base_component_lifecycle_callback_s BaseComponentCallbackMock::GetCallbacks() { @@ -92,6 +99,8 @@ base_component_lifecycle_callback_s BaseComponentCallbackMock::GetCallbacks() { __base_component_low_memory_cb; callback.suspended_state_changed = __base_component_suspended_state_changed_cb; + callback.time_zone_changed = + __base_component_time_zone_changed_cb; return callback; } diff --git a/test/unit_tests/mock/base_component_callback_mock.h b/test/unit_tests/mock/base_component_callback_mock.h index 9f7bbcd..8921044 100644 --- a/test/unit_tests/mock/base_component_callback_mock.h +++ b/test/unit_tests/mock/base_component_callback_mock.h @@ -49,6 +49,8 @@ class BaseComponentCallbackMock : public virtual ModuleMock { void (component_h, component_low_memory_status_e, void*)); MOCK_METHOD3(base_component_suspended_state_changed_cb, void (component_h, component_suspended_state_e, void*)); + MOCK_METHOD4(base_component_time_zone_changed_cb, + void (component_h, const char*, const char*, void*)); }; #endif // MOCK_BASE_COMPONENT_CALLBACK_MOCK_H_ diff --git a/test/unit_tests/mock/base_frame_component_callback_mock.cc b/test/unit_tests/mock/base_frame_component_callback_mock.cc index 4ee1f7f..f481ec6 100644 --- a/test/unit_tests/mock/base_frame_component_callback_mock.cc +++ b/test/unit_tests/mock/base_frame_component_callback_mock.cc @@ -116,6 +116,13 @@ void __base_frame_component_suspended_state_changed_cb(component_h context, user_data); } +void __base_frame_component_time_zone_changed_cb(component_h context, + const char* time_zone, const char* time_zone_id, void* user_data) { + MOCK_HOOK_P4(BaseFrameComponentCallbackMock, + base_frame_component_time_zone_changed_cb, + context, time_zone, time_zone_id, user_data); +} + } // namespace base_frame_component_lifecycle_callback_s @@ -151,6 +158,8 @@ BaseFrameComponentCallbackMock::GetCallbacks() { __base_frame_component_low_memory_cb; callback.suspended_state_changed = __base_frame_component_suspended_state_changed_cb; + callback.time_zone_changed = + __base_frame_component_time_zone_changed_cb; return callback; } diff --git a/test/unit_tests/mock/base_frame_component_callback_mock.h b/test/unit_tests/mock/base_frame_component_callback_mock.h index df9008d..30aae80 100644 --- a/test/unit_tests/mock/base_frame_component_callback_mock.h +++ b/test/unit_tests/mock/base_frame_component_callback_mock.h @@ -62,6 +62,8 @@ class BaseFrameComponentCallbackMock : public virtual ModuleMock { void (component_h, component_low_memory_status_e, void*)); MOCK_METHOD3(base_frame_component_suspended_state_changed_cb, void (component_h, component_suspended_state_e, void*)); + MOCK_METHOD4(base_frame_component_time_zone_changed_cb, + void (component_h, const char*, const char*, void*)); }; #endif // MOCK_BASE_FRAME_COMPONENT_CALLBACK_MOCK_H_ diff --git a/test/unit_tests/mock/base_service_component_callback_mock.cc b/test/unit_tests/mock/base_service_component_callback_mock.cc index be7b52d..e3b1a8b 100644 --- a/test/unit_tests/mock/base_service_component_callback_mock.cc +++ b/test/unit_tests/mock/base_service_component_callback_mock.cc @@ -99,6 +99,13 @@ void __base_service_component_suspended_state_changed_cb(component_h context, base_service_component_suspended_state_changed_cb, context, state, user_data); } +void __base_service_component_time_zone_changed_cb(component_h context, + const char* time_zone, const char* time_zone_id, void* user_data) { + MOCK_HOOK_P4(BaseServiceComponentCallbackMock, + base_service_component_time_zone_changed_cb, + context, time_zone, time_zone_id, user_data); +} + } // namespace base_service_component_lifecycle_callback_s @@ -128,6 +135,8 @@ BaseServiceComponentCallbackMock::GetCallbacks() { __base_service_component_low_memory_cb; callback.suspended_state_changed = __base_service_component_suspended_state_changed_cb; + callback.time_zone_changed = + __base_service_component_time_zone_changed_cb; return callback; } diff --git a/test/unit_tests/mock/base_service_component_callback_mock.h b/test/unit_tests/mock/base_service_component_callback_mock.h index 9c93844..b593f8e 100644 --- a/test/unit_tests/mock/base_service_component_callback_mock.h +++ b/test/unit_tests/mock/base_service_component_callback_mock.h @@ -58,6 +58,8 @@ class BaseServiceComponentCallbackMock : public virtual ModuleMock { void (component_h, component_low_memory_status_e, void*)); MOCK_METHOD3(base_service_component_suspended_state_changed_cb, void (component_h, component_suspended_state_e, void*)); + MOCK_METHOD4(base_service_component_time_zone_changed_cb, + void (component_h, const char*, const char*, void*)); }; #endif // MOCK_BASE_SERVICE_COMPONENT_CALLBACK_MOCK_H_ diff --git a/test/unit_tests/mock/frame_component_callback_mock.cc b/test/unit_tests/mock/frame_component_callback_mock.cc index 78790eb..c696219 100644 --- a/test/unit_tests/mock/frame_component_callback_mock.cc +++ b/test/unit_tests/mock/frame_component_callback_mock.cc @@ -113,6 +113,12 @@ void __frame_component_suspended_state_changed_cb(component_h context, context, state, user_data); } +void __frame_component_time_zone_changed_cb(component_h context, + const char* time_zone, const char* time_zone_id, void* user_data) { + MOCK_HOOK_P4(FrameComponentCallbackMock, frame_component_time_zone_changed_cb, + context, time_zone, time_zone_id, user_data); +} + } // namespace frame_component_lifecycle_callback_s FrameComponentCallbackMock::GetCallbacks() { @@ -147,6 +153,8 @@ frame_component_lifecycle_callback_s FrameComponentCallbackMock::GetCallbacks() __frame_component_low_memory_cb; callback.suspended_state_changed = __frame_component_suspended_state_changed_cb; + callback.time_zone_changed = + __frame_component_time_zone_changed_cb; return callback; } diff --git a/test/unit_tests/mock/frame_component_callback_mock.h b/test/unit_tests/mock/frame_component_callback_mock.h index 3142b28..f2d8e7f 100644 --- a/test/unit_tests/mock/frame_component_callback_mock.h +++ b/test/unit_tests/mock/frame_component_callback_mock.h @@ -63,6 +63,8 @@ class FrameComponentCallbackMock : public virtual ModuleMock { void (component_h, component_low_memory_status_e, void*)); MOCK_METHOD3(frame_component_suspended_state_changed_cb, void (component_h, component_suspended_state_e, void*)); + MOCK_METHOD4(frame_component_time_zone_changed_cb, + void (component_h, const char*, const char*, void*)); }; #endif // MOCK_FRAME_COMPONENT_CALLBACK_MOCK_H_ diff --git a/test/unit_tests/mock/service_component_callback_mock.cc b/test/unit_tests/mock/service_component_callback_mock.cc index 9cfb8ef..047d60c 100644 --- a/test/unit_tests/mock/service_component_callback_mock.cc +++ b/test/unit_tests/mock/service_component_callback_mock.cc @@ -95,6 +95,12 @@ void __service_component_suspended_state_changed_cb(component_h context, context, state, user_data); } +void __service_component_time_zone_changed_cb(component_h context, + const char* time_zone, const char* time_zone_id, void* user_data) { + MOCK_HOOK_P4(ServiceComponentCallbackMock, service_component_time_zone_changed_cb, + context, time_zone, time_zone_id, user_data); +} + } // namespace service_component_lifecycle_callback_s ServiceComponentCallbackMock::GetCallbacks() { @@ -123,6 +129,8 @@ service_component_lifecycle_callback_s ServiceComponentCallbackMock::GetCallback __service_component_low_memory_cb; callback.suspended_state_changed = __service_component_suspended_state_changed_cb; + callback.time_zone_changed = + __service_component_time_zone_changed_cb; return callback; } diff --git a/test/unit_tests/mock/service_component_callback_mock.h b/test/unit_tests/mock/service_component_callback_mock.h index 1e9fd21..229ac03 100644 --- a/test/unit_tests/mock/service_component_callback_mock.h +++ b/test/unit_tests/mock/service_component_callback_mock.h @@ -56,6 +56,8 @@ class ServiceComponentCallbackMock : public virtual ModuleMock { void (component_h, component_low_memory_status_e, void*)); MOCK_METHOD3(service_component_suspended_state_changed_cb, void (component_h, component_suspended_state_e, void*)); + MOCK_METHOD4(service_component_time_zone_changed_cb, + void (component_h, const char*, const char*, void*)); }; #endif // MOCK_SERVICE_COMPONENT_CALLBACK_MOCK_H_ -- 2.34.1