mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Clean WakeLockManager.updateWakeLock logic.
PiperOrigin-RevId: 284552723
This commit is contained in:
parent
c90c10c981
commit
4b281cec3b
1 changed files with 2 additions and 4 deletions
|
|
@ -88,11 +88,9 @@ import com.google.android.exoplayer2.util.Log;
|
||||||
private void updateWakeLock() {
|
private void updateWakeLock() {
|
||||||
// Needed for the library nullness check. If enabled is true, the wakelock will not be null.
|
// Needed for the library nullness check. If enabled is true, the wakelock will not be null.
|
||||||
if (wakeLock != null) {
|
if (wakeLock != null) {
|
||||||
if (enabled) {
|
if (enabled && stayAwake) {
|
||||||
if (stayAwake && !wakeLock.isHeld()) {
|
if (!wakeLock.isHeld()) {
|
||||||
wakeLock.acquire();
|
wakeLock.acquire();
|
||||||
} else if (!stayAwake && wakeLock.isHeld()) {
|
|
||||||
wakeLock.release();
|
|
||||||
}
|
}
|
||||||
} else if (wakeLock.isHeld()) {
|
} else if (wakeLock.isHeld()) {
|
||||||
wakeLock.release();
|
wakeLock.release();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue