androidwakelockandroid-wake-lock

Does the CPU stay awake when the device is charging?


The documentation mentions that 6.0+ Android devices will not enter doze mode while charging, but what about regular sleep mode? I could not find anything that indicates that the CPU will turn off when it is plugged to a charger.

From some testing I've done it seems that the device is fine without the CPU WakeLock when running background processes, but I want to make sure; because it could be a case of another app holding a WakeLock.


Solution

  • Android sleeps when no wake-lock is active no matter what thread or process you have to execute even when charging and some modified os like miui and other Chinese roms have aggressive cpu sleep, so it's better use wake lock or Other alternative check for more info here [https://developer.android.com/training/scheduling/wakelock].

    Doze is more aggressive about preserving your battery life by putting your phone in a low-power. In this state apps background processes execute in batches, this might have issues executing in background.

    And from version 8.0 Google restrict background tasks even more