Commit 4b281cec by samrobinson Committed by Oliver Woodman

Clean `WakeLockManager.updateWakeLock` logic.

PiperOrigin-RevId: 284552723
parent c90c10c9
......@@ -88,11 +88,9 @@ import com.google.android.exoplayer2.util.Log;
private void updateWakeLock() {
// Needed for the library nullness check. If enabled is true, the wakelock will not be null.
if (wakeLock != null) {
if (enabled) {
if (stayAwake && !wakeLock.isHeld()) {
if (enabled && stayAwake) {
if (!wakeLock.isHeld()) {
wakeLock.acquire();
} else if (!stayAwake && wakeLock.isHeld()) {
wakeLock.release();
}
} else if (wakeLock.isHeld()) {
wakeLock.release();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment