WakeLock not working

前端 未结 2 1661
执念已碎
执念已碎 2021-01-20 17:28

I have a wake lock set up so that I can still hear the sound when the screen times out or I press the screen lock button. From what I can understand through reading online i

2条回答
  •  执念已碎
    2021-01-20 18:06

    Try:

    wl = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK |
                    PowerManager.ACQUIRE_CAUSES_WAKEUP |
                    PowerManager.ON_AFTER_RELEASE, "sleeplock");
    

    I've found the "PowerManager.ACQUIRE_CAUSES_WAKEUP" alleviates a few of the same issues I was having.

    Also make sure:

    
    

    is declared in your manifest.

提交回复
热议问题