package o;

import android.text.InputFilter;
import android.text.Spanned;
import android.widget.TextView;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.wv, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C2858wv implements InputFilter {
    public final TextView a;
    public RunnableC2763vv b;

    public C2858wv(TextView textView) {
        this.a = textView;
    }

    @Override // android.text.InputFilter
    public final CharSequence filter(CharSequence charSequence, int i, int i2, Spanned spanned, int i3, int i4) {
        TextView textView = this.a;
        if (textView.isInEditMode()) {
            return charSequence;
        }
        int iC = C2004nv.a().c();
        if (iC != 0) {
            if (iC == 1) {
                if ((i4 == 0 && i3 == 0 && spanned.length() == 0 && charSequence == textView.getText()) || charSequence == null) {
                    return charSequence;
                }
                if (i != 0 || i2 != charSequence.length()) {
                    charSequence = charSequence.subSequence(i, i2);
                }
                return C2004nv.a().g(0, charSequence.length(), 0, charSequence);
            }
            if (iC != 3) {
                return charSequence;
            }
        }
        C2004nv c2004nvA = C2004nv.a();
        if (this.b == null) {
            this.b = new RunnableC2763vv(textView, this);
        }
        c2004nvA.h(this.b);
        return charSequence;
    }
}
