Search code examples
androidlinuxlinux-kernelpower-managementwakelock

late suspend, early resume and wakelocks. please explain


what is the functionality and why is it introduced in Android Kernel? By introducing this is the power management made efficient in any way? These are a few questions that I have come across since I am studying the PM module in Android kernel.


Solution

  • Android is split into 2 layers

    • Application
    • Linux Kernel

    All the low level accesses to Hardware, CPU, Memory is done by the linux kernel. Kernel in turn provides system calls and drivers as a mechanism for applications to talk to hardware.

    Now for any smartphone, battery life is of prime importance, hence the need for power management. Idea is to keep the device consume as less power as possible in active as well as standby cases. This would mean higher battery life.

    Wakelocks are a mechanism by which applications can ask the system to be in a high power state. Different wakelocks keep different parts of the system on, e.g. Screen, CPU, keypads etc. When Android has to go to a low power state, it checks if any wakelocks are taken. If no then, it goes to a deep sleep state. Hence it's bad for apps to hold a wakelock for too long.

    Android controls which device should be on. Specific Device drivers will turn On/Off based on wheter they are required.

    Would suggest you to read this link for great info about this!