package o;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class OJ {
    public final M90 a;
    public PJ b;
    public InterfaceC0622Xz c;

    public OJ(M90 m90) {
        this.a = m90;
    }

    public final boolean a(int i) {
        OC oc;
        M90 m90;
        if (i == 7) {
            PJ pj = this.b;
            if (pj == null) {
                pj = null;
            }
            oc = pj.a;
        } else {
            if (i == 2) {
                PJ pj2 = this.b;
                if (pj2 == null) {
                    pj2 = null;
                }
                pj2.getClass();
            } else if (i == 6) {
                PJ pj3 = this.b;
                if (pj3 == null) {
                    pj3 = null;
                }
                oc = pj3.b;
            } else if (i == 5) {
                PJ pj4 = this.b;
                if (pj4 == null) {
                    pj4 = null;
                }
                pj4.getClass();
            } else if (i == 3) {
                PJ pj5 = this.b;
                if (pj5 == null) {
                    pj5 = null;
                }
                pj5.getClass();
            } else if (i == 4) {
                PJ pj6 = this.b;
                if (pj6 == null) {
                    pj6 = null;
                }
                pj6.getClass();
            } else if (i != 1 && i != 0) {
                throw new IllegalStateException("invalid ImeAction");
            }
            oc = null;
        }
        if (oc != null) {
            oc.g(this);
            return true;
        }
        if (i == 6) {
            InterfaceC0622Xz interfaceC0622Xz = this.c;
            ((C0674Zz) (interfaceC0622Xz != null ? interfaceC0622Xz : null)).f(1);
            return true;
        }
        if (i == 5) {
            InterfaceC0622Xz interfaceC0622Xz2 = this.c;
            ((C0674Zz) (interfaceC0622Xz2 != null ? interfaceC0622Xz2 : null)).f(2);
            return true;
        }
        if (i != 7 || (m90 = this.a) == null) {
            return false;
        }
        ((C1234fr) m90).a();
        return true;
    }
}
