diff options
author | Hwankyu Jhun <h.jhun@samsung.com> | 2016-12-01 11:46:10 +0900 |
---|---|---|
committer | HwanKyu Jhun <h.jhun@samsung.com> | 2016-12-06 00:13:33 -0800 |
commit | ee7b666609837673e936da3a1c7bd176bc19894e (patch) | |
tree | 4c7cf93df35b2e07f6d54cc12edb4032217287d1 | |
parent | a59df954e06129e830cad072b6af8d856d105413 (diff) | |
download | application-ee7b666609837673e936da3a1c7bd176bc19894e.tar.gz application-ee7b666609837673e936da3a1c7bd176bc19894e.tar.bz2 application-ee7b666609837673e936da3a1c7bd176bc19894e.zip |
Implement the update requested eventsubmit/tizen_3.0/20161212.123626submit/tizen_3.0/20161212.043612accepted/tizen/3.0/wearable/20161213.025622accepted/tizen/3.0/tv/20161213.025435accepted/tizen/3.0/mobile/20161213.025414accepted/tizen/3.0/ivi/20161213.025731accepted/tizen/3.0/common/20161213.164029
Change-Id: Ib264210abbc6e0852e596a2e4a4ae9ea23ee4423
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
-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) |