63 lines
1.8 KiB
Java
63 lines
1.8 KiB
Java
|
package com.google.firebase.iid;
|
||
|
|
||
|
import android.content.Context;
|
||
|
import android.os.Bundle;
|
||
|
import com.google.android.gms.common.util.concurrent.NamedThreadFactory;
|
||
|
import com.google.android.gms.tasks.Task;
|
||
|
import java.util.concurrent.ScheduledExecutorService;
|
||
|
|
||
|
/* loaded from: classes.dex */
|
||
|
public final class zzab {
|
||
|
private static zzab zza;
|
||
|
private final Context zzb;
|
||
|
private final ScheduledExecutorService zzc;
|
||
|
private zzac zzd = new zzac(this);
|
||
|
private int zze = 1;
|
||
|
|
||
|
public static zzab zza(Context context) {
|
||
|
zzab zzabVar;
|
||
|
synchronized (zzab.class) {
|
||
|
if (zza == null) {
|
||
|
zza = new zzab(context, com.google.android.gms.internal.firebase_messaging.zza.zza().zza(1, new NamedThreadFactory("MessengerIpcClient"), com.google.android.gms.internal.firebase_messaging.zzf.zzb));
|
||
|
}
|
||
|
zzabVar = zza;
|
||
|
}
|
||
|
return zzabVar;
|
||
|
}
|
||
|
|
||
|
private zzab(Context context, ScheduledExecutorService scheduledExecutorService) {
|
||
|
this.zzc = scheduledExecutorService;
|
||
|
this.zzb = context.getApplicationContext();
|
||
|
}
|
||
|
|
||
|
public final Task<Void> zza(int i, Bundle bundle) {
|
||
|
return zza(new zzak(zza(), 2, bundle));
|
||
|
}
|
||
|
|
||
|
public final Task<Bundle> zzb(int i, Bundle bundle) {
|
||
|
return zza(new zzap(zza(), 1, bundle));
|
||
|
}
|
||
|
|
||
|
private final <T> Task<T> zza(zzan<T> zzanVar) {
|
||
|
Task<T> task;
|
||
|
synchronized (this) {
|
||
|
if (!this.zzd.zza((zzan<?>) zzanVar)) {
|
||
|
zzac zzacVar = new zzac(this);
|
||
|
this.zzd = zzacVar;
|
||
|
zzacVar.zza((zzan<?>) zzanVar);
|
||
|
}
|
||
|
task = zzanVar.zzb.getTask();
|
||
|
}
|
||
|
return task;
|
||
|
}
|
||
|
|
||
|
private final int zza() {
|
||
|
int i;
|
||
|
synchronized (this) {
|
||
|
i = this.zze;
|
||
|
this.zze = i + 1;
|
||
|
}
|
||
|
return i;
|
||
|
}
|
||
|
}
|