package com.google.android.gms.common.config;

import android.os.Binder;
import android.os.StrictMode;
import android.util.Log;
import com.google.android.gms.common.annotation.KeepForSdk;
import com.google.errorprone.annotations.ResultIgnorabilityUnspecified;
import defpackage.gm4;
import defpackage.rq6;
import defpackage.sma;
import defpackage.vo6;

/* JADX INFO: loaded from: classes2.dex */
@KeepForSdk
public abstract class GservicesValue<T> {
    private static final Object zzc = new Object();

    @vo6
    protected final String zza;

    @vo6
    protected final Object zzb;

    @rq6
    private Object zzd = null;

    public GservicesValue(@vo6 String str, @vo6 Object obj) {
        this.zza = str;
        this.zzb = obj;
    }

    @ResultIgnorabilityUnspecified
    @KeepForSdk
    public static boolean isInitialized() {
        synchronized (zzc) {
        }
        return false;
    }

    @vo6
    @KeepForSdk
    public static GservicesValue<Float> value(@vo6 String str, @vo6 Float f) {
        return new zzd(str, f);
    }

    @ResultIgnorabilityUnspecified
    @vo6
    @KeepForSdk
    public final T get() {
        T t;
        T t2 = (T) this.zzd;
        if (t2 != null) {
            return t2;
        }
        StrictMode.ThreadPolicy threadPolicyAllowThreadDiskReads = StrictMode.allowThreadDiskReads();
        Object obj = zzc;
        synchronized (obj) {
        }
        synchronized (obj) {
            try {
            } finally {
                StrictMode.setThreadPolicy(threadPolicyAllowThreadDiskReads);
            }
        }
        try {
            t = (T) zza(this.zza);
        } catch (SecurityException unused) {
            long jClearCallingIdentity = Binder.clearCallingIdentity();
            try {
                t = (T) zza(this.zza);
            } finally {
                Binder.restoreCallingIdentity(jClearCallingIdentity);
            }
        }
        return t;
    }

    @Deprecated
    @vo6
    @KeepForSdk
    @gm4
    public final T getBinderSafe() {
        return get();
    }

    @sma
    @KeepForSdk
    public void override(@vo6 T t) {
        Log.w("GservicesValue", "GservicesValue.override(): test should probably call initForTests() first");
        this.zzd = t;
        Object obj = zzc;
        synchronized (obj) {
            synchronized (obj) {
            }
        }
    }

    @sma
    @KeepForSdk
    public void resetOverride() {
        this.zzd = null;
    }

    @vo6
    public abstract Object zza(@vo6 String str);

    @vo6
    @KeepForSdk
    public static GservicesValue<Integer> value(@vo6 String str, @vo6 Integer num) {
        return new zzc(str, num);
    }

    @vo6
    @KeepForSdk
    public static GservicesValue<Long> value(@vo6 String str, @vo6 Long l) {
        return new zzb(str, l);
    }

    @vo6
    @KeepForSdk
    public static GservicesValue<String> value(@vo6 String str, @vo6 String str2) {
        return new zze(str, str2);
    }

    @vo6
    @KeepForSdk
    public static GservicesValue<Boolean> value(@vo6 String str, boolean z) {
        return new zza(str, Boolean.valueOf(z));
    }
}
