문제

After I'm releasing my WakeLock, I want the screen to stay on for the duration of the user's display timeout system setting, which is what I believe the ON_AFTER_RELEASE-flag does. It works fine on my device (GNex, 4.3), but a lot of my users (mainly on 4.3) are reporting that the screen switches off immediately after releasing the WakeLock.

//To acquire the wl:
wl = pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK | PowerManager.ON_AFTER_RELEASE, TAG);

@Override
public void onPause() {
    super.onPause();
    if (wl != null) {
        if (wl.isHeld()) {
            wl.release();
        }
    }

Am I doing something wrong?

도움이 되었습니까?

해결책

The issue that was causing this behavior was related to something else entirely and had nothing to do with the WakeLock itself.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top