jitcor / FakeScreen

MIT License
33 stars 3 forks source link

disable sleep by stay awake #9

Closed nian0114 closed 4 months ago

nian0114 commented 4 months ago

https://cs.android.com/android/platform/superproject/+/android-14.0.0_r1:frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java;l=3271

/**
 * Returns true if the provided {@link PowerGroup} is being kept awake by a wake lock, user
 * activity or the stay on while powered setting.  We also keep the phone awake when the
 * proximity sensor returns a positive result so that the device does not lock while in a phone
 * call. This function only controls whether the device will go to sleep or dream which is
 * independent of whether it will be allowed to suspend.

**/

根据这行描述,可以通过这种方案保持屏幕唤醒

jitcor commented 4 months ago

666,可以