summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHwankyu Jhun <h.jhun@samsung.com>2016-12-01 11:46:10 +0900
committerHwanKyu Jhun <h.jhun@samsung.com>2016-12-06 00:13:33 -0800
commitee7b666609837673e936da3a1c7bd176bc19894e (patch)
tree4c7cf93df35b2e07f6d54cc12edb4032217287d1
parenta59df954e06129e830cad072b6af8d856d105413 (diff)
downloadapplication-ee7b666609837673e936da3a1c7bd176bc19894e.tar.gz
application-ee7b666609837673e936da3a1c7bd176bc19894e.tar.bz2
application-ee7b666609837673e936da3a1c7bd176bc19894e.zip
Change-Id: Ib264210abbc6e0852e596a2e4a4ae9ea23ee4423 Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
-rwxr-xr-xsrc/app_main.c30
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)