package X6FRs_4.KQgRr5e_0.YghfZG_14;

import X6FRs_4.KQgRr5e_0.YghfZG_14.QxJ9d_1;
import X6FRs_4.KQgRr5e_0.YghfZG_14.XnFJ5_9.JZJr_16;
import android.content.Context;
import android.view.ActionMode;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import java.util.ArrayList;
/* compiled from: SupportActionModeWrapper.java */
/* loaded from: classes.dex */
public class IFxWkV_5 extends ActionMode {
    public final QxJ9d_1 KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public final Context f832KQgRr5e_0;

    public IFxWkV_5(Context context, QxJ9d_1 qxJ9d_1) {
        this.f832KQgRr5e_0 = context;
        this.KQgRr5e_0 = qxJ9d_1;
    }

    @Override // android.view.ActionMode
    public void finish() {
        this.KQgRr5e_0.m469KQgRr5e_0();
    }

    @Override // android.view.ActionMode
    public View getCustomView() {
        return this.KQgRr5e_0.m466KQgRr5e_0();
    }

    @Override // android.view.ActionMode
    public Menu getMenu() {
        return JZJr_16.KQgRr5e_0(this.f832KQgRr5e_0, (X6FRs_4.IMuAHx_6.IMuAHx_6.KQgRr5e_0.KQgRr5e_0) this.KQgRr5e_0.KQgRr5e_0());
    }

    @Override // android.view.ActionMode
    public MenuInflater getMenuInflater() {
        return this.KQgRr5e_0.m465KQgRr5e_0();
    }

    @Override // android.view.ActionMode
    public CharSequence getSubtitle() {
        return this.KQgRr5e_0.m467KQgRr5e_0();
    }

    @Override // android.view.ActionMode
    public Object getTag() {
        return this.KQgRr5e_0.m468KQgRr5e_0();
    }

    @Override // android.view.ActionMode
    public CharSequence getTitle() {
        return this.KQgRr5e_0.QxJ9d_1();
    }

    @Override // android.view.ActionMode
    public boolean getTitleOptionalHint() {
        return this.KQgRr5e_0.m470KQgRr5e_0();
    }

    @Override // android.view.ActionMode
    public void invalidate() {
        this.KQgRr5e_0.m471QxJ9d_1();
    }

    @Override // android.view.ActionMode
    public boolean isTitleOptional() {
        return this.KQgRr5e_0.m472QxJ9d_1();
    }

    @Override // android.view.ActionMode
    public void setCustomView(View view) {
        this.KQgRr5e_0.KQgRr5e_0(view);
    }

    @Override // android.view.ActionMode
    public void setSubtitle(CharSequence charSequence) {
        this.KQgRr5e_0.KQgRr5e_0(charSequence);
    }

    @Override // android.view.ActionMode
    public void setTag(Object obj) {
        this.KQgRr5e_0.KQgRr5e_0(obj);
    }

    @Override // android.view.ActionMode
    public void setTitle(CharSequence charSequence) {
        this.KQgRr5e_0.QxJ9d_1(charSequence);
    }

    @Override // android.view.ActionMode
    public void setTitleOptionalHint(boolean z) {
        this.KQgRr5e_0.KQgRr5e_0(z);
    }

    @Override // android.view.ActionMode
    public void setSubtitle(int i) {
        this.KQgRr5e_0.KQgRr5e_0(i);
    }

    @Override // android.view.ActionMode
    public void setTitle(int i) {
        this.KQgRr5e_0.QxJ9d_1(i);
    }

    /* compiled from: SupportActionModeWrapper.java */
    /* loaded from: classes.dex */
    public static class KQgRr5e_0 implements QxJ9d_1.KQgRr5e_0 {

        /* renamed from: KQgRr5e_0  reason: collision with other field name */
        public final Context f833KQgRr5e_0;

        /* renamed from: KQgRr5e_0  reason: collision with other field name */
        public final ActionMode.Callback f834KQgRr5e_0;

        /* renamed from: KQgRr5e_0  reason: collision with other field name */
        public final ArrayList<IFxWkV_5> f835KQgRr5e_0 = new ArrayList<>();
        public final X6FRs_4.Mqv2r_3.IMuAHx_6<Menu, Menu> KQgRr5e_0 = new X6FRs_4.Mqv2r_3.IMuAHx_6<>();

        public KQgRr5e_0(Context context, ActionMode.Callback callback) {
            this.f833KQgRr5e_0 = context;
            this.f834KQgRr5e_0 = callback;
        }

        @Override // X6FRs_4.KQgRr5e_0.YghfZG_14.QxJ9d_1.KQgRr5e_0
        public boolean KQgRr5e_0(QxJ9d_1 qxJ9d_1, Menu menu) {
            return this.f834KQgRr5e_0.onCreateActionMode(KQgRr5e_0(qxJ9d_1), KQgRr5e_0(menu));
        }

        @Override // X6FRs_4.KQgRr5e_0.YghfZG_14.QxJ9d_1.KQgRr5e_0
        public boolean QxJ9d_1(QxJ9d_1 qxJ9d_1, Menu menu) {
            return this.f834KQgRr5e_0.onPrepareActionMode(KQgRr5e_0(qxJ9d_1), KQgRr5e_0(menu));
        }

        @Override // X6FRs_4.KQgRr5e_0.YghfZG_14.QxJ9d_1.KQgRr5e_0
        public boolean KQgRr5e_0(QxJ9d_1 qxJ9d_1, MenuItem menuItem) {
            return this.f834KQgRr5e_0.onActionItemClicked(KQgRr5e_0(qxJ9d_1), JZJr_16.KQgRr5e_0(this.f833KQgRr5e_0, (X6FRs_4.IMuAHx_6.IMuAHx_6.KQgRr5e_0.QxJ9d_1) menuItem));
        }

        @Override // X6FRs_4.KQgRr5e_0.YghfZG_14.QxJ9d_1.KQgRr5e_0
        public void KQgRr5e_0(QxJ9d_1 qxJ9d_1) {
            this.f834KQgRr5e_0.onDestroyActionMode(KQgRr5e_0(qxJ9d_1));
        }

        public final Menu KQgRr5e_0(Menu menu) {
            Menu menu2 = this.KQgRr5e_0.get(menu);
            if (menu2 == null) {
                Menu KQgRr5e_0 = JZJr_16.KQgRr5e_0(this.f833KQgRr5e_0, (X6FRs_4.IMuAHx_6.IMuAHx_6.KQgRr5e_0.KQgRr5e_0) menu);
                this.KQgRr5e_0.put(menu, KQgRr5e_0);
                return KQgRr5e_0;
            }
            return menu2;
        }

        @Override // X6FRs_4.KQgRr5e_0.YghfZG_14.QxJ9d_1.KQgRr5e_0
        public ActionMode KQgRr5e_0(QxJ9d_1 qxJ9d_1) {
            int size = this.f835KQgRr5e_0.size();
            for (int i = 0; i < size; i++) {
                IFxWkV_5 iFxWkV_5 = this.f835KQgRr5e_0.get(i);
                if (iFxWkV_5 != null && iFxWkV_5.KQgRr5e_0 == qxJ9d_1) {
                    return iFxWkV_5;
                }
            }
            IFxWkV_5 iFxWkV_52 = new IFxWkV_5(this.f833KQgRr5e_0, qxJ9d_1);
            this.f835KQgRr5e_0.add(iFxWkV_52);
            return iFxWkV_52;
        }
    }
}
