Difference between Wakelock and FLAG_KEEP_SCREEN_ON?

前端 未结 3 1769
执笔经年
执笔经年 2020-12-28 12:37

Keeping the screen awake can be accomplished by using a wakelock by

mWakeLock = mPowerManager.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK, 
                     


        
3条回答
  •  别那么骄傲
    2020-12-28 12:54

    Wakelock is vague, since it has many different options. The flag FLAG_KEEP_SCREEN_ON only does that.

    | Flag Value              | CPU | Screen | Keyboard |
    -----------------------------------------------------
    | PARTIAL_WAKE_LOCK       | On* | Off    | Off      |
    | SCREEN_DIM_WAKE_LOCK    | On  | Dim    | Off      |
    | SCREEN_BRIGHT_WAKE_LOCK | On  | Bright | Off      |
    | FULL_WAKE_LOCK          | On  | Bright | Bright   |
    

    Please see wakelock or PowerManager for Android specifics, and other answers for the exact implementation.

提交回复
热议问题