82 lines
2.9 KiB
Java
82 lines
2.9 KiB
Java
|
package com.google.firebase.messaging;
|
||
|
|
||
|
import android.app.ActivityManager;
|
||
|
import android.app.KeyguardManager;
|
||
|
import android.app.NotificationManager;
|
||
|
import android.content.Context;
|
||
|
import android.graphics.Bitmap;
|
||
|
import android.os.Process;
|
||
|
import android.os.SystemClock;
|
||
|
import com.google.android.gms.common.util.PlatformVersion;
|
||
|
import com.google.android.gms.tasks.Tasks;
|
||
|
import java.util.Iterator;
|
||
|
import java.util.List;
|
||
|
import java.util.concurrent.ExecutionException;
|
||
|
import java.util.concurrent.Executor;
|
||
|
import java.util.concurrent.TimeUnit;
|
||
|
import java.util.concurrent.TimeoutException;
|
||
|
import o.rvM;
|
||
|
|
||
|
/* loaded from: classes2.dex */
|
||
|
final class zzc {
|
||
|
private final Executor zza;
|
||
|
private final Context zzb;
|
||
|
private final zzt zzc;
|
||
|
|
||
|
public zzc(Context context, zzt zztVar, Executor executor) {
|
||
|
this.zza = executor;
|
||
|
this.zzb = context;
|
||
|
this.zzc = zztVar;
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
public final boolean zza() {
|
||
|
if (this.zzc.zzb("gcm.n.noui")) {
|
||
|
return true;
|
||
|
}
|
||
|
if (!((KeyguardManager) this.zzb.getSystemService("keyguard")).inKeyguardRestrictedInputMode()) {
|
||
|
if (!PlatformVersion.isAtLeastLollipop()) {
|
||
|
SystemClock.sleep(10L);
|
||
|
}
|
||
|
int myPid = Process.myPid();
|
||
|
List<ActivityManager.RunningAppProcessInfo> runningAppProcesses = ((ActivityManager) this.zzb.getSystemService("activity")).getRunningAppProcesses();
|
||
|
if (runningAppProcesses != null) {
|
||
|
Iterator<ActivityManager.RunningAppProcessInfo> it = runningAppProcesses.iterator();
|
||
|
while (true) {
|
||
|
if (!it.hasNext()) {
|
||
|
break;
|
||
|
}
|
||
|
ActivityManager.RunningAppProcessInfo next = it.next();
|
||
|
if (next.pid == myPid) {
|
||
|
if (next.importance == 100) {
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
zzq zza = zzq.zza(this.zzc.zza("gcm.n.image"));
|
||
|
if (zza != null) {
|
||
|
zza.zza(this.zza);
|
||
|
}
|
||
|
zza zza2 = zzb.zza(this.zzb, this.zzc);
|
||
|
rvM.LWm lWm = zza2.zza;
|
||
|
if (zza != null) {
|
||
|
try {
|
||
|
Bitmap bitmap = (Bitmap) Tasks.await(zza.zza(), 5L, TimeUnit.SECONDS);
|
||
|
lWm.mS_(bitmap);
|
||
|
lWm.d(new rvM.IeS().mz_(bitmap).my_(null));
|
||
|
} catch (InterruptedException unused) {
|
||
|
zza.close();
|
||
|
Thread.currentThread().interrupt();
|
||
|
} catch (ExecutionException e) {
|
||
|
e.getCause();
|
||
|
} catch (TimeoutException unused2) {
|
||
|
zza.close();
|
||
|
}
|
||
|
}
|
||
|
((NotificationManager) this.zzb.getSystemService("notification")).notify(zza2.zzb, 0, zza2.zza.mO_());
|
||
|
return true;
|
||
|
}
|
||
|
}
|