diff options
Diffstat (limited to 'src/app_main.c')
-rwxr-xr-x | src/app_main.c | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/src/app_main.c b/src/app_main.c index 8037e32..9862ba8 100755 --- a/src/app_main.c +++ b/src/app_main.c @@ -42,7 +42,7 @@ #define LOG_TAG "CAPI_APPFW_APPLICATION" -#define UI_APP_EVENT_MAX 6 +#define UI_APP_EVENT_MAX 7 typedef enum { APP_STATE_NOT_RUNNING, /* The application has been launched or was running but was terminated */ @@ -491,6 +491,24 @@ static int _ui_app_appcore_suspended_state_changed(void *event_info, void *data) } /* LCOV_EXCL_STOP */ +static int _ui_app_appcore_update_requested(void *event_info, void *data) +{ + Eina_List *l; + app_event_handler_h handler; + struct app_event_info event; + + LOGI("_ui_app_appcore_update_requested"); + + event.type = APP_EVENT_UPDATE_REQUESTED; + event.value = event_info; + + EINA_LIST_FOREACH(handler_list[APP_EVENT_UPDATE_REQUESTED], l, handler) { + handler->cb(&event, handler->data); + } + + return APP_ERROR_NONE; +} + static void _ui_app_appcore_set_event_cb(app_event_type_e event_type) { switch (event_type) { @@ -513,6 +531,9 @@ static void _ui_app_appcore_set_event_cb(app_event_type_e event_type) LOGI("[__SUSPEND__]"); appcore_set_event_callback(APPCORE_EVENT_SUSPENDED_STATE_CHANGE, _ui_app_appcore_suspended_state_changed, NULL); break; + case APP_EVENT_UPDATE_REQUESTED: + appcore_set_event_callback(APPCORE_EVENT_UPDATE_REQUESTED, _ui_app_appcore_update_requested, NULL); + break; default: break; } @@ -540,6 +561,9 @@ static void _ui_app_appcore_unset_event_cb(app_event_type_e event_type) LOGI("[__SUSPEND__]"); appcore_set_event_callback(APPCORE_EVENT_SUSPENDED_STATE_CHANGE, NULL, NULL); break; + case APP_EVENT_UPDATE_REQUESTED: + appcore_set_event_callback(APPCORE_EVENT_UPDATE_REQUESTED, NULL, NULL); + break; default: break; } @@ -557,6 +581,8 @@ static void _ui_app_set_appcore_event_cb(void) _ui_app_appcore_set_event_cb(APP_EVENT_DEVICE_ORIENTATION_CHANGED); if (eina_list_count(handler_list[APP_EVENT_SUSPENDED_STATE_CHANGED]) > 0) _ui_app_appcore_set_event_cb(APP_EVENT_SUSPENDED_STATE_CHANGED); + if (eina_list_count(handler_list[APP_EVENT_UPDATE_REQUESTED]) > 0) + _ui_app_appcore_set_event_cb(APP_EVENT_UPDATE_REQUESTED); } static void _ui_app_unset_appcore_event_cb(void) @@ -571,6 +597,8 @@ static void _ui_app_unset_appcore_event_cb(void) _ui_app_appcore_unset_event_cb(APP_EVENT_DEVICE_ORIENTATION_CHANGED); if (eina_list_count(handler_list[APP_EVENT_SUSPENDED_STATE_CHANGED]) > 0) _ui_app_appcore_unset_event_cb(APP_EVENT_SUSPENDED_STATE_CHANGED); + if (eina_list_count(handler_list[APP_EVENT_UPDATE_REQUESTED]) > 0) + _ui_app_appcore_unset_event_cb(APP_EVENT_UPDATE_REQUESTED); } static int _ui_app_appcore_create(void *data) |