- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
50 lines
1.3 KiB
Java
50 lines
1.3 KiB
Java
package com.applovin.impl;
|
|
|
|
import android.content.Context;
|
|
import android.os.PowerManager;
|
|
|
|
/* loaded from: classes.dex */
|
|
final class gr {
|
|
private final PowerManager a;
|
|
private PowerManager.WakeLock b;
|
|
private boolean c;
|
|
private boolean d;
|
|
|
|
public gr(Context context) {
|
|
this.a = (PowerManager) context.getApplicationContext().getSystemService("power");
|
|
}
|
|
|
|
public void a(boolean z) {
|
|
if (z && this.b == null) {
|
|
PowerManager powerManager = this.a;
|
|
if (powerManager == null) {
|
|
pc.d("WakeLockManager", "PowerManager is null, therefore not creating the WakeLock.");
|
|
return;
|
|
} else {
|
|
PowerManager.WakeLock newWakeLock = powerManager.newWakeLock(1, "ExoPlayer:WakeLockManager");
|
|
this.b = newWakeLock;
|
|
newWakeLock.setReferenceCounted(false);
|
|
}
|
|
}
|
|
this.c = z;
|
|
a();
|
|
}
|
|
|
|
public void b(boolean z) {
|
|
this.d = z;
|
|
a();
|
|
}
|
|
|
|
private void a() {
|
|
PowerManager.WakeLock wakeLock = this.b;
|
|
if (wakeLock == null) {
|
|
return;
|
|
}
|
|
if (this.c && this.d) {
|
|
wakeLock.acquire();
|
|
} else {
|
|
wakeLock.release();
|
|
}
|
|
}
|
|
}
|