README
1 This folder contains utils to properly perform timed suspend and wakeup.
2
3 AlarmService - a service that client can bind to and perform:
4 1) holding wakelock (singleton to this service)
5 2) setting alarm for a specified period and releasing the wakelock; service
6 call will block until alarm has been triggered and the wakelock is held
7 3) releasing the wakelock
8
9 SleepHelper - a self instrumentation meant as a convenient way to trigger
10 the service functions from command line. Corresponding to service function
11 above, supported operations are:
12 1) holding wakelock
13 am instrument -w -e command prepare \
14 com.android.testing.sleephelper/.SetAlarm
15
16 2) setting alarm and wait til triggered
17 am instrument -w -e command set_wait \
18 -e param <time in ms> com.android.testing.sleephelper/.SetAlarm
19 Note: for the function to work properly, "-w" parameter is required
20
21 3) releasing wakelock
22 am instrument -w -e command done \
23 com.android.testing.sleephelper/.SetAlarm
24