package k;

import android.view.View;
import android.widget.FrameLayout;
import androidx.appcompat.view.menu.ActionMenuItemView;
import androidx.appcompat.widget.ActivityChooserView;
import l.y1;

/* JADX INFO: loaded from: classes.dex */
public final class b extends y1 {

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public final /* synthetic */ int f28808j = 0;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public final /* synthetic */ View f28809k;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public b(ActivityChooserView activityChooserView, FrameLayout frameLayout) {
        super(frameLayout);
        this.f28809k = activityChooserView;
    }

    @Override // l.y1
    public final f0 b() {
        l.j jVar;
        int i10 = this.f28808j;
        View view = this.f28809k;
        switch (i10) {
            case 0:
                c cVar = ((ActionMenuItemView) view).f569k;
                if (cVar == null || (jVar = ((l.k) cVar).f29747a.X) == null) {
                    return null;
                }
                return jVar.a();
            default:
                return ((ActivityChooserView) view).getListPopupWindow();
        }
    }

    @Override // l.y1
    public final boolean c() {
        int i10 = this.f28808j;
        View view = this.f28809k;
        switch (i10) {
            case 0:
                ActionMenuItemView actionMenuItemView = (ActionMenuItemView) view;
                o oVar = actionMenuItemView.f567i;
                if (oVar == null || !oVar.a(actionMenuItemView.f564f)) {
                    return false;
                }
                f0 f0VarB = b();
                return f0VarB != null && f0VarB.a();
            default:
                ActivityChooserView activityChooserView = (ActivityChooserView) view;
                if (activityChooserView.b() || !activityChooserView.f643k) {
                    return true;
                }
                activityChooserView.f633a.getClass();
                throw new IllegalStateException("No data model. Did you call #setDataModel?");
        }
    }

    @Override // l.y1
    public final boolean d() {
        switch (this.f28808j) {
            case 1:
                ((ActivityChooserView) this.f28809k).a();
                break;
            default:
                f0 f0VarB = b();
                if (f0VarB != null && f0VarB.a()) {
                    f0VarB.dismiss();
                }
                break;
        }
        return true;
    }

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public b(ActionMenuItemView actionMenuItemView) {
        super(actionMenuItemView);
        this.f28809k = actionMenuItemView;
    }
}
