- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
76 lines
2.2 KiB
Java
76 lines
2.2 KiB
Java
package com.google.android.gms.cloudmessaging;
|
|
|
|
import android.content.Context;
|
|
import android.os.Bundle;
|
|
import android.util.Log;
|
|
import androidx.annotation.Nullable;
|
|
import androidx.annotation.VisibleForTesting;
|
|
import com.google.android.gms.common.util.concurrent.NamedThreadFactory;
|
|
import com.google.android.gms.tasks.Task;
|
|
import java.util.concurrent.Executors;
|
|
import java.util.concurrent.ScheduledExecutorService;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public final class zzv {
|
|
|
|
@Nullable
|
|
private static zzv zza;
|
|
private final Context zzb;
|
|
private final ScheduledExecutorService zzc;
|
|
private zzp zzd = new zzp(this, null);
|
|
private int zze = 1;
|
|
|
|
@VisibleForTesting
|
|
public zzv(Context context, ScheduledExecutorService scheduledExecutorService) {
|
|
this.zzc = scheduledExecutorService;
|
|
this.zzb = context.getApplicationContext();
|
|
}
|
|
|
|
public static synchronized zzv zzb(Context context) {
|
|
zzv zzvVar;
|
|
synchronized (zzv.class) {
|
|
try {
|
|
if (zza == null) {
|
|
com.google.android.gms.internal.cloudmessaging.zze.zza();
|
|
zza = new zzv(context, Executors.unconfigurableScheduledExecutorService(Executors.newScheduledThreadPool(1, new NamedThreadFactory("MessengerIpcClient"))));
|
|
}
|
|
zzvVar = zza;
|
|
} catch (Throwable th) {
|
|
throw th;
|
|
}
|
|
}
|
|
return zzvVar;
|
|
}
|
|
|
|
private final synchronized int zzf() {
|
|
int i;
|
|
i = this.zze;
|
|
this.zze = i + 1;
|
|
return i;
|
|
}
|
|
|
|
private final synchronized Task zzg(zzs zzsVar) {
|
|
try {
|
|
if (Log.isLoggable("MessengerIpcClient", 3)) {
|
|
zzsVar.toString();
|
|
}
|
|
if (!this.zzd.zzg(zzsVar)) {
|
|
zzp zzpVar = new zzp(this, null);
|
|
this.zzd = zzpVar;
|
|
zzpVar.zzg(zzsVar);
|
|
}
|
|
} catch (Throwable th) {
|
|
throw th;
|
|
}
|
|
return zzsVar.zzb.getTask();
|
|
}
|
|
|
|
public final Task zzc(int i, Bundle bundle) {
|
|
return zzg(new zzr(zzf(), i, bundle));
|
|
}
|
|
|
|
public final Task zzd(int i, Bundle bundle) {
|
|
return zzg(new zzu(zzf(), i, bundle));
|
|
}
|
|
}
|