diff options
author | saerome.kim <saerome.kim@samsung.com> | 2019-10-17 18:26:52 +0900 |
---|---|---|
committer | saerome.kim <saerome.kim@samsung.com> | 2019-10-17 19:18:35 +0900 |
commit | 1a1d16753a8e4c8cfbb2336c99375ca500c3a71d (patch) | |
tree | e1a8f5b7cdd4f348a85f54a630143d9eda775e0c /src | |
parent | 3ed49c0bd89543f69144e464db8d51cfbd6b3226 (diff) | |
download | user-awareness-1a1d16753a8e4c8cfbb2336c99375ca500c3a71d.tar.gz user-awareness-1a1d16753a8e4c8cfbb2336c99375ca500c3a71d.tar.bz2 user-awareness-1a1d16753a8e4c8cfbb2336c99375ca500c3a71d.zip |
Add new API to set low power modetizen_5.5.m2_releasesubmit/tizen_5.5_mobile_hotfix/20201026.185102submit/tizen_5.5/20191031.000002submit/tizen/20191018.005538accepted/tizen/unified/20191018.052938accepted/tizen/5.5/unified/mobile/hotfix/20201027.065752accepted/tizen/5.5/unified/20191031.031318tizen_5.5_mobile_hotfixaccepted/tizen_5.5_unified_mobile_hotfix
- Problem: it is needed that new API that can set low power mode
- Cause: without adding new API, build break occurs.
- Solution: add new API to set low power mode.
Change-Id: I2e9269003238973f29424a017c0b9f56c18b4b6d
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/user-awareness-monitors.c | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/src/user-awareness-monitors.c b/src/user-awareness-monitors.c index f707cdb..debbc0b 100644 --- a/src/user-awareness-monitors.c +++ b/src/user-awareness-monitors.c @@ -21,6 +21,7 @@ #include <user-awareness.h> #include <user-awareness-log.h> #include <user-awareness-private.h> +#include <user-awareness-internal.h> #include <user-awareness-util.h> #define UA_MONITORING_TIME 60 /* Default: 60 seconds for scanning for device */ @@ -128,6 +129,9 @@ static unsigned int __ua_sensor_type_to_bitmask(ua_sensor_e sensor_type) case UA_SENSOR_AUDIO: bitmask = UAM_SENSOR_BITMASK_AUDIO; break; + case UA_SENSOR_ALL: + bitmask = UAM_SENSOR_ALL; + break; default: UA_WARN("Unsupported sensor [%d]", sensor_type); bitmask = 0x00; @@ -1761,31 +1765,51 @@ int ua_monitor_set_brightness_threshold(ua_monitor_h handle, return UA_ERROR_NONE; } -int ua_enable_low_power_mode(unsigned int sensors) +int ua_enable_low_power_mode(void) { FUNC_ENTRY; int ret; - ret = _ua_get_error_code(_uam_enable_low_power_mode(sensors)); + ret = _ua_get_error_code(_uam_set_low_power_mode(UA_SENSOR_ALL, true)); if (UA_ERROR_NONE != ret) { - UA_ERR("_uam_enable_low_power_mode failed"); + /* LCOV_EXCL_START */ + UA_ERR("_uam_set_low_power_mode failed"); return ret; + /* LCOV_EXCL_STOP */ } FUNC_EXIT; return UA_ERROR_NONE; } +int ua_disable_low_power_mode(void) +{ + FUNC_ENTRY; + int ret; + + ret = _ua_get_error_code(_uam_set_low_power_mode(UA_SENSOR_ALL, false)); + if (UA_ERROR_NONE != ret) { + /* LCOV_EXCL_START */ + UA_ERR("_uam_set_low_power_mode failed"); + return ret; + /* LCOV_EXCL_STOP */ + } + + FUNC_EXIT; + return UA_ERROR_NONE; +} -int ua_disable_low_power_mode(unsigned int sensors) +int ua_set_low_power_mode(unsigned int bitmask, bool on_off) { FUNC_ENTRY; int ret; - ret = _ua_get_error_code(_uam_disable_low_power_mode(sensors)); + ret = _ua_get_error_code(_uam_set_low_power_mode(bitmask, on_off)); if (UA_ERROR_NONE != ret) { - UA_ERR("_uam_disable_low_power_mode failed"); + /* LCOV_EXCL_START */ + UA_ERR("_uam_set_low_power_mode failed"); return ret; + /* LCOV_EXCL_STOP */ } FUNC_EXIT; |