package androidx.leanback.widget;

import android.os.Handler;
import android.view.KeyEvent;
import android.widget.TextView;

/* JADX INFO: loaded from: classes.dex */
class cy implements TextView.OnEditorActionListener {
    public final /* synthetic */ SearchBar a;

    public cy(SearchBar searchBar) {
        this.a = searchBar;
    }

    @Override // android.widget.TextView.OnEditorActionListener
    public final boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) {
        SearchBar searchBar = this.a;
        Handler handler = searchBar.k;
        if ((3 == i || i == 0) && searchBar.a != null) {
            searchBar.a();
            handler.postDelayed(new cv(this), 500L);
            return true;
        }
        if (1 == i && searchBar.a != null) {
            searchBar.a();
            handler.postDelayed(new cw(this), 500L);
            return true;
        }
        if (2 != i) {
            return false;
        }
        searchBar.a();
        handler.postDelayed(new cx(this), 500L);
        return true;
    }
}
