package o;

import android.os.Looper;
import android.view.View;
import java.util.Map;
import java.util.Objects;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.fM, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public abstract class AbstractC1186fM {
    public static final Object k = new Object();
    public final Object a = new Object();
    public final U30 b = new U30();
    public int c = 0;
    public boolean d;
    public volatile Object e;
    public volatile Object f;
    public int g;
    public boolean h;
    public boolean i;
    public final RunnableC2017o3 j;

    public AbstractC1186fM() {
        Object obj = k;
        this.f = obj;
        this.j = new RunnableC2017o3(12, this);
        this.e = obj;
        this.g = -1;
    }

    public static void a(String str) {
        W8.b0().f.getClass();
        if (Looper.getMainLooper().getThread() != Thread.currentThread()) {
            throw new IllegalStateException(AbstractC2462sn.j("Cannot invoke ", str, " on a background thread"));
        }
    }

    public final void b(C1090eM c1090eM) {
        if (c1090eM.b) {
            int i = c1090eM.c;
            int i2 = this.g;
            if (i >= i2) {
                return;
            }
            c1090eM.c = i2;
            InterfaceC1481iT interfaceC1481iT = c1090eM.a;
            Object obj = this.e;
            C0247Jn c0247Jn = (C0247Jn) interfaceC1481iT;
            c0247Jn.getClass();
            InterfaceC0898cL interfaceC0898cL = (InterfaceC0898cL) obj;
            androidx.fragment.app.g gVar = (androidx.fragment.app.g) c0247Jn.m;
            if (interfaceC0898cL == null || !gVar.mShowsDialog) {
                return;
            }
            View viewRequireView = gVar.requireView();
            if (viewRequireView.getParent() != null) {
                throw new IllegalStateException("DialogFragment can not be attached to a container view");
            }
            if (gVar.mDialog != null) {
                if (androidx.fragment.app.s.F(3)) {
                    Objects.toString(gVar.mDialog);
                }
                gVar.mDialog.setContentView(viewRequireView);
            }
        }
    }

    public final void c(C1090eM c1090eM) {
        if (this.h) {
            this.i = true;
            return;
        }
        this.h = true;
        do {
            this.i = false;
            if (c1090eM != null) {
                b(c1090eM);
                c1090eM = null;
            } else {
                U30 u30 = this.b;
                u30.getClass();
                S30 s30 = new S30(u30);
                u30.n.put(s30, Boolean.FALSE);
                while (s30.hasNext()) {
                    b((C1090eM) ((Map.Entry) s30.next()).getValue());
                    if (this.i) {
                        break;
                    }
                }
            }
        } while (this.i);
        this.h = false;
    }

    public abstract void d(Object obj);
}
