How quickly does Android go to sleep after wakelock is released?
I am working on an app which uses the accelerometer in the background, and because of its high power consumption I am investigating how best to allow the device to go to sleep, at least for every other minute or so.
I cannot let the device go to sleep for as long as an hour, or even 10 minutes -- that would be only possible in the case where I would develop some kind of intelligent scheduler based its predictions of user behavior. I do not have enough time for this.
Thus I am asking if when I let my app go to sleep, and actually unregister the sensor update listener, would the device even go to sleep in such a small time interval? (I would think that there would be some timeout to prevent runnning all that stuff that is necessary when device goes out of standby mode.)
I am using the slowest accelerometer mode: SENSOR_DELAY_NORMAL
.
Right now, my service holds the device on wakelock all the time.
This only lasts for about 12 hours of standby -- getting twice as much would be sufficient.