package v0;

import android.content.Context;
import android.database.ContentObserver;
import android.database.Cursor;
import android.net.Uri;
import android.os.Handler;
import android.provider.Settings;
import androidx.emoji2.text.h0;
import com.google.android.gms.internal.measurement.r4;
import com.google.android.gms.internal.measurement.v4;
import com.google.android.gms.measurement.internal.u1;
import ed.j;
import io.flutter.embedding.android.FlutterView;
import java.util.Iterator;
import xyz.stream.utils.a0;
import yd.g;

/* JADX INFO: loaded from: classes.dex */
public final class a extends ContentObserver {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ int f33637a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final /* synthetic */ Object f33638b;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public /* synthetic */ a(Object obj, int i10) {
        super(null);
        this.f33637a = i10;
        this.f33638b = obj;
    }

    @Override // android.database.ContentObserver
    public final boolean deliverSelfNotifications() {
        switch (this.f33637a) {
            case 0:
            case 5:
                return true;
            default:
                return super.deliverSelfNotifications();
        }
    }

    @Override // android.database.ContentObserver
    public final void onChange(boolean z10) {
        Cursor cursor;
        s4.a aVar;
        j jVar;
        j jVar2;
        switch (this.f33637a) {
            case 0:
                b bVar = (b) this.f33638b;
                if (!bVar.f33640b || (cursor = bVar.f33641c) == null || cursor.isClosed()) {
                    return;
                }
                bVar.f33639a = bVar.f33641c.requery();
                return;
            case 1:
            default:
                super.onChange(z10);
                return;
            case 2:
                super.onChange(z10);
                r4.a aVar2 = (r4.a) this.f33638b;
                Context context = aVar2.f32468b;
                if (context != null) {
                    try {
                        float f10 = Settings.System.getInt(context.getContentResolver(), "screen_brightness");
                        g[] gVarArr = r4.a.Q;
                        float fFloatValue = f10 / ((Number) aVar2.f32475i.x(aVar2, gVarArr[0])).floatValue();
                        g gVar = gVarArr[1];
                        Float fValueOf = Float.valueOf(fFloatValue);
                        a0 a0Var = aVar2.f32476j;
                        a0Var.getClass();
                        nb.g.i(gVar, "property");
                        nb.g.i(fValueOf, "value");
                        a0Var.f36098a = fValueOf;
                        s4.a aVar3 = aVar2.f32471e;
                        if (aVar3 != null && (jVar2 = (j) aVar3.f32660b) != null) {
                            jVar2.a(Float.valueOf(aVar2.b()));
                        }
                        if (aVar2.f32477k != null || (aVar = aVar2.f32473g) == null || (jVar = (j) aVar.f32660b) == null) {
                            return;
                        }
                        jVar.a(Float.valueOf(aVar2.b()));
                        return;
                    } catch (Settings.SettingNotFoundException e10) {
                        e10.printStackTrace();
                        return;
                    }
                }
                return;
            case 3:
                ((r4) this.f33638b).f20386a.set(true);
                return;
            case 4:
                v4 v4Var = (v4) this.f33638b;
                synchronized (v4Var.f20493e) {
                    v4Var.f20494f = null;
                    v4Var.f20491c.run();
                    break;
                }
                synchronized (v4Var) {
                    try {
                        Iterator it = v4Var.f20495g.iterator();
                        if (it.hasNext()) {
                            u1.x(it.next());
                            throw null;
                        }
                    } finally {
                    }
                }
                return;
            case 5:
                super.onChange(z10);
                FlutterView flutterView = (FlutterView) this.f33638b;
                if (flutterView.flutterEngine == null) {
                    return;
                }
                flutterView.o();
                return;
        }
    }

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public /* synthetic */ a(Object obj, Handler handler, int i10) {
        super(handler);
        this.f33637a = i10;
        this.f33638b = obj;
    }

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public a(b bVar) {
        super(new Handler());
        this.f33637a = 0;
        this.f33638b = bVar;
    }

    @Override // android.database.ContentObserver
    public final void onChange(boolean z10, Uri uri) {
        switch (this.f33637a) {
            case 1:
                ((h0) this.f33638b).c();
                break;
            default:
                super.onChange(z10, uri);
                break;
        }
    }
}
