package androidx.appcompat.widget;

import android.annotation.SuppressLint;
import android.app.PendingIntent;
import android.app.SearchableInfo;
import android.content.ActivityNotFoundException;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.database.Cursor;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.Editable;
import android.text.SpannableStringBuilder;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.text.style.ImageSpan;
import android.util.AttributeSet;
import android.util.Log;
import android.util.TypedValue;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.TouchDelegate;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputConnection;
import android.view.inputmethod.InputMethodManager;
import android.widget.AdapterView;
import android.widget.AutoCompleteTextView;
import android.widget.ImageView;
import android.widget.TextView;
import com.ifpdos.udi.service.core.pc.R;
import d.b.g.d1;
import d.b.g.k0;
import d.b.g.t0;
import d.b.g.z0;
import d.h.j.y;
import io.netty.handler.codec.compression.Lz4Constants;
import io.netty.util.internal.shaded.org.jctools.util.Pow2;
import java.lang.reflect.Method;
import java.util.Objects;
import java.util.WeakHashMap;
import java.util.concurrent.atomic.AtomicInteger;

/* JADX INFO: loaded from: classes.dex */
public class SearchView extends k0 implements d.b.f.b {
    public static final n A;
    public final AdapterView.OnItemSelectedListener A0;
    public final SearchAutoComplete B;
    public TextWatcher B0;
    public final View C;
    public final View D;
    public final View E;
    public final ImageView F;
    public final ImageView G;
    public final ImageView H;
    public final ImageView I;
    public final View J;
    public p K;
    public Rect L;
    public Rect M;
    public int[] N;
    public int[] O;
    public final ImageView P;
    public final Drawable Q;
    public final int R;
    public final int S;
    public final Intent T;
    public final Intent U;
    public final CharSequence V;
    public l W;

    /* JADX INFO: renamed from: a0, reason: collision with root package name */
    public k f514a0;

    /* JADX INFO: renamed from: b0, reason: collision with root package name */
    public View.OnFocusChangeListener f515b0;

    /* JADX INFO: renamed from: c0, reason: collision with root package name */
    public m f516c0;

    /* JADX INFO: renamed from: d0, reason: collision with root package name */
    public View.OnClickListener f517d0;
    public boolean e0;
    public boolean f0;
    public d.i.a.a g0;
    public boolean h0;
    public CharSequence i0;
    public boolean j0;
    public boolean k0;
    public int l0;
    public boolean m0;
    public CharSequence n0;
    public CharSequence o0;
    public boolean p0;
    public int q0;
    public SearchableInfo r0;
    public Bundle s0;
    public final Runnable t0;
    public Runnable u0;
    public final WeakHashMap<String, Drawable.ConstantState> v0;
    public final View.OnClickListener w0;
    public View.OnKeyListener x0;
    public final TextView.OnEditorActionListener y0;
    public final AdapterView.OnItemClickListener z0;

    public static class SearchAutoComplete extends d.b.g.d {

        /* JADX INFO: renamed from: o, reason: collision with root package name */
        public int f518o;

        /* JADX INFO: renamed from: p, reason: collision with root package name */
        public SearchView f519p;

        /* JADX INFO: renamed from: q, reason: collision with root package name */
        public boolean f520q;

        /* JADX INFO: renamed from: r, reason: collision with root package name */
        public final Runnable f521r;

        public class a implements Runnable {
            public a() {
            }

            @Override // java.lang.Runnable
            public void run() {
                SearchAutoComplete searchAutoComplete = SearchAutoComplete.this;
                if (searchAutoComplete.f520q) {
                    ((InputMethodManager) searchAutoComplete.getContext().getSystemService("input_method")).showSoftInput(searchAutoComplete, 0);
                    searchAutoComplete.f520q = false;
                }
            }
        }

        public SearchAutoComplete(Context context, AttributeSet attributeSet) {
            super(context, attributeSet, R.attr.autoCompleteTextViewStyle);
            this.f521r = new a();
            this.f518o = getThreshold();
        }

        private int getSearchViewTextMinWidthDp() {
            Configuration configuration = getResources().getConfiguration();
            int i2 = configuration.screenWidthDp;
            int i3 = configuration.screenHeightDp;
            if (i2 >= 960 && i3 >= 720 && configuration.orientation == 2) {
                return 256;
            }
            if (i2 < 600) {
                return (i2 < 640 || i3 < 480) ? 160 : 192;
            }
            return 192;
        }

        public void a() {
            if (Build.VERSION.SDK_INT >= 29) {
                setInputMethodMode(1);
                if (enoughToFilter()) {
                    showDropDown();
                    return;
                }
                return;
            }
            n nVar = SearchView.A;
            Objects.requireNonNull(nVar);
            n.a();
            Method method = nVar.f531c;
            if (method != null) {
                try {
                    method.invoke(this, Boolean.TRUE);
                } catch (Exception unused) {
                }
            }
        }

        @Override // android.widget.AutoCompleteTextView
        public boolean enoughToFilter() {
            return this.f518o <= 0 || super.enoughToFilter();
        }

        @Override // d.b.g.d, android.widget.TextView, android.view.View
        public InputConnection onCreateInputConnection(EditorInfo editorInfo) {
            InputConnection inputConnectionOnCreateInputConnection = super.onCreateInputConnection(editorInfo);
            if (this.f520q) {
                removeCallbacks(this.f521r);
                post(this.f521r);
            }
            return inputConnectionOnCreateInputConnection;
        }

        @Override // android.view.View
        public void onFinishInflate() {
            super.onFinishInflate();
            setMinWidth((int) TypedValue.applyDimension(1, getSearchViewTextMinWidthDp(), getResources().getDisplayMetrics()));
        }

        @Override // android.widget.AutoCompleteTextView, android.widget.TextView, android.view.View
        public void onFocusChanged(boolean z2, int i2, Rect rect) {
            super.onFocusChanged(z2, i2, rect);
            SearchView searchView = this.f519p;
            searchView.G(searchView.f0);
            searchView.post(searchView.t0);
            if (searchView.B.hasFocus()) {
                searchView.s();
            }
        }

        @Override // android.widget.AutoCompleteTextView, android.widget.TextView, android.view.View
        public boolean onKeyPreIme(int i2, KeyEvent keyEvent) {
            if (i2 == 4) {
                if (keyEvent.getAction() == 0 && keyEvent.getRepeatCount() == 0) {
                    KeyEvent.DispatcherState keyDispatcherState = getKeyDispatcherState();
                    if (keyDispatcherState != null) {
                        keyDispatcherState.startTracking(keyEvent, this);
                    }
                    return true;
                }
                if (keyEvent.getAction() == 1) {
                    KeyEvent.DispatcherState keyDispatcherState2 = getKeyDispatcherState();
                    if (keyDispatcherState2 != null) {
                        keyDispatcherState2.handleUpEvent(keyEvent);
                    }
                    if (keyEvent.isTracking() && !keyEvent.isCanceled()) {
                        this.f519p.clearFocus();
                        setImeVisibility(false);
                        return true;
                    }
                }
            }
            return super.onKeyPreIme(i2, keyEvent);
        }

        @Override // android.widget.AutoCompleteTextView, android.widget.TextView, android.view.View
        public void onWindowFocusChanged(boolean z2) {
            super.onWindowFocusChanged(z2);
            if (z2 && this.f519p.hasFocus() && getVisibility() == 0) {
                this.f520q = true;
                Context context = getContext();
                n nVar = SearchView.A;
                if (context.getResources().getConfiguration().orientation == 2) {
                    a();
                }
            }
        }

        @Override // android.widget.AutoCompleteTextView
        public void performCompletion() {
        }

        @Override // android.widget.AutoCompleteTextView
        public void replaceText(CharSequence charSequence) {
        }

        public void setImeVisibility(boolean z2) {
            InputMethodManager inputMethodManager = (InputMethodManager) getContext().getSystemService("input_method");
            if (!z2) {
                this.f520q = false;
                removeCallbacks(this.f521r);
                inputMethodManager.hideSoftInputFromWindow(getWindowToken(), 0);
            } else {
                if (!inputMethodManager.isActive(this)) {
                    this.f520q = true;
                    return;
                }
                this.f520q = false;
                removeCallbacks(this.f521r);
                inputMethodManager.showSoftInput(this, 0);
            }
        }

        public void setSearchView(SearchView searchView) {
            this.f519p = searchView;
        }

        @Override // android.widget.AutoCompleteTextView
        public void setThreshold(int i2) {
            super.setThreshold(i2);
            this.f518o = i2;
        }
    }

    public class a implements TextWatcher {
        public a() {
        }

        @Override // android.text.TextWatcher
        public void afterTextChanged(Editable editable) {
        }

        @Override // android.text.TextWatcher
        public void beforeTextChanged(CharSequence charSequence, int i2, int i3, int i4) {
        }

        @Override // android.text.TextWatcher
        public void onTextChanged(CharSequence charSequence, int i2, int i3, int i4) {
            SearchView searchView = SearchView.this;
            Editable text = searchView.B.getText();
            searchView.o0 = text;
            boolean z2 = !TextUtils.isEmpty(text);
            searchView.F(z2);
            searchView.H(!z2);
            searchView.B();
            searchView.E();
            if (searchView.W != null && !TextUtils.equals(charSequence, searchView.n0)) {
                searchView.W.a(charSequence.toString());
            }
            searchView.n0 = charSequence.toString();
        }
    }

    public class b implements Runnable {
        public b() {
        }

        @Override // java.lang.Runnable
        public void run() {
            SearchView.this.C();
        }
    }

    public class c implements Runnable {
        public c() {
        }

        @Override // java.lang.Runnable
        public void run() {
            d.i.a.a aVar = SearchView.this.g0;
            if (aVar instanceof t0) {
                aVar.b(null);
            }
        }
    }

    public class d implements View.OnFocusChangeListener {
        public d() {
        }

        @Override // android.view.View.OnFocusChangeListener
        public void onFocusChange(View view, boolean z2) {
            SearchView searchView = SearchView.this;
            View.OnFocusChangeListener onFocusChangeListener = searchView.f515b0;
            if (onFocusChangeListener != null) {
                onFocusChangeListener.onFocusChange(searchView, z2);
            }
        }
    }

    public class e implements View.OnLayoutChangeListener {
        public e() {
        }

        @Override // android.view.View.OnLayoutChangeListener
        public void onLayoutChange(View view, int i2, int i3, int i4, int i5, int i6, int i7, int i8, int i9) {
            SearchView searchView = SearchView.this;
            if (searchView.J.getWidth() > 1) {
                Resources resources = searchView.getContext().getResources();
                int paddingLeft = searchView.D.getPaddingLeft();
                Rect rect = new Rect();
                boolean zB = d1.b(searchView);
                int dimensionPixelSize = searchView.e0 ? resources.getDimensionPixelSize(R.dimen.abc_dropdownitem_text_padding_left) + resources.getDimensionPixelSize(R.dimen.abc_dropdownitem_icon_width) : 0;
                searchView.B.getDropDownBackground().getPadding(rect);
                searchView.B.setDropDownHorizontalOffset(zB ? -rect.left : paddingLeft - (rect.left + dimensionPixelSize));
                searchView.B.setDropDownWidth((((searchView.J.getWidth() + rect.left) + rect.right) + dimensionPixelSize) - paddingLeft);
            }
        }
    }

    public class f implements View.OnClickListener {
        public f() {
        }

        @Override // android.view.View.OnClickListener
        public void onClick(View view) {
            SearchView searchView = SearchView.this;
            if (view == searchView.F) {
                searchView.y();
                return;
            }
            if (view == searchView.H) {
                searchView.u();
                return;
            }
            if (view == searchView.G) {
                searchView.z();
                return;
            }
            if (view != searchView.I) {
                if (view == searchView.B) {
                    searchView.s();
                    return;
                }
                return;
            }
            SearchableInfo searchableInfo = searchView.r0;
            if (searchableInfo == null) {
                return;
            }
            try {
                if (!searchableInfo.getVoiceSearchLaunchWebSearch()) {
                    if (searchableInfo.getVoiceSearchLaunchRecognizer()) {
                        searchView.getContext().startActivity(searchView.r(searchView.U, searchableInfo));
                    }
                } else {
                    Intent intent = new Intent(searchView.T);
                    ComponentName searchActivity = searchableInfo.getSearchActivity();
                    intent.putExtra("calling_package", searchActivity == null ? null : searchActivity.flattenToShortString());
                    searchView.getContext().startActivity(intent);
                }
            } catch (ActivityNotFoundException unused) {
                Log.w("SearchView", "Could not find voice search activity");
            }
        }
    }

    public class g implements View.OnKeyListener {
        public g() {
        }

        @Override // android.view.View.OnKeyListener
        public boolean onKey(View view, int i2, KeyEvent keyEvent) {
            SearchView searchView = SearchView.this;
            if (searchView.r0 == null) {
                return false;
            }
            if (searchView.B.isPopupShowing() && SearchView.this.B.getListSelection() != -1) {
                return SearchView.this.A(i2, keyEvent);
            }
            if ((TextUtils.getTrimmedLength(SearchView.this.B.getText()) == 0) || !keyEvent.hasNoModifiers() || keyEvent.getAction() != 1 || i2 != 66) {
                return false;
            }
            view.cancelLongPress();
            SearchView searchView2 = SearchView.this;
            searchView2.t(0, null, searchView2.B.getText().toString());
            return true;
        }
    }

    public class h implements TextView.OnEditorActionListener {
        public h() {
        }

        @Override // android.widget.TextView.OnEditorActionListener
        public boolean onEditorAction(TextView textView, int i2, KeyEvent keyEvent) {
            SearchView.this.z();
            return true;
        }
    }

    public class i implements AdapterView.OnItemClickListener {
        public i() {
        }

        @Override // android.widget.AdapterView.OnItemClickListener
        public void onItemClick(AdapterView<?> adapterView, View view, int i2, long j2) {
            SearchView.this.v(i2);
        }
    }

    public class j implements AdapterView.OnItemSelectedListener {
        public j() {
        }

        @Override // android.widget.AdapterView.OnItemSelectedListener
        public void onItemSelected(AdapterView<?> adapterView, View view, int i2, long j2) {
            SearchView.this.w(i2);
        }

        @Override // android.widget.AdapterView.OnItemSelectedListener
        public void onNothingSelected(AdapterView<?> adapterView) {
        }
    }

    public interface k {
        boolean a();
    }

    public interface l {
        boolean a(String str);

        boolean b(String str);
    }

    public interface m {
        boolean a(int i2);

        boolean b(int i2);
    }

    public static class n {
        public Method a;

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        public Method f530b;

        /* JADX INFO: renamed from: c, reason: collision with root package name */
        public Method f531c;

        @SuppressLint({"DiscouragedPrivateApi", "SoonBlockedPrivateApi"})
        public n() {
            this.a = null;
            this.f530b = null;
            this.f531c = null;
            a();
            try {
                Method declaredMethod = AutoCompleteTextView.class.getDeclaredMethod("doBeforeTextChanged", new Class[0]);
                this.a = declaredMethod;
                declaredMethod.setAccessible(true);
            } catch (NoSuchMethodException unused) {
            }
            try {
                Method declaredMethod2 = AutoCompleteTextView.class.getDeclaredMethod("doAfterTextChanged", new Class[0]);
                this.f530b = declaredMethod2;
                declaredMethod2.setAccessible(true);
            } catch (NoSuchMethodException unused2) {
            }
            try {
                Method method = AutoCompleteTextView.class.getMethod("ensureImeVisible", Boolean.TYPE);
                this.f531c = method;
                method.setAccessible(true);
            } catch (NoSuchMethodException unused3) {
            }
        }

        public static void a() {
            if (Build.VERSION.SDK_INT >= 29) {
                throw new UnsupportedClassVersionError("This function can only be used for API Level < 29.");
            }
        }
    }

    public static class o extends d.j.a.a {
        public static final Parcelable.Creator<o> CREATOR = new a();

        /* JADX INFO: renamed from: n, reason: collision with root package name */
        public boolean f532n;

        public class a implements Parcelable.ClassLoaderCreator<o> {
            @Override // android.os.Parcelable.Creator
            public Object createFromParcel(Parcel parcel) {
                return new o(parcel, null);
            }

            @Override // android.os.Parcelable.Creator
            public Object[] newArray(int i2) {
                return new o[i2];
            }

            @Override // android.os.Parcelable.ClassLoaderCreator
            public o createFromParcel(Parcel parcel, ClassLoader classLoader) {
                return new o(parcel, classLoader);
            }
        }

        public o(Parcel parcel, ClassLoader classLoader) {
            super(parcel, classLoader);
            this.f532n = ((Boolean) parcel.readValue(null)).booleanValue();
        }

        public o(Parcelable parcelable) {
            super(parcelable);
        }

        public String toString() {
            StringBuilder sbF = g.a.a.a.a.F("SearchView.SavedState{");
            sbF.append(Integer.toHexString(System.identityHashCode(this)));
            sbF.append(" isIconified=");
            sbF.append(this.f532n);
            sbF.append("}");
            return sbF.toString();
        }

        @Override // d.j.a.a, android.os.Parcelable
        public void writeToParcel(Parcel parcel, int i2) {
            parcel.writeParcelable(this.f2846m, i2);
            parcel.writeValue(Boolean.valueOf(this.f532n));
        }
    }

    public static class p extends TouchDelegate {
        public final View a;

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        public final Rect f533b;

        /* JADX INFO: renamed from: c, reason: collision with root package name */
        public final Rect f534c;

        /* JADX INFO: renamed from: d, reason: collision with root package name */
        public final Rect f535d;

        /* JADX INFO: renamed from: e, reason: collision with root package name */
        public final int f536e;

        /* JADX INFO: renamed from: f, reason: collision with root package name */
        public boolean f537f;

        public p(Rect rect, Rect rect2, View view) {
            super(rect, view);
            this.f536e = ViewConfiguration.get(view.getContext()).getScaledTouchSlop();
            this.f533b = new Rect();
            this.f535d = new Rect();
            this.f534c = new Rect();
            a(rect, rect2);
            this.a = view;
        }

        public void a(Rect rect, Rect rect2) {
            this.f533b.set(rect);
            this.f535d.set(rect);
            Rect rect3 = this.f535d;
            int i2 = this.f536e;
            rect3.inset(-i2, -i2);
            this.f534c.set(rect2);
        }

        @Override // android.view.TouchDelegate
        public boolean onTouchEvent(MotionEvent motionEvent) {
            boolean z2;
            float width;
            int height;
            boolean z3;
            int x2 = (int) motionEvent.getX();
            int y2 = (int) motionEvent.getY();
            int action = motionEvent.getAction();
            boolean z4 = true;
            if (action != 0) {
                if (action == 1 || action == 2) {
                    z3 = this.f537f;
                    if (z3 && !this.f535d.contains(x2, y2)) {
                        z4 = z3;
                        z2 = false;
                    }
                } else {
                    if (action == 3) {
                        z3 = this.f537f;
                        this.f537f = false;
                    }
                    z2 = true;
                    z4 = false;
                }
                z4 = z3;
                z2 = true;
            } else if (this.f533b.contains(x2, y2)) {
                this.f537f = true;
                z2 = true;
            } else {
                z2 = true;
                z4 = false;
            }
            if (!z4) {
                return false;
            }
            if (!z2 || this.f534c.contains(x2, y2)) {
                Rect rect = this.f534c;
                width = x2 - rect.left;
                height = y2 - rect.top;
            } else {
                width = this.a.getWidth() / 2;
                height = this.a.getHeight() / 2;
            }
            motionEvent.setLocation(width, height);
            return this.a.dispatchTouchEvent(motionEvent);
        }
    }

    static {
        A = Build.VERSION.SDK_INT < 29 ? new n() : null;
    }

    public SearchView(Context context) {
        this(context, null);
    }

    public SearchView(Context context, AttributeSet attributeSet) {
        this(context, attributeSet, R.attr.searchViewStyle);
    }

    public SearchView(Context context, AttributeSet attributeSet, int i2) {
        super(context, attributeSet, i2);
        this.L = new Rect();
        this.M = new Rect();
        this.N = new int[2];
        this.O = new int[2];
        this.t0 = new b();
        this.u0 = new c();
        this.v0 = new WeakHashMap<>();
        f fVar = new f();
        this.w0 = fVar;
        this.x0 = new g();
        h hVar = new h();
        this.y0 = hVar;
        i iVar = new i();
        this.z0 = iVar;
        j jVar = new j();
        this.A0 = jVar;
        this.B0 = new a();
        TypedArray typedArrayObtainStyledAttributes = context.obtainStyledAttributes(attributeSet, d.b.b.f1547t, i2, 0);
        z0 z0Var = new z0(context, typedArrayObtainStyledAttributes);
        LayoutInflater.from(context).inflate(z0Var.l(9, R.layout.abc_search_view), (ViewGroup) this, true);
        SearchAutoComplete searchAutoComplete = (SearchAutoComplete) findViewById(R.id.search_src_text);
        this.B = searchAutoComplete;
        searchAutoComplete.setSearchView(this);
        this.C = findViewById(R.id.search_edit_frame);
        View viewFindViewById = findViewById(R.id.search_plate);
        this.D = viewFindViewById;
        View viewFindViewById2 = findViewById(R.id.submit_area);
        this.E = viewFindViewById2;
        ImageView imageView = (ImageView) findViewById(R.id.search_button);
        this.F = imageView;
        ImageView imageView2 = (ImageView) findViewById(R.id.search_go_btn);
        this.G = imageView2;
        ImageView imageView3 = (ImageView) findViewById(R.id.search_close_btn);
        this.H = imageView3;
        ImageView imageView4 = (ImageView) findViewById(R.id.search_voice_btn);
        this.I = imageView4;
        ImageView imageView5 = (ImageView) findViewById(R.id.search_mag_icon);
        this.P = imageView5;
        Drawable drawableG = z0Var.g(10);
        AtomicInteger atomicInteger = y.a;
        y.c.q(viewFindViewById, drawableG);
        y.c.q(viewFindViewById2, z0Var.g(14));
        imageView.setImageDrawable(z0Var.g(13));
        imageView2.setImageDrawable(z0Var.g(7));
        imageView3.setImageDrawable(z0Var.g(4));
        imageView4.setImageDrawable(z0Var.g(16));
        imageView5.setImageDrawable(z0Var.g(13));
        this.Q = z0Var.g(12);
        imageView.setTooltipText(getResources().getString(R.string.abc_searchview_description_search));
        this.R = z0Var.l(15, R.layout.abc_search_dropdown_item_icons_2line);
        this.S = z0Var.l(5, 0);
        imageView.setOnClickListener(fVar);
        imageView3.setOnClickListener(fVar);
        imageView2.setOnClickListener(fVar);
        imageView4.setOnClickListener(fVar);
        searchAutoComplete.setOnClickListener(fVar);
        searchAutoComplete.addTextChangedListener(this.B0);
        searchAutoComplete.setOnEditorActionListener(hVar);
        searchAutoComplete.setOnItemClickListener(iVar);
        searchAutoComplete.setOnItemSelectedListener(jVar);
        searchAutoComplete.setOnKeyListener(this.x0);
        searchAutoComplete.setOnFocusChangeListener(new d());
        setIconifiedByDefault(z0Var.a(8, true));
        int iF = z0Var.f(1, -1);
        if (iF != -1) {
            setMaxWidth(iF);
        }
        this.V = z0Var.n(6);
        this.i0 = z0Var.n(11);
        int iJ = z0Var.j(3, -1);
        if (iJ != -1) {
            setImeOptions(iJ);
        }
        int iJ2 = z0Var.j(2, -1);
        if (iJ2 != -1) {
            setInputType(iJ2);
        }
        setFocusable(z0Var.a(0, true));
        typedArrayObtainStyledAttributes.recycle();
        Intent intent = new Intent("android.speech.action.WEB_SEARCH");
        this.T = intent;
        intent.addFlags(268435456);
        intent.putExtra("android.speech.extra.LANGUAGE_MODEL", "web_search");
        Intent intent2 = new Intent("android.speech.action.RECOGNIZE_SPEECH");
        this.U = intent2;
        intent2.addFlags(268435456);
        View viewFindViewById3 = findViewById(searchAutoComplete.getDropDownAnchor());
        this.J = viewFindViewById3;
        if (viewFindViewById3 != null) {
            viewFindViewById3.addOnLayoutChangeListener(new e());
        }
        G(this.e0);
        D();
    }

    private int getPreferredHeight() {
        return getContext().getResources().getDimensionPixelSize(R.dimen.abc_search_view_preferred_height);
    }

    private int getPreferredWidth() {
        return getContext().getResources().getDimensionPixelSize(R.dimen.abc_search_view_preferred_width);
    }

    private void setQuery(CharSequence charSequence) {
        this.B.setText(charSequence);
        this.B.setSelection(TextUtils.isEmpty(charSequence) ? 0 : charSequence.length());
    }

    public boolean A(int i2, KeyEvent keyEvent) {
        if (this.r0 != null && this.g0 != null && keyEvent.getAction() == 0 && keyEvent.hasNoModifiers()) {
            if (i2 == 66 || i2 == 84 || i2 == 61) {
                return v(this.B.getListSelection());
            }
            if (i2 == 21 || i2 == 22) {
                this.B.setSelection(i2 == 21 ? 0 : this.B.length());
                this.B.setListSelection(0);
                this.B.clearListSelection();
                this.B.a();
                return true;
            }
            if (i2 != 19 || this.B.getListSelection() == 0) {
                return false;
            }
        }
        return false;
    }

    public final void B() {
        boolean z2 = true;
        boolean z3 = !TextUtils.isEmpty(this.B.getText());
        if (!z3 && (!this.e0 || this.p0)) {
            z2 = false;
        }
        this.H.setVisibility(z2 ? 0 : 8);
        Drawable drawable = this.H.getDrawable();
        if (drawable != null) {
            drawable.setState(z3 ? ViewGroup.ENABLED_STATE_SET : ViewGroup.EMPTY_STATE_SET);
        }
    }

    public void C() {
        int[] iArr = this.B.hasFocus() ? ViewGroup.FOCUSED_STATE_SET : ViewGroup.EMPTY_STATE_SET;
        Drawable background = this.D.getBackground();
        if (background != null) {
            background.setState(iArr);
        }
        Drawable background2 = this.E.getBackground();
        if (background2 != null) {
            background2.setState(iArr);
        }
        invalidate();
    }

    /* JADX WARN: Type inference fix 'apply assigned field type' failed
    java.lang.UnsupportedOperationException: ArgType.getObject(), call class: class jadx.core.dex.instructions.args.ArgType$UnknownArg
    	at jadx.core.dex.instructions.args.ArgType.getObject(ArgType.java:593)
    	at jadx.core.dex.attributes.nodes.ClassTypeVarsAttr.getTypeVarsMapFor(ClassTypeVarsAttr.java:35)
    	at jadx.core.dex.nodes.utils.TypeUtils.replaceClassGenerics(TypeUtils.java:177)
    	at jadx.core.dex.visitors.typeinference.FixTypesVisitor.insertExplicitUseCast(FixTypesVisitor.java:397)
    	at jadx.core.dex.visitors.typeinference.FixTypesVisitor.tryFieldTypeWithNewCasts(FixTypesVisitor.java:359)
    	at jadx.core.dex.visitors.typeinference.FixTypesVisitor.applyFieldType(FixTypesVisitor.java:309)
    	at jadx.core.dex.visitors.typeinference.FixTypesVisitor.visit(FixTypesVisitor.java:94)
     */
    public final void D() {
        CharSequence queryHint = getQueryHint();
        SearchAutoComplete searchAutoComplete = this.B;
        CharSequence charSequence = queryHint;
        if (queryHint == null) {
            charSequence = "";
        }
        CharSequence charSequence2 = charSequence;
        if (this.e0) {
            charSequence2 = charSequence;
            if (this.Q != null) {
                int textSize = (int) (((double) searchAutoComplete.getTextSize()) * 1.25d);
                this.Q.setBounds(0, 0, textSize, textSize);
                SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder("   ");
                spannableStringBuilder.setSpan(new ImageSpan(this.Q), 1, 2, 33);
                spannableStringBuilder.append(charSequence);
                charSequence2 = spannableStringBuilder;
            }
        }
        searchAutoComplete.setHint(charSequence2);
    }

    public final void E() {
        int i2 = 0;
        if (!((this.h0 || this.m0) && !this.f0) || (this.G.getVisibility() != 0 && this.I.getVisibility() != 0)) {
            i2 = 8;
        }
        this.E.setVisibility(i2);
    }

    /* JADX WARN: Removed duplicated region for block: B:18:0x0021  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final void F(boolean r3) {
        /*
            r2 = this;
            boolean r0 = r2.h0
            r1 = 0
            if (r0 == 0) goto L21
            if (r0 != 0) goto Lb
            boolean r0 = r2.m0
            if (r0 == 0) goto L11
        Lb:
            boolean r0 = r2.f0
            if (r0 != 0) goto L11
            r0 = 1
            goto L12
        L11:
            r0 = r1
        L12:
            if (r0 == 0) goto L21
            boolean r0 = r2.hasFocus()
            if (r0 == 0) goto L21
            if (r3 != 0) goto L23
            boolean r3 = r2.m0
            if (r3 != 0) goto L21
            goto L23
        L21:
            r1 = 8
        L23:
            android.widget.ImageView r3 = r2.G
            r3.setVisibility(r1)
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: androidx.appcompat.widget.SearchView.F(boolean):void");
    }

    public final void G(boolean z2) {
        this.f0 = z2;
        int i2 = z2 ? 0 : 8;
        boolean z3 = !TextUtils.isEmpty(this.B.getText());
        this.F.setVisibility(i2);
        F(z3);
        this.C.setVisibility(z2 ? 8 : 0);
        this.P.setVisibility((this.P.getDrawable() == null || this.e0) ? 8 : 0);
        B();
        H(!z3);
        E();
    }

    public final void H(boolean z2) {
        int i2 = 8;
        if (this.m0 && !this.f0 && z2) {
            this.G.setVisibility(8);
            i2 = 0;
        }
        this.I.setVisibility(i2);
    }

    @Override // d.b.f.b
    public void c() {
        if (this.p0) {
            return;
        }
        this.p0 = true;
        int imeOptions = this.B.getImeOptions();
        this.q0 = imeOptions;
        this.B.setImeOptions(imeOptions | Lz4Constants.MAX_BLOCK_SIZE);
        this.B.setText("");
        setIconified(false);
    }

    @Override // android.view.ViewGroup, android.view.View
    public void clearFocus() {
        this.k0 = true;
        super.clearFocus();
        this.B.clearFocus();
        this.B.setImeVisibility(false);
        this.k0 = false;
    }

    @Override // d.b.f.b
    public void e() {
        this.B.setText("");
        SearchAutoComplete searchAutoComplete = this.B;
        searchAutoComplete.setSelection(searchAutoComplete.length());
        this.o0 = "";
        clearFocus();
        G(true);
        this.B.setImeOptions(this.q0);
        this.p0 = false;
    }

    public int getImeOptions() {
        return this.B.getImeOptions();
    }

    public int getInputType() {
        return this.B.getInputType();
    }

    public int getMaxWidth() {
        return this.l0;
    }

    public CharSequence getQuery() {
        return this.B.getText();
    }

    public CharSequence getQueryHint() {
        CharSequence charSequence = this.i0;
        if (charSequence != null) {
            return charSequence;
        }
        SearchableInfo searchableInfo = this.r0;
        return (searchableInfo == null || searchableInfo.getHintId() == 0) ? this.V : getContext().getText(this.r0.getHintId());
    }

    public int getSuggestionCommitIconResId() {
        return this.S;
    }

    public int getSuggestionRowLayout() {
        return this.R;
    }

    public d.i.a.a getSuggestionsAdapter() {
        return this.g0;
    }

    @Override // android.view.ViewGroup, android.view.View
    public void onDetachedFromWindow() {
        removeCallbacks(this.t0);
        post(this.u0);
        super.onDetachedFromWindow();
    }

    @Override // d.b.g.k0, android.view.ViewGroup, android.view.View
    public void onLayout(boolean z2, int i2, int i3, int i4, int i5) {
        super.onLayout(z2, i2, i3, i4, i5);
        if (z2) {
            SearchAutoComplete searchAutoComplete = this.B;
            Rect rect = this.L;
            searchAutoComplete.getLocationInWindow(this.N);
            getLocationInWindow(this.O);
            int[] iArr = this.N;
            int i6 = iArr[1];
            int[] iArr2 = this.O;
            int i7 = i6 - iArr2[1];
            int i8 = iArr[0] - iArr2[0];
            rect.set(i8, i7, searchAutoComplete.getWidth() + i8, searchAutoComplete.getHeight() + i7);
            Rect rect2 = this.M;
            Rect rect3 = this.L;
            rect2.set(rect3.left, 0, rect3.right, i5 - i3);
            p pVar = this.K;
            if (pVar != null) {
                pVar.a(this.M, this.L);
                return;
            }
            p pVar2 = new p(this.M, this.L, this.B);
            this.K = pVar2;
            setTouchDelegate(pVar2);
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:25:0x0041  */
    /* JADX WARN: Removed duplicated region for block: B:28:0x0049  */
    @Override // d.b.g.k0, android.view.View
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public void onMeasure(int r4, int r5) {
        /*
            r3 = this;
            boolean r0 = r3.f0
            if (r0 == 0) goto L8
            super.onMeasure(r4, r5)
            return
        L8:
            int r0 = android.view.View.MeasureSpec.getMode(r4)
            int r4 = android.view.View.MeasureSpec.getSize(r4)
            r1 = -2147483648(0xffffffff80000000, float:-0.0)
            r2 = 1073741824(0x40000000, float:2.0)
            if (r0 == r1) goto L2a
            if (r0 == 0) goto L20
            if (r0 == r2) goto L1b
            goto L37
        L1b:
            int r0 = r3.l0
            if (r0 <= 0) goto L37
            goto L2e
        L20:
            int r4 = r3.l0
            if (r4 <= 0) goto L25
            goto L37
        L25:
            int r4 = r3.getPreferredWidth()
            goto L37
        L2a:
            int r0 = r3.l0
            if (r0 <= 0) goto L2f
        L2e:
            goto L33
        L2f:
            int r0 = r3.getPreferredWidth()
        L33:
            int r4 = java.lang.Math.min(r0, r4)
        L37:
            int r0 = android.view.View.MeasureSpec.getMode(r5)
            int r5 = android.view.View.MeasureSpec.getSize(r5)
            if (r0 == r1) goto L49
            if (r0 == 0) goto L44
            goto L51
        L44:
            int r5 = r3.getPreferredHeight()
            goto L51
        L49:
            int r0 = r3.getPreferredHeight()
            int r5 = java.lang.Math.min(r0, r5)
        L51:
            int r4 = android.view.View.MeasureSpec.makeMeasureSpec(r4, r2)
            int r5 = android.view.View.MeasureSpec.makeMeasureSpec(r5, r2)
            super.onMeasure(r4, r5)
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: androidx.appcompat.widget.SearchView.onMeasure(int, int):void");
    }

    @Override // android.view.View
    public void onRestoreInstanceState(Parcelable parcelable) {
        if (!(parcelable instanceof o)) {
            super.onRestoreInstanceState(parcelable);
            return;
        }
        o oVar = (o) parcelable;
        super.onRestoreInstanceState(oVar.f2846m);
        G(oVar.f532n);
        requestLayout();
    }

    @Override // android.view.View
    public Parcelable onSaveInstanceState() {
        o oVar = new o(super.onSaveInstanceState());
        oVar.f532n = this.f0;
        return oVar;
    }

    @Override // android.view.View
    public void onWindowFocusChanged(boolean z2) {
        super.onWindowFocusChanged(z2);
        post(this.t0);
    }

    public final Intent q(String str, Uri uri, String str2, String str3, int i2, String str4) {
        Intent intent = new Intent(str);
        intent.addFlags(268435456);
        if (uri != null) {
            intent.setData(uri);
        }
        intent.putExtra("user_query", this.o0);
        if (str3 != null) {
            intent.putExtra("query", str3);
        }
        if (str2 != null) {
            intent.putExtra("intent_extra_data_key", str2);
        }
        Bundle bundle = this.s0;
        if (bundle != null) {
            intent.putExtra("app_data", bundle);
        }
        if (i2 != 0) {
            intent.putExtra("action_key", i2);
            intent.putExtra("action_msg", str4);
        }
        intent.setComponent(this.r0.getSearchActivity());
        return intent;
    }

    public final Intent r(Intent intent, SearchableInfo searchableInfo) {
        ComponentName searchActivity = searchableInfo.getSearchActivity();
        Intent intent2 = new Intent("android.intent.action.SEARCH");
        intent2.setComponent(searchActivity);
        PendingIntent activity = PendingIntent.getActivity(getContext(), 0, intent2, Pow2.MAX_POW2);
        Bundle bundle = new Bundle();
        Bundle bundle2 = this.s0;
        if (bundle2 != null) {
            bundle.putParcelable("app_data", bundle2);
        }
        Intent intent3 = new Intent(intent);
        Resources resources = getResources();
        String string = searchableInfo.getVoiceLanguageModeId() != 0 ? resources.getString(searchableInfo.getVoiceLanguageModeId()) : "free_form";
        String string2 = searchableInfo.getVoicePromptTextId() != 0 ? resources.getString(searchableInfo.getVoicePromptTextId()) : null;
        String string3 = searchableInfo.getVoiceLanguageId() != 0 ? resources.getString(searchableInfo.getVoiceLanguageId()) : null;
        int voiceMaxResults = searchableInfo.getVoiceMaxResults() != 0 ? searchableInfo.getVoiceMaxResults() : 1;
        intent3.putExtra("android.speech.extra.LANGUAGE_MODEL", string);
        intent3.putExtra("android.speech.extra.PROMPT", string2);
        intent3.putExtra("android.speech.extra.LANGUAGE", string3);
        intent3.putExtra("android.speech.extra.MAX_RESULTS", voiceMaxResults);
        intent3.putExtra("calling_package", searchActivity != null ? searchActivity.flattenToShortString() : null);
        intent3.putExtra("android.speech.extra.RESULTS_PENDINGINTENT", activity);
        intent3.putExtra("android.speech.extra.RESULTS_PENDINGINTENT_BUNDLE", bundle);
        return intent3;
    }

    @Override // android.view.ViewGroup, android.view.View
    public boolean requestFocus(int i2, Rect rect) {
        if (this.k0 || !isFocusable()) {
            return false;
        }
        if (this.f0) {
            return super.requestFocus(i2, rect);
        }
        boolean zRequestFocus = this.B.requestFocus(i2, rect);
        if (zRequestFocus) {
            G(false);
        }
        return zRequestFocus;
    }

    public void s() {
        if (Build.VERSION.SDK_INT >= 29) {
            this.B.refreshAutoCompleteResults();
            return;
        }
        n nVar = A;
        SearchAutoComplete searchAutoComplete = this.B;
        Objects.requireNonNull(nVar);
        n.a();
        Method method = nVar.a;
        if (method != null) {
            try {
                method.invoke(searchAutoComplete, new Object[0]);
            } catch (Exception unused) {
            }
        }
        n nVar2 = A;
        SearchAutoComplete searchAutoComplete2 = this.B;
        Objects.requireNonNull(nVar2);
        n.a();
        Method method2 = nVar2.f530b;
        if (method2 != null) {
            try {
                method2.invoke(searchAutoComplete2, new Object[0]);
            } catch (Exception unused2) {
            }
        }
    }

    public void setAppSearchData(Bundle bundle) {
        this.s0 = bundle;
    }

    public void setIconified(boolean z2) {
        if (z2) {
            u();
        } else {
            y();
        }
    }

    public void setIconifiedByDefault(boolean z2) {
        if (this.e0 == z2) {
            return;
        }
        this.e0 = z2;
        G(z2);
        D();
    }

    public void setImeOptions(int i2) {
        this.B.setImeOptions(i2);
    }

    public void setInputType(int i2) {
        this.B.setInputType(i2);
    }

    public void setMaxWidth(int i2) {
        this.l0 = i2;
        requestLayout();
    }

    public void setOnCloseListener(k kVar) {
        this.f514a0 = kVar;
    }

    public void setOnQueryTextFocusChangeListener(View.OnFocusChangeListener onFocusChangeListener) {
        this.f515b0 = onFocusChangeListener;
    }

    public void setOnQueryTextListener(l lVar) {
        this.W = lVar;
    }

    public void setOnSearchClickListener(View.OnClickListener onClickListener) {
        this.f517d0 = onClickListener;
    }

    public void setOnSuggestionListener(m mVar) {
        this.f516c0 = mVar;
    }

    public void setQueryHint(CharSequence charSequence) {
        this.i0 = charSequence;
        D();
    }

    public void setQueryRefinementEnabled(boolean z2) {
        this.j0 = z2;
        d.i.a.a aVar = this.g0;
        if (aVar instanceof t0) {
            ((t0) aVar).C = z2 ? 2 : 1;
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:34:0x009f  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public void setSearchableInfo(android.app.SearchableInfo r7) {
        /*
            r6 = this;
            r6.r0 = r7
            r0 = 1
            r1 = 65536(0x10000, float:9.1835E-41)
            r2 = 0
            if (r7 == 0) goto L6e
            androidx.appcompat.widget.SearchView$SearchAutoComplete r3 = r6.B
            int r7 = r7.getSuggestThreshold()
            r3.setThreshold(r7)
            androidx.appcompat.widget.SearchView$SearchAutoComplete r7 = r6.B
            android.app.SearchableInfo r3 = r6.r0
            int r3 = r3.getImeOptions()
            r7.setImeOptions(r3)
            android.app.SearchableInfo r7 = r6.r0
            int r7 = r7.getInputType()
            r3 = r7 & 15
            if (r3 != r0) goto L36
            r3 = -65537(0xfffffffffffeffff, float:NaN)
            r7 = r7 & r3
            android.app.SearchableInfo r3 = r6.r0
            java.lang.String r3 = r3.getSuggestAuthority()
            if (r3 == 0) goto L36
            r7 = r7 | r1
            r3 = 524288(0x80000, float:7.34684E-40)
            r7 = r7 | r3
        L36:
            androidx.appcompat.widget.SearchView$SearchAutoComplete r3 = r6.B
            r3.setInputType(r7)
            d.i.a.a r7 = r6.g0
            if (r7 == 0) goto L42
            r7.b(r2)
        L42:
            android.app.SearchableInfo r7 = r6.r0
            java.lang.String r7 = r7.getSuggestAuthority()
            if (r7 == 0) goto L6b
            d.b.g.t0 r7 = new d.b.g.t0
            android.content.Context r3 = r6.getContext()
            android.app.SearchableInfo r4 = r6.r0
            java.util.WeakHashMap<java.lang.String, android.graphics.drawable.Drawable$ConstantState> r5 = r6.v0
            r7.<init>(r3, r6, r4, r5)
            r6.g0 = r7
            androidx.appcompat.widget.SearchView$SearchAutoComplete r3 = r6.B
            r3.setAdapter(r7)
            d.i.a.a r7 = r6.g0
            d.b.g.t0 r7 = (d.b.g.t0) r7
            boolean r3 = r6.j0
            if (r3 == 0) goto L68
            r3 = 2
            goto L69
        L68:
            r3 = r0
        L69:
            r7.C = r3
        L6b:
            r6.D()
        L6e:
            android.app.SearchableInfo r7 = r6.r0
            r3 = 0
            if (r7 == 0) goto L9f
            boolean r7 = r7.getVoiceSearchEnabled()
            if (r7 == 0) goto L9f
            android.app.SearchableInfo r7 = r6.r0
            boolean r7 = r7.getVoiceSearchLaunchWebSearch()
            if (r7 == 0) goto L84
            android.content.Intent r2 = r6.T
            goto L8e
        L84:
            android.app.SearchableInfo r7 = r6.r0
            boolean r7 = r7.getVoiceSearchLaunchRecognizer()
            if (r7 == 0) goto L8e
            android.content.Intent r2 = r6.U
        L8e:
            if (r2 == 0) goto L9f
            android.content.Context r7 = r6.getContext()
            android.content.pm.PackageManager r7 = r7.getPackageManager()
            android.content.pm.ResolveInfo r7 = r7.resolveActivity(r2, r1)
            if (r7 == 0) goto L9f
            goto La0
        L9f:
            r0 = r3
        La0:
            r6.m0 = r0
            if (r0 == 0) goto Lab
            androidx.appcompat.widget.SearchView$SearchAutoComplete r7 = r6.B
            java.lang.String r0 = "nm"
            r7.setPrivateImeOptions(r0)
        Lab:
            boolean r7 = r6.f0
            r6.G(r7)
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: androidx.appcompat.widget.SearchView.setSearchableInfo(android.app.SearchableInfo):void");
    }

    public void setSubmitButtonEnabled(boolean z2) {
        this.h0 = z2;
        G(this.f0);
    }

    public void setSuggestionsAdapter(d.i.a.a aVar) {
        this.g0 = aVar;
        this.B.setAdapter(aVar);
    }

    public void t(int i2, String str, String str2) {
        getContext().startActivity(q("android.intent.action.SEARCH", null, null, str2, i2, null));
    }

    public void u() {
        if (!TextUtils.isEmpty(this.B.getText())) {
            this.B.setText("");
            this.B.requestFocus();
            this.B.setImeVisibility(true);
        } else if (this.e0) {
            k kVar = this.f514a0;
            if (kVar == null || !kVar.a()) {
                clearFocus();
                G(true);
            }
        }
    }

    public boolean v(int i2) {
        int position;
        String strH;
        m mVar = this.f516c0;
        if (mVar != null && mVar.b(i2)) {
            return false;
        }
        Cursor cursor = this.g0.f2836n;
        if (cursor != null && cursor.moveToPosition(i2)) {
            Intent intentQ = null;
            try {
                int i3 = t0.f2075w;
                String strH2 = t0.h(cursor, cursor.getColumnIndex("suggest_intent_action"));
                if (strH2 == null) {
                    strH2 = this.r0.getSuggestIntentAction();
                }
                if (strH2 == null) {
                    strH2 = "android.intent.action.SEARCH";
                }
                String str = strH2;
                String strH3 = t0.h(cursor, cursor.getColumnIndex("suggest_intent_data"));
                if (strH3 == null) {
                    strH3 = this.r0.getSuggestIntentData();
                }
                if (strH3 != null && (strH = t0.h(cursor, cursor.getColumnIndex("suggest_intent_data_id"))) != null) {
                    strH3 = strH3 + "/" + Uri.encode(strH);
                }
                intentQ = q(str, strH3 == null ? null : Uri.parse(strH3), t0.h(cursor, cursor.getColumnIndex("suggest_intent_extra_data")), t0.h(cursor, cursor.getColumnIndex("suggest_intent_query")), 0, null);
            } catch (RuntimeException e2) {
                try {
                    position = cursor.getPosition();
                } catch (RuntimeException unused) {
                    position = -1;
                }
                Log.w("SearchView", "Search suggestions cursor at row " + position + " returned exception.", e2);
            }
            if (intentQ != null) {
                try {
                    getContext().startActivity(intentQ);
                } catch (RuntimeException e3) {
                    Log.e("SearchView", "Failed launch activity: " + intentQ, e3);
                }
            }
        }
        this.B.setImeVisibility(false);
        this.B.dismissDropDown();
        return true;
    }

    public boolean w(int i2) {
        CharSequence charSequenceC;
        m mVar = this.f516c0;
        if (mVar != null && mVar.a(i2)) {
            return false;
        }
        Editable text = this.B.getText();
        Cursor cursor = this.g0.f2836n;
        if (cursor == null) {
            return true;
        }
        if (!cursor.moveToPosition(i2) || (charSequenceC = this.g0.c(cursor)) == null) {
            setQuery(text);
            return true;
        }
        setQuery(charSequenceC);
        return true;
    }

    public void x(CharSequence charSequence) {
        setQuery(charSequence);
    }

    public void y() {
        G(false);
        this.B.requestFocus();
        this.B.setImeVisibility(true);
        View.OnClickListener onClickListener = this.f517d0;
        if (onClickListener != null) {
            onClickListener.onClick(this);
        }
    }

    public void z() {
        Editable text = this.B.getText();
        if (text == null || TextUtils.getTrimmedLength(text) <= 0) {
            return;
        }
        l lVar = this.W;
        if (lVar == null || !lVar.b(text.toString())) {
            if (this.r0 != null) {
                t(0, null, text.toString());
            }
            this.B.setImeVisibility(false);
            this.B.dismissDropDown();
        }
    }
}
