104 lines
3.5 KiB
Java
104 lines
3.5 KiB
Java
package c.i.a.f.h.l;
|
|
|
|
import android.content.ContentResolver;
|
|
import android.database.ContentObserver;
|
|
import android.database.sqlite.SQLiteException;
|
|
import android.net.Uri;
|
|
import android.os.StrictMode;
|
|
import android.util.Log;
|
|
import androidx.annotation.GuardedBy;
|
|
import androidx.collection.ArrayMap;
|
|
import c.i.a.f.e.o.f;
|
|
import java.util.ArrayList;
|
|
import java.util.Collections;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Objects;
|
|
/* compiled from: com.google.android.gms:play-services-measurement-impl@@18.0.0 */
|
|
public final class y1 implements b2 {
|
|
@GuardedBy("ConfigurationContentLoader.class")
|
|
public static final Map<Uri, y1> a = new ArrayMap();
|
|
public static final String[] b = {"key", "value"};
|
|
|
|
/* renamed from: c reason: collision with root package name */
|
|
public final ContentResolver f1172c;
|
|
public final Uri d;
|
|
public final ContentObserver e;
|
|
public final Object f = new Object();
|
|
public volatile Map<String, String> g;
|
|
@GuardedBy("this")
|
|
public final List<z1> h = new ArrayList();
|
|
|
|
public y1(ContentResolver contentResolver, Uri uri) {
|
|
a2 a2Var = new a2(this);
|
|
this.e = a2Var;
|
|
Objects.requireNonNull(contentResolver);
|
|
Objects.requireNonNull(uri);
|
|
this.f1172c = contentResolver;
|
|
this.d = uri;
|
|
contentResolver.registerContentObserver(uri, false, a2Var);
|
|
}
|
|
|
|
public static y1 a(ContentResolver contentResolver, Uri uri) {
|
|
y1 y1Var;
|
|
synchronized (y1.class) {
|
|
Map<Uri, y1> map = a;
|
|
y1Var = map.get(uri);
|
|
if (y1Var == null) {
|
|
try {
|
|
y1 y1Var2 = new y1(contentResolver, uri);
|
|
try {
|
|
map.put(uri, y1Var2);
|
|
} catch (SecurityException unused) {
|
|
}
|
|
y1Var = y1Var2;
|
|
} catch (SecurityException unused2) {
|
|
}
|
|
}
|
|
}
|
|
return y1Var;
|
|
}
|
|
|
|
public static synchronized void c() {
|
|
synchronized (y1.class) {
|
|
for (y1 y1Var : a.values()) {
|
|
y1Var.f1172c.unregisterContentObserver(y1Var.e);
|
|
}
|
|
a.clear();
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: finally extract failed */
|
|
public final Map<String, String> b() {
|
|
Map<String, String> map;
|
|
Map<String, String> map2 = this.g;
|
|
if (map2 == null) {
|
|
synchronized (this.f) {
|
|
map2 = this.g;
|
|
if (map2 == null) {
|
|
StrictMode.ThreadPolicy allowThreadDiskReads = StrictMode.allowThreadDiskReads();
|
|
try {
|
|
map = (Map) f.B1(new x1(this));
|
|
StrictMode.setThreadPolicy(allowThreadDiskReads);
|
|
} catch (SQLiteException | IllegalStateException | SecurityException unused) {
|
|
Log.e("ConfigurationContentLoader", "PhenotypeFlag unable to load ContentProvider, using default values");
|
|
StrictMode.setThreadPolicy(allowThreadDiskReads);
|
|
map = null;
|
|
} catch (Throwable th) {
|
|
StrictMode.setThreadPolicy(allowThreadDiskReads);
|
|
throw th;
|
|
}
|
|
this.g = map;
|
|
map2 = map;
|
|
}
|
|
}
|
|
}
|
|
return map2 != null ? map2 : Collections.emptyMap();
|
|
}
|
|
|
|
@Override // c.i.a.f.h.l.b2
|
|
public final /* synthetic */ Object g(String str) {
|
|
return b().get(str);
|
|
}
|
|
}
|