I used Wakelock
in my application for fire CPU on when the device went to sleep but i
don't want to turn on when screen is off, i mean, i want to keep state of screen and
just turn on cpu for my background works.
I used below code but in some of devices, in wakelock
device, the screen was
turn on but as i readed about PowerManager and i realised, i had to used just
PARTIAL_WAKE_LOCK
. Is that true?
before code:
wakeLock=pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK
| PowerManager.ACQUIRE_CAUSES_WAKEUP
| PowerManager.ON_AFTER_RELEASE,"aqs_wake_lock");
after edit:
wakeLock=pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,"aqs_wake_lock");