- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
81 lines
2.3 KiB
Java
81 lines
2.3 KiB
Java
package com.iab.omid.library.fyber.internal;
|
|
|
|
import android.annotation.SuppressLint;
|
|
import android.app.KeyguardManager;
|
|
import android.content.BroadcastReceiver;
|
|
import android.content.Context;
|
|
import android.content.Intent;
|
|
import android.content.IntentFilter;
|
|
import java.lang.ref.WeakReference;
|
|
import java.util.Iterator;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public class j {
|
|
|
|
@SuppressLint({"StaticFieldLeak"})
|
|
private static j d = new j();
|
|
private WeakReference<Context> a;
|
|
private boolean b = false;
|
|
private boolean c = false;
|
|
|
|
public class a extends BroadcastReceiver {
|
|
public a() {
|
|
}
|
|
|
|
@Override // android.content.BroadcastReceiver
|
|
public void onReceive(Context context, Intent intent) {
|
|
j jVar;
|
|
boolean z;
|
|
boolean z2;
|
|
if (intent.getAction().equals("android.intent.action.SCREEN_OFF")) {
|
|
jVar = j.this;
|
|
z = jVar.c;
|
|
z2 = true;
|
|
} else {
|
|
if (!intent.getAction().equals("android.intent.action.SCREEN_ON")) {
|
|
return;
|
|
}
|
|
jVar = j.this;
|
|
z = jVar.c;
|
|
z2 = false;
|
|
}
|
|
jVar.a(z2, z);
|
|
j.this.b = z2;
|
|
}
|
|
}
|
|
|
|
public static j b() {
|
|
return d;
|
|
}
|
|
|
|
public void a() {
|
|
Context context = this.a.get();
|
|
if (context == null) {
|
|
return;
|
|
}
|
|
boolean isDeviceLocked = ((KeyguardManager) context.getSystemService("keyguard")).isDeviceLocked();
|
|
a(this.b, isDeviceLocked);
|
|
this.c = isDeviceLocked;
|
|
}
|
|
|
|
public void a(Context context) {
|
|
if (context == null) {
|
|
return;
|
|
}
|
|
this.a = new WeakReference<>(context);
|
|
IntentFilter intentFilter = new IntentFilter("android.intent.action.SCREEN_OFF");
|
|
intentFilter.addAction("android.intent.action.SCREEN_ON");
|
|
context.registerReceiver(new a(), intentFilter);
|
|
}
|
|
|
|
public void a(boolean z, boolean z2) {
|
|
if ((z2 || z) == (this.c || this.b)) {
|
|
return;
|
|
}
|
|
Iterator<com.iab.omid.library.fyber.adsession.a> it = c.c().b().iterator();
|
|
while (it.hasNext()) {
|
|
it.next().getAdSessionStatePublisher().b(z2 || z);
|
|
}
|
|
}
|
|
}
|