package c.i.a.f.h.l; import android.content.Context; import android.database.ContentObserver; import android.util.Log; import androidx.annotation.GuardedBy; import androidx.core.content.PermissionChecker; import c.i.a.f.e.o.f; /* compiled from: com.google.android.gms:play-services-measurement-impl@@18.0.0 */ public final class c2 implements b2 { @GuardedBy("GservicesLoader.class") public static c2 a; public final Context b; /* renamed from: c reason: collision with root package name */ public final ContentObserver f1128c; public c2() { this.b = null; this.f1128c = null; } public c2(Context context) { this.b = context; f2 f2Var = new f2(); this.f1128c = f2Var; context.getContentResolver().registerContentObserver(u1.a, true, f2Var); } public static c2 a(Context context) { c2 c2Var; synchronized (c2.class) { if (a == null) { a = PermissionChecker.checkSelfPermission(context, "com.google.android.providers.gsf.permission.READ_GSERVICES") == 0 ? new c2(context) : new c2(); } c2Var = a; } return c2Var; } @Override // c.i.a.f.h.l.b2 public final Object g(String str) { if (this.b == null) { return null; } try { return (String) f.B1(new g2(this, str)); } catch (IllegalStateException | SecurityException e) { String valueOf = String.valueOf(str); Log.e("GservicesLoader", valueOf.length() != 0 ? "Unable to read GServices for: ".concat(valueOf) : new String("Unable to read GServices for: "), e); return null; } } }