- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
50 lines
1.3 KiB
Java
50 lines
1.3 KiB
Java
package com.applovin.impl;
|
|
|
|
import android.content.Context;
|
|
import android.net.wifi.WifiManager;
|
|
|
|
/* loaded from: classes.dex */
|
|
final class cs {
|
|
private final WifiManager a;
|
|
private WifiManager.WifiLock b;
|
|
private boolean c;
|
|
private boolean d;
|
|
|
|
public cs(Context context) {
|
|
this.a = (WifiManager) context.getApplicationContext().getSystemService("wifi");
|
|
}
|
|
|
|
public void a(boolean z) {
|
|
if (z && this.b == null) {
|
|
WifiManager wifiManager = this.a;
|
|
if (wifiManager == null) {
|
|
pc.d("WifiLockManager", "WifiManager is null, therefore not creating the WifiLock.");
|
|
return;
|
|
} else {
|
|
WifiManager.WifiLock createWifiLock = wifiManager.createWifiLock(3, "ExoPlayer:WifiLockManager");
|
|
this.b = createWifiLock;
|
|
createWifiLock.setReferenceCounted(false);
|
|
}
|
|
}
|
|
this.c = z;
|
|
a();
|
|
}
|
|
|
|
public void b(boolean z) {
|
|
this.d = z;
|
|
a();
|
|
}
|
|
|
|
private void a() {
|
|
WifiManager.WifiLock wifiLock = this.b;
|
|
if (wifiLock == null) {
|
|
return;
|
|
}
|
|
if (this.c && this.d) {
|
|
wifiLock.acquire();
|
|
} else {
|
|
wifiLock.release();
|
|
}
|
|
}
|
|
}
|