diff options
author | Junghoon Park <jh9216.park@samsung.com> | 2017-02-01 22:24:44 +0900 |
---|---|---|
committer | Junghoon Park <jh9216.park@samsung.com> | 2017-02-20 11:11:14 +0900 |
commit | 76c66f570105debbdbd689fc051e86cc932f3baa (patch) | |
tree | 220a64ce0a10460b44cf3ef2f91ec1a0a7f2fa23 /app_common | |
parent | 0ce488ce95b9727691e9fb31c0cdc0f454f5b680 (diff) | |
download | application-76c66f570105debbdbd689fc051e86cc932f3baa.tar.gz application-76c66f570105debbdbd689fc051e86cc932f3baa.tar.bz2 application-76c66f570105debbdbd689fc051e86cc932f3baa.zip |
Refactor APIs using appcore_ui_base
- require :
https://review.tizen.org/gerrit/#/c/82655/
Change-Id: Iedc7603d7e0e3514856797d42751901886f1ff07
Signed-off-by: Junghoon Park <jh9216.park@samsung.com>
Diffstat (limited to 'app_common')
-rwxr-xr-x | app_common/app_event.c | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/app_common/app_event.c b/app_common/app_event.c index 12f0387..fe32e89 100755 --- a/app_common/app_event.c +++ b/app_common/app_event.c @@ -18,9 +18,22 @@ #include <vconf-internal-keys.h> #include <app_common.h> +#include <appcore_base.h> #include <app_internal.h> -/* LCOV_EXCL_START */ +struct app_event_info { + app_event_type_e type; + void *value; +}; + +enum appcore_rm { + APPCORE_RM_UNKNOWN, + APPCORE_RM_PORTRAIT_NORMAL, + APPCORE_RM_PORTRAIT_REVERSE, + APPCORE_RM_LANDSCAPE_NORMAL, + APPCORE_RM_LANDSCAPE_REVERSE, +}; + app_device_orientation_e app_convert_appcore_rm(enum appcore_rm rm) { app_device_orientation_e dev_orientation; @@ -45,9 +58,8 @@ app_device_orientation_e app_convert_appcore_rm(enum appcore_rm rm) return dev_orientation; } -/* LCOV_EXCL_STOP */ -static int _app_convert_low_memory(void *val) +static int __app_convert_low_memory(void *val) { switch (*(int *)val) { case VCONFKEY_SYSMAN_LOW_MEMORY_NORMAL: @@ -61,7 +73,7 @@ static int _app_convert_low_memory(void *val) } } -static int _app_convert_low_battery(void *val) +static int __app_convert_low_battery(void *val) { switch (*(int *)val) { case VCONFKEY_SYSMAN_BAT_POWER_OFF: @@ -83,7 +95,7 @@ int app_event_get_low_memory_status(app_event_info_h event_info, app_event_low_m if (event_info->type != APP_EVENT_LOW_MEMORY) return app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, "event type mismatching"); - ret = _app_convert_low_memory(event_info->value); + ret = __app_convert_low_memory(event_info->value); if (ret < 0) return app_error(APP_ERROR_INVALID_CONTEXT, __FUNCTION__, "invalid event info"); @@ -102,7 +114,7 @@ int app_event_get_low_battery_status(app_event_info_h event_info, app_event_low_ if (event_info->type != APP_EVENT_LOW_BATTERY) return app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, "event type mismatching"); - ret = _app_convert_low_battery(event_info->value); + ret = __app_convert_low_battery(event_info->value); if (ret < 0) return app_error(APP_ERROR_INVALID_CONTEXT, __FUNCTION__, "invalid event info"); @@ -145,7 +157,7 @@ int app_event_get_device_orientation(app_event_info_h event_info, app_device_ori if (event_info->type != APP_EVENT_DEVICE_ORIENTATION_CHANGED) return app_error(APP_ERROR_INVALID_CONTEXT, __FUNCTION__, "event type mismatching"); - *orientation = app_convert_appcore_rm(*(enum appcore_rm *)(event_info->value)); + *orientation = app_convert_appcore_rm(*(enum appcore_base_rm *)(event_info->value)); return APP_ERROR_NONE; } @@ -158,9 +170,9 @@ int app_event_get_suspended_state(app_event_info_h event_info, app_suspended_sta if (event_info->type != APP_EVENT_SUSPENDED_STATE_CHANGED) return app_error(APP_ERROR_INVALID_CONTEXT, __FUNCTION__, "event type mismatching"); - if (*(enum appcore_suspended_state *)(event_info->value) == APPCORE_SUSPENDED_STATE_WILL_ENTER_SUSPEND) + if (*(enum appcore_base_suspended_state *)(event_info->value) == APPCORE_BASE_SUSPENDED_STATE_WILL_ENTER_SUSPEND) *state = APP_SUSPENDED_STATE_WILL_ENTER; - else if (*(enum appcore_suspended_state *)(event_info->value) == APPCORE_SUSPENDED_STATE_DID_EXIT_FROM_SUSPEND) + else if (*(enum appcore_base_suspended_state *)(event_info->value) == APPCORE_BASE_SUSPENDED_STATE_DID_EXIT_FROM_SUSPEND) *state = APP_SUSPENDED_STATE_DID_EXIT; return APP_ERROR_NONE; |