Skip to content

Commit

Permalink
enable rtcwake for Android devices
Browse files Browse the repository at this point in the history
Signed-off-by: Arnold Lu <arnoldlu@qq.com>
  • Loading branch information
arnoldlu committed Jan 11, 2017
1 parent c4042a0 commit a862d8c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tools/analyze_suspend/analyze_suspend.py
Expand Up @@ -2793,7 +2793,13 @@ def executeAndroidSuspend():
if(sysvals.usetraceevents):
os.system(sysvals.adb+\
" shell 'echo SUSPEND START > "+tp+"trace_marker'")
print('SUSPEND START (press a key on the device to resume)')
if(sysvals.rtcwake):
print('SUSPEND START')
print('Android will autoresume in %d seconds' % sysvals.rtcwaketime)
os.system(sysvals.adb+" shell 'echo +%d > /sys/class/rtc/rtc0/wakealarm'"%(sysvals.rtcwaketime))
else:
print('SUSPEND START (press a key on the device to resume)')

os.system(sysvals.adb+" shell 'echo "+sysvals.suspendmode+\
" > "+sysvals.powerfile+"'")
# execution will pause here, then adb will exit
Expand Down

0 comments on commit a862d8c

Please sign in to comment.