mirror of
https://github.com/samsonjs/media.git
synced 2026-03-29 10:05:48 +00:00
Clean WakeLockManager.updateWakeLock logic.
PiperOrigin-RevId: 284552723
This commit is contained in:
parent
a5420a0b65
commit
e4e56fac09
1 changed files with 2 additions and 4 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in a new issue