diff options
author | Karsten Tausche <karsten@fairphone.com> | 2018-06-19 14:29:07 +0200 |
---|---|---|
committer | Karsten Tausche <karsten@fairphone.com> | 2018-12-13 19:36:56 +0100 |
commit | 5a1a107305fd29c4245228988b141f13546a37d0 (patch) | |
tree | f7cd2dd70b3f7436624d6df80d6afbbae9116a87 /automated/lib | |
parent | 8ab173973ba792dee5482362b28fdaccc4d2714a (diff) |
android-test-lib: Use svc command to disable suspend without root access
Change-Id: I912ab5168bbe1b4fc0a3a8112db5cbc94a812b7c
Signed-off-by: Karsten Tausche <karsten@fairphone.com>
Diffstat (limited to 'automated/lib')
-rwxr-xr-x | automated/lib/android-test-lib | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/automated/lib/android-test-lib b/automated/lib/android-test-lib index bad964f..37035d1 100755 --- a/automated/lib/android-test-lib +++ b/automated/lib/android-test-lib @@ -206,10 +206,12 @@ adb_shell_which() { } disable_suspend() { - echo "Now disable the suspend feature..." - adb shell input keyevent 82 ##unlock the home screen - adb shell "echo lock_me > /sys/power/wake_lock" - echo "The suspend feature is disabled." + local value="${1:-true}" + + info_msg "Setting the power stayon feature to ${value}." + # unlock the home screen + adb shell input keyevent KEYCODE_MENU + adb shell svc power stayon "${value}" } parse_common_args() { |