package o;

import android.graphics.Rect;
import android.view.WindowInsets;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.ul0, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C2649ul0 extends AbstractC3124zl0 {
    public static Field e = null;
    public static boolean f = false;
    public static Constructor g = null;
    public static boolean h = false;
    public WindowInsets c;
    public LH d;

    public C2649ul0() {
        this.c = i();
    }

    private static WindowInsets i() {
        if (!f) {
            try {
                e = WindowInsets.class.getDeclaredField("CONSUMED");
            } catch (ReflectiveOperationException unused) {
            }
            f = true;
        }
        Field field = e;
        if (field != null) {
            try {
                WindowInsets windowInsets = (WindowInsets) field.get(null);
                if (windowInsets != null) {
                    return new WindowInsets(windowInsets);
                }
            } catch (ReflectiveOperationException unused2) {
            }
        }
        if (!h) {
            try {
                g = WindowInsets.class.getConstructor(Rect.class);
            } catch (ReflectiveOperationException unused3) {
            }
            h = true;
        }
        Constructor constructor = g;
        if (constructor != null) {
            try {
                return (WindowInsets) constructor.newInstance(new Rect());
            } catch (ReflectiveOperationException unused4) {
            }
        }
        return null;
    }

    @Override // o.AbstractC3124zl0
    public Kl0 b() {
        a();
        Kl0 kl0G = Kl0.g(null, this.c);
        LH[] lhArr = this.b;
        Hl0 hl0 = kl0G.a;
        hl0.r(lhArr);
        hl0.u(this.d);
        return kl0G;
    }

    @Override // o.AbstractC3124zl0
    public void e(LH lh) {
        this.d = lh;
    }

    @Override // o.AbstractC3124zl0
    public void g(LH lh) {
        WindowInsets windowInsets = this.c;
        if (windowInsets != null) {
            this.c = windowInsets.replaceSystemWindowInsets(lh.a, lh.b, lh.c, lh.d);
        }
    }

    public C2649ul0(Kl0 kl0) {
        super(kl0);
        this.c = kl0.f();
    }
}
