Pergunta

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?

Foi útil?

Solução

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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top