package t4; import android.content.Context; import android.content.SharedPreferences; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.os.Build; import android.os.Bundle; import l4.c; /* loaded from: classes2.dex */ public class a { /* renamed from: a, reason: collision with root package name */ private final Context f14349a; /* renamed from: b, reason: collision with root package name */ private final SharedPreferences f14350b; /* renamed from: c, reason: collision with root package name */ private final c f14351c; /* renamed from: d, reason: collision with root package name */ private boolean f14352d; public a(Context context, String str, c cVar) { Context a10 = a(context); this.f14349a = a10; this.f14350b = a10.getSharedPreferences("com.google.firebase.common.prefs:" + str, 0); this.f14351c = cVar; this.f14352d = c(); } private static Context a(Context context) { return Build.VERSION.SDK_INT < 24 ? context : androidx.core.content.a.createDeviceProtectedStorageContext(context); } private boolean c() { return this.f14350b.contains("firebase_data_collection_default_enabled") ? this.f14350b.getBoolean("firebase_data_collection_default_enabled", true) : d(); } private boolean d() { ApplicationInfo applicationInfo; Bundle bundle; try { PackageManager packageManager = this.f14349a.getPackageManager(); if (packageManager == null || (applicationInfo = packageManager.getApplicationInfo(this.f14349a.getPackageName(), 128)) == null || (bundle = applicationInfo.metaData) == null || !bundle.containsKey("firebase_data_collection_default_enabled")) { return true; } return applicationInfo.metaData.getBoolean("firebase_data_collection_default_enabled"); } catch (PackageManager.NameNotFoundException unused) { return true; } } public synchronized boolean b() { return this.f14352d; } }