diff options
author | saerome.kim <saerome.kim@samsung.com> | 2019-10-15 20:02:12 +0900 |
---|---|---|
committer | saerome.kim <saerome.kim@samsung.com> | 2019-10-15 21:26:21 +0900 |
commit | caf6ff35c2d09686732b1e43bbf25eda9ed300b9 (patch) | |
tree | 1402c5530ccf65ced82740b0f5a5cf606a8f714c | |
parent | f386b8c7fa41c01f67204c2eca78e9480a0b4563 (diff) | |
download | user-awareness-caf6ff35c2d09686732b1e43bbf25eda9ed300b9.tar.gz user-awareness-caf6ff35c2d09686732b1e43bbf25eda9ed300b9.tar.bz2 user-awareness-caf6ff35c2d09686732b1e43bbf25eda9ed300b9.zip |
Clean up codes for suspend/resume testsubmit/tizen/20191017.002636accepted/tizen/unified/20191017.035459
- Problem: suspend/resume seem not to work correctly.
- Cause: sequence for calling power API is not working.
- Solution: fix the sequence for callign power API and test scenario.
Change-Id: I80977b9d51137cfe29684a514bbfbe3b37de21fd
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
-rw-r--r-- | CMakeLists.txt | 10 | ||||
-rw-r--r-- | packaging/capi-network-ua.spec | 6 | ||||
-rw-r--r-- | test/uat-detections.c | 17 |
3 files changed, 18 insertions, 15 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 2786a9b..7fbb441 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,14 +13,18 @@ SET(PKG_MODULES gio-2.0 ua-api ) -IF (SUSPEND_RESUME_TEST) +IF (${SUSPEND_RESUME_TEST}) pkg_check_modules (PKGS REQUIRED ${PKG_MODULES} deviced power-defs ) -ELSE (SUSPEND_RESUME_TEST) +ELSE (${SUSPEND_RESUME_TEST}) pkg_check_modules (PKGS REQUIRED ${PKG_MODULES}) -ENDIF (SUSPEND_RESUME_TEST) +ENDIF (${SUSPEND_RESUME_TEST}) + +IF(${SUSPEND_RESUME_TEST}) + ADD_DEFINITIONS(-DSUSPEND_RESUME_TEST) +ENDIF(${SUPPORT_BLE_ADV}) INCLUDE_DIRECTORIES(${PKGS_INCLUDE_DIRS}) LINK_DIRECTORIES(${PKGS_LIBRARY_DIRS}) diff --git a/packaging/capi-network-ua.spec b/packaging/capi-network-ua.spec index 15b45fd..03aaf53 100644 --- a/packaging/capi-network-ua.spec +++ b/packaging/capi-network-ua.spec @@ -1,6 +1,6 @@ Name: capi-network-ua Summary: User Awareness Framework CAPI -Version: 0.11.9 +Version: 0.11.10 Release: 1 License: Apache-2.0 Source0: %{name}-%{version}.tar.gz @@ -10,7 +10,7 @@ BuildRequires: pkgconfig(dlog) BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(ua-api) -%if 0%{?suspend_resume_test:1} +%if 0%{?ptest:1} BuildRequires: pkgconfig(deviced) BuildRequires: pkgconfig(power-defs) %endif @@ -59,7 +59,7 @@ cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \ -DBIN_INSTALL_DIR=%{_bindir} \ -DINCLUDE_INSTALL_DIR=%{_includedir} \ -DLIB_PATH=%{_lib} \ - -DSUSPEND_RESUME_TEST=%{?suspend_resume_test:1}%{!?suspend_resume_test:0} \ + -DSUSPEND_RESUME_TEST=%{?ptest:1}%{!?ptest:0} \ -DFULLVER=%{version} \ -DMAJORVER=${MAJORVER} \ -DBUILD_GCOV=%{?gcov:1}%{!?gcov:0} diff --git a/test/uat-detections.c b/test/uat-detections.c index 95cc1fa..203ba2a 100644 --- a/test/uat-detections.c +++ b/test/uat-detections.c @@ -579,12 +579,6 @@ static int run_ua_enable_low_power_mode( msg("ua_enable_low_power_mode"); ret = ua_enable_low_power_mode(); -#ifdef SUSPEND_RESUME_TEST - if (POWER_ERROR_NONE != device_power_set_state(POWER_STATE_STANDBY, 1)) { - msgr("Fail to request power off"); - return RET_SUCCESS; - } -#endif msg(" - ua_enable_low_power_mode() ret: [0x%X] [%s]", ret, uat_get_error_str(ret)); @@ -611,7 +605,7 @@ static int run_device_power_request_poweroff( MManager *mm, struct menu_data *menu) { int ret = UA_ERROR_NONE; - int off_reason = POWER_OFF_REASON_POWER_KEY | POWER_OFF_TO_SUSPEND; + int off_reason = POWER_OFF_REASON_ART_APP_TO_SUSPEND | POWER_OFF_TO_SUSPEND; msg("run_device_power_request_poweroff"); @@ -620,14 +614,15 @@ static int run_device_power_request_poweroff( return false; } - ret = device_power_set_wakeup_reason(POWER_WAKEUP_REASON_REMOTE_CONTROLLER); + ret = device_power_set_wakeup_reason(POWER_WAKEUP_REASON_AMBIENT_READY); if(POWER_ERROR_NONE != ret) { msgr("Fail to set wakeup reason"); return RET_SUCCESS; } - if(POWER_ERROR_NONE != device_power_set_state(POWER_STATE_STANDBY, 1)) { + ret = device_power_set_state(POWER_STATE_STANDBY, 1); + if(POWER_ERROR_NONE != ret) { msgr("Failed to request TV to STANDBY!"); return RET_SUCCESS; } @@ -774,5 +769,9 @@ struct menu_data menu_ua_detections[] = { NULL, run_ua_enable_low_power_mode, NULL }, { "13", "ua_disable_low_power_mode", NULL, run_ua_disable_low_power_mode, NULL }, +#ifdef SUSPEND_RESUME_TEST + { "14", "request_power_off", + NULL, run_device_power_request_poweroff, NULL }, +#endif { NULL, NULL, }, }; |