package p035l0;

import android.database.Cursor;
import android.widget.Filter;

/* renamed from: l0.b */
/* loaded from: classes.dex */
public class C1418b extends Filter {

    /* renamed from: a */
    public InterfaceC1419a f3145a;

    /* renamed from: l0.b$a */
    /* loaded from: classes.dex */
    public interface InterfaceC1419a {
        /* renamed from: a */
        void mo1390a(Cursor cursor);

        /* renamed from: b */
        Cursor mo1389b();

        /* renamed from: c */
        Cursor mo1388c(CharSequence charSequence);

        CharSequence convertToString(Cursor cursor);
    }

    public C1418b(InterfaceC1419a interfaceC1419a) {
        this.f3145a = interfaceC1419a;
    }

    @Override // android.widget.Filter
    public CharSequence convertResultToString(Object obj) {
        return this.f3145a.convertToString((Cursor) obj);
    }

    @Override // android.widget.Filter
    public Filter.FilterResults performFiltering(CharSequence charSequence) {
        Cursor mo1388c = this.f3145a.mo1388c(charSequence);
        Filter.FilterResults filterResults = new Filter.FilterResults();
        if (mo1388c != null) {
            filterResults.count = mo1388c.getCount();
        } else {
            filterResults.count = 0;
            mo1388c = null;
        }
        filterResults.values = mo1388c;
        return filterResults;
    }

    @Override // android.widget.Filter
    public void publishResults(CharSequence charSequence, Filter.FilterResults filterResults) {
        Cursor mo1389b = this.f3145a.mo1389b();
        Object obj = filterResults.values;
        if (obj == null || obj == mo1389b) {
            return;
        }
        this.f3145a.mo1390a((Cursor) obj);
    }
}