package p138.p176.p177.p242.p258.p263;

import android.content.Context;
import android.database.ContentObserver;
import android.os.Binder;
import android.util.Log;
import javax.annotation.Nullable;
import p037.p041.p042.LayoutInflaterFactory2C1494;

/* JADX INFO: renamed from: ދ.ހ.֏.ހ.ރ.ނ.ၜ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public final class C4714 implements InterfaceC4711 {

    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public static C4714 f14231;

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    @Nullable
    public final Context f14232;

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    @Nullable
    public final ContentObserver f14233;

    public C4714() {
        this.f14232 = null;
        this.f14233 = null;
    }

    public C4714(Context context) {
        this.f14232 = context;
        this.f14233 = new C4716();
        context.getContentResolver().registerContentObserver(C4684.f14173, true, this.f14233);
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static C4714 m7882(Context context) {
        C4714 c4714;
        synchronized (C4714.class) {
            if (f14231 == null) {
                f14231 = LayoutInflaterFactory2C1494.C1505.m2872(context, "com.google.android.providers.gsf.permission.READ_GSERVICES") == 0 ? new C4714(context) : new C4714();
            }
            c4714 = f14231;
        }
        return c4714;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static synchronized void m7883() {
        if (f14231 != null && f14231.f14232 != null && f14231.f14233 != null) {
            f14231.f14232.getContentResolver().unregisterContentObserver(f14231.f14233);
        }
        f14231 = null;
    }

    /* JADX WARN: Removed duplicated region for block: B:18:0x0037  */
    /* JADX WARN: Removed duplicated region for block: B:19:0x003c  */
    @Override // p138.p176.p177.p242.p258.p263.InterfaceC4711
    /* JADX INFO: renamed from: ֏ */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final /* synthetic */ Object mo7875(String str) {
        Context context = this.f14232;
        if (context == null) {
            return null;
        }
        try {
            try {
                try {
                    return C4684.m7804(context.getContentResolver(), str);
                } catch (SecurityException unused) {
                    long jClearCallingIdentity = Binder.clearCallingIdentity();
                    try {
                        String strM7804 = C4684.m7804(this.f14232.getContentResolver(), str);
                        Binder.restoreCallingIdentity(jClearCallingIdentity);
                        return strM7804;
                    } catch (Throwable th) {
                        Binder.restoreCallingIdentity(jClearCallingIdentity);
                        throw th;
                    }
                }
            } catch (IllegalStateException e) {
                e = e;
                String strValueOf = String.valueOf(str);
                Log.e("GservicesLoader", strValueOf.length() == 0 ? "Unable to read GServices for: ".concat(strValueOf) : new String("Unable to read GServices for: "), e);
                return null;
            }
        } catch (SecurityException e2) {
            e = e2;
            String strValueOf2 = String.valueOf(str);
            Log.e("GservicesLoader", strValueOf2.length() == 0 ? "Unable to read GServices for: ".concat(strValueOf2) : new String("Unable to read GServices for: "), e);
            return null;
        }
    }
}
