Is there any way we can acquire a Partial wacklock when the device goes into a deep sleep mode without triggering a screen ON?
Sure. A partial WakeLock
does not turn on the screen, by definition.
Acquiring the wakelock seems to work only if the device is awake
Sure. Your code will only run when the CPU is executing instructions.
A WakeLock
does not wake up the device. A WakeLock
keeps the device awake. A partial WakeLock
does that while not turning on the screen.
I need to keep the screen Off.
While you can avoid turning on the screen yourself, by using a partial WakeLock
, you cannot prevent other apps from turning on the screen, if they feel it is in their users' interests to do so (e.g., incoming phone calls).