diff options
author | bohu <bohu@google.com> | 2018-08-01 15:38:47 -0700 |
---|---|---|
committer | bohu <bohu@google.com> | 2018-08-01 15:38:47 -0700 |
commit | 543816812430b72b898371c2e345438d0a08a7a7 (patch) | |
tree | d69cbdf00526161c8960b667d3c4a12648e1696a | |
parent | 8a76923254de3313a40711b6d1733e3db5ce529b (diff) | |
download | android_device_generic_goldfish-543816812430b72b898371c2e345438d0a08a7a7.tar.gz android_device_generic_goldfish-543816812430b72b898371c2e345438d0a08a7a7.tar.bz2 android_device_generic_goldfish-543816812430b72b898371c2e345438d0a08a7a7.zip |
goldfish: allow emulator to suspend
Previously we install an emulator_wake_lock to prevent
it from being suspended, and that is the right
behavior for most cases.
However, sometime we do want the emualtor to suspend
(such as doing sensor verifier tests).
This cl will skip installing the emualtor_wake_lock
if -qemu -append qemu.allowsuspend=1 is given.
The default behavior is unchanged.
BUG: 112074471
Change-Id: I5bcdd4d4394f6c15fd15c78603c0a52c0d46c777
-rwxr-xr-x | init.ranchu-core.sh | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/init.ranchu-core.sh b/init.ranchu-core.sh index 0b2e6fd..e6c9de4 100755 --- a/init.ranchu-core.sh +++ b/init.ranchu-core.sh @@ -11,4 +11,12 @@ case "$bootanim" in esac # take the wake lock -echo "emulator_wake_lock" > /sys/power/wake_lock +allowsuspend=`getprop ro.kernel.qemu.allowsuspend` +case "$allowsuspend" in + "") echo "emulator_wake_lock" > /sys/power/wake_lock + ;; + 1) echo "emulator_wake_lock" > /sys/power/wake_unlock + ;; + *) echo "emulator_wake_lock" > /sys/power/wake_lock + ;; +esac |