- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
83 lines
2.7 KiB
Java
83 lines
2.7 KiB
Java
package com.google.android.gms.internal.measurement;
|
|
|
|
import android.content.Context;
|
|
import android.database.ContentObserver;
|
|
import android.util.Log;
|
|
import androidx.annotation.GuardedBy;
|
|
import androidx.core.content.PermissionChecker;
|
|
|
|
/* loaded from: classes3.dex */
|
|
final class zzgp implements zzgo {
|
|
|
|
@GuardedBy("GservicesLoader.class")
|
|
private static zzgp zza;
|
|
private final Context zzb;
|
|
private final ContentObserver zzc;
|
|
|
|
public static zzgp zza(Context context) {
|
|
zzgp zzgpVar;
|
|
synchronized (zzgp.class) {
|
|
try {
|
|
if (zza == null) {
|
|
zza = PermissionChecker.checkSelfPermission(context, "com.google.android.providers.gsf.permission.READ_GSERVICES") == 0 ? new zzgp(context) : new zzgp();
|
|
}
|
|
zzgpVar = zza;
|
|
} catch (Throwable th) {
|
|
throw th;
|
|
}
|
|
}
|
|
return zzgpVar;
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
@Override // com.google.android.gms.internal.measurement.zzgo
|
|
/* renamed from: zzc, reason: merged with bridge method [inline-methods] */
|
|
public final String zza(final String str) {
|
|
Context context = this.zzb;
|
|
if (context != null && !zzgf.zza(context)) {
|
|
try {
|
|
return (String) zzgn.zza(new zzgq() { // from class: com.google.android.gms.internal.measurement.zzgs
|
|
@Override // com.google.android.gms.internal.measurement.zzgq
|
|
public final Object zza() {
|
|
return zzgp.this.zzb(str);
|
|
}
|
|
});
|
|
} catch (IllegalStateException | NullPointerException | SecurityException e) {
|
|
Log.e("GservicesLoader", "Unable to read GServices for: " + str, e);
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public final /* synthetic */ String zzb(String str) {
|
|
return zzfw.zza(this.zzb.getContentResolver(), str, null);
|
|
}
|
|
|
|
private zzgp() {
|
|
this.zzb = null;
|
|
this.zzc = null;
|
|
}
|
|
|
|
private zzgp(Context context) {
|
|
this.zzb = context;
|
|
zzgr zzgrVar = new zzgr(this, null);
|
|
this.zzc = zzgrVar;
|
|
context.getContentResolver().registerContentObserver(zzfv.zza, true, zzgrVar);
|
|
}
|
|
|
|
public static synchronized void zza() {
|
|
Context context;
|
|
synchronized (zzgp.class) {
|
|
try {
|
|
zzgp zzgpVar = zza;
|
|
if (zzgpVar != null && (context = zzgpVar.zzb) != null && zzgpVar.zzc != null) {
|
|
context.getContentResolver().unregisterContentObserver(zza.zzc);
|
|
}
|
|
zza = null;
|
|
} catch (Throwable th) {
|
|
throw th;
|
|
}
|
|
}
|
|
}
|
|
}
|