The power is controlled by various lock locks in Android, and it is important to note that the lock and unlock must be paired.
It is important to note that the Mainfest permission is required to obtain
The operation to be powered requires that the app has permission to set power management in Androidmanifest.xml.
<uses-permissionandroid:name= "Android.permission.WAKE_LOCK"/><uses-permissionandroid:name= " Android.permission.DEVICE_POWER "/>
In addition, different levels of power management are implemented according to flags ' different values.
about int flags The effects of various types of locks on the CPU, screen, keyboard:
Partial_wake_lock: Keep the CPU running, and the screen and keyboard lights may be off.
Screen_dim_wake_lock: Keep the CPU running, allow the screen to be displayed but may be gray, allow to turn off the keyboard light
Screen_bright_wake_lock: Keeps the CPU running, allowing the screen to be highlighted, allowing the keyboard light to be turned off
Full_wake_lock: Keep the CPU running, keep the screen highlighted, and the keyboard lights remain bright.
Reprint Please specify source: Zhou Mushi's csdn blog Http://blog.csdn.net/zhoumushui
My github: Zhou Mushi's GitHub Https://github.com/zhoumushui
How Android controls screen light and close in activity