Apply adding a new event 99/297499/4
authorChanggyu Choi <changyu.choi@samsung.com>
Mon, 21 Aug 2023 04:31:56 +0000 (13:31 +0900)
committerChanggyu Choi <changyu.choi@samsung.com>
Thu, 31 Aug 2023 04:38:03 +0000 (13:38 +0900)
Adds:
 - APP_EVENT_TIME_ZONE_CHANGED

Requires:
 - https://review.tizen.org/gerrit/c/platform/core/api/app-common/+/297497

Change-Id: I1258f2ff7823b60bee6a1d53b64b55db5d24d2b3
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
src/app_main.cc

index 45b3d41da5203958dd27cd208f745227845101e8..e5f324729d599d258a04e176e751e67393ead670 100644 (file)
@@ -136,7 +136,7 @@ class UiAppContext : public AppCoreEflBase {
   AppState state_ = APP_STATE_NOT_RUNNING;
 };
 
-constexpr int UI_APP_EVENT_MAX = 7;
+constexpr int UI_APP_EVENT_MAX = 8;
 constexpr IAppCore::IEvent::Type __app_event_converter[UI_APP_EVENT_MAX] = {
   [APP_EVENT_LOW_MEMORY] =
       IAppCore::IEvent::Type::LOW_MEMORY,
@@ -152,6 +152,8 @@ constexpr IAppCore::IEvent::Type __app_event_converter[UI_APP_EVENT_MAX] = {
       IAppCore::IEvent::Type::SUSPENDED_STATE_CHANGE,
   [APP_EVENT_UPDATE_REQUESTED] =
       IAppCore::IEvent::Type::UPDATE_REQUESTED,
+  [APP_EVENT_TIME_ZONE_CHANGED] =
+      IAppCore::IEvent::Type::TIME_ZONE_CHANGED,
 };
 
 std::unique_ptr<UiAppContext> __context;
@@ -218,7 +220,7 @@ API int ui_app_add_event_handler(app_event_handler_h* event_handler,
   }
 
   if (event_type < APP_EVENT_LOW_MEMORY ||
-      event_type > APP_EVENT_UPDATE_REQUESTED) {
+      event_type > APP_EVENT_TIME_ZONE_CHANGED) {
     _E("Invalid event type");
     return APP_ERROR_INVALID_PARAMETER;
   }
@@ -261,7 +263,7 @@ API int ui_app_remove_event_handler(app_event_handler_h event_handler) {
   auto* eb = reinterpret_cast<std::shared_ptr<AppEvent>*>(event_handler);
   auto type = (*eb)->GetType();
   if (type < IAppCore::IEvent::Type::LOW_MEMORY ||
-      type > IAppCore::IEvent::Type::UPDATE_REQUESTED) {
+      type > IAppCore::IEvent::Type::TIME_ZONE_CHANGED) {
     // LCOV_EXCL_START
     _E("invalid parameter");
     return APP_ERROR_INVALID_PARAMETER;