package io.flutter.plugin.editing;

import android.graphics.Rect;
import android.os.Build;
import android.os.Bundle;
import android.os.IBinder;
import android.text.Selection;
import android.util.SparseArray;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewStructure;
import android.view.autofill.AutofillId;
import android.view.autofill.AutofillManager;
import android.view.autofill.AutofillValue;
import android.view.inputmethod.BaseInputConnection;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputConnection;
import android.view.inputmethod.InputMethodManager;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.room.x;
import dd.d0;
import dd.k0;
import dd.l0;
import dd.m0;
import dd.n0;
import dd.p0;
import io.flutter.embedding.android.FlutterView;
import io.flutter.embedding.android.c0;
import io.flutter.embedding.engine.systemchannels.TextInputChannel$TextCapitalization;
import io.flutter.embedding.engine.systemchannels.TextInputChannel$TextInputType;
import io.flutter.plugin.platform.r;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import tv.danmaku.ijk.media.player.IjkMediaPlayer;

/* JADX INFO: loaded from: classes.dex */
public final class m implements f {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final View f28166a;

    @Nullable
    private SparseArray<l0> autofillConfiguration;

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

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

    @Nullable
    private l0 configuration;

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

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public l f28170e = new l(TextInputPlugin$InputTarget$Type.f28116a, 0);

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

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

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

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public final ImeSyncDeferringInsetsCallback f28174i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public n0 f28175j;

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

    @Nullable
    private Rect lastClientRect;

    @Nullable
    private InputConnection lastInputConnection;

    public m(FlutterView flutterView, p0 p0Var, d0 d0Var, r rVar) {
        this.f28166a = flutterView;
        this.f28171f = new g(null, flutterView);
        this.f28167b = (InputMethodManager) flutterView.getContext().getSystemService("input_method");
        int i10 = Build.VERSION.SDK_INT;
        if (i10 >= 26) {
            this.f28168c = io.flutter.embedding.android.a.e(flutterView.getContext().getSystemService(io.flutter.embedding.android.a.j()));
        } else {
            this.f28168c = null;
        }
        if (i10 >= 30) {
            ImeSyncDeferringInsetsCallback imeSyncDeferringInsetsCallback = new ImeSyncDeferringInsetsCallback(flutterView);
            this.f28174i = imeSyncDeferringInsetsCallback;
            imeSyncDeferringInsetsCallback.install();
        }
        this.f28169d = p0Var;
        p0Var.setTextInputMethodHandler(new k(this));
        p0Var.f25143a.invokeMethod("TextInputClient.requestExistingInputState", null);
        this.f28173h = rVar;
        rVar.h(this);
    }

    public static void b(m mVar) {
        if (Build.VERSION.SDK_INT < 26) {
            mVar.getClass();
            return;
        }
        AutofillManager autofillManager = mVar.f28168c;
        if (autofillManager == null || mVar.autofillConfiguration == null) {
            return;
        }
        String str = mVar.configuration.autofill.f25123a;
        int[] iArr = new int[2];
        View view = mVar.f28166a;
        view.getLocationOnScreen(iArr);
        Rect rect = new Rect(mVar.lastClientRect);
        rect.offset(iArr[0], iArr[1]);
        autofillManager.notifyViewEntered(view, str.hashCode(), rect);
    }

    public static void c(m mVar, int i10, boolean z10) {
        if (!z10) {
            mVar.getClass();
            mVar.f28170e = new l(TextInputPlugin$InputTarget$Type.f28119d, i10);
            mVar.lastInputConnection = null;
        } else {
            View view = mVar.f28166a;
            view.requestFocus();
            mVar.f28170e = new l(TextInputPlugin$InputTarget$Type.f28118c, i10);
            mVar.f28167b.restartInput(view);
            mVar.f28172g = false;
        }
    }

    public static void d(m mVar, double d10, double d11, double[] dArr) {
        mVar.getClass();
        double[] dArr2 = new double[4];
        boolean z10 = dArr[3] == 0.0d && dArr[7] == 0.0d && dArr[15] == 1.0d;
        double d12 = dArr[12];
        double d13 = dArr[15];
        double d14 = d12 / d13;
        dArr2[1] = d14;
        dArr2[0] = d14;
        double d15 = dArr[13] / d13;
        dArr2[3] = d15;
        dArr2[2] = d15;
        x xVar = new x(mVar, z10, dArr, dArr2);
        xVar.e(d10, 0.0d);
        xVar.e(d10, d11);
        xVar.e(0.0d, d11);
        Float fValueOf = Float.valueOf(mVar.f28166a.getContext().getResources().getDisplayMetrics().density);
        mVar.lastClientRect = new Rect((int) (dArr2[0] * ((double) fValueOf.floatValue())), (int) (dArr2[2] * ((double) fValueOf.floatValue())), (int) Math.ceil(dArr2[1] * ((double) fValueOf.floatValue())), (int) Math.ceil(dArr2[3] * ((double) fValueOf.floatValue())));
    }

    /* JADX WARN: Code restructure failed: missing block: B:22:0x0082, code lost:
    
        if (r6 == r0.f25142e) goto L38;
     */
    @Override // io.flutter.plugin.editing.f
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void a(boolean z10) {
        AutofillManager autofillManager;
        if (z10) {
            String string = this.f28171f.toString();
            if (Build.VERSION.SDK_INT >= 26 && (autofillManager = this.f28168c) != null && this.autofillConfiguration != null) {
                autofillManager.notifyValueChanged(this.f28166a, this.configuration.autofill.f25123a.hashCode(), AutofillValue.forText(string));
            }
        }
        g gVar = this.f28171f;
        gVar.getClass();
        int selectionStart = Selection.getSelectionStart(gVar);
        g gVar2 = this.f28171f;
        gVar2.getClass();
        int selectionEnd = Selection.getSelectionEnd(gVar2);
        g gVar3 = this.f28171f;
        gVar3.getClass();
        int composingSpanStart = BaseInputConnection.getComposingSpanStart(gVar3);
        g gVar4 = this.f28171f;
        gVar4.getClass();
        int composingSpanEnd = BaseInputConnection.getComposingSpanEnd(gVar4);
        g gVar5 = this.f28171f;
        gVar5.getClass();
        ArrayList arrayList = gVar5.f28141e;
        ArrayList<j> arrayList2 = new ArrayList(arrayList);
        arrayList.clear();
        if (this.f28175j != null) {
            if (this.f28171f.toString().equals(this.f28175j.f25138a)) {
                n0 n0Var = this.f28175j;
                if (selectionStart == n0Var.f25139b) {
                    if (selectionEnd == n0Var.f25140c) {
                        if (composingSpanStart == n0Var.f25141d) {
                        }
                    }
                }
            }
            this.f28171f.toString();
            boolean z11 = this.configuration.f25131e;
            p0 p0Var = this.f28169d;
            if (z11) {
                int i10 = this.f28170e.f28165b;
                p0Var.getClass();
                arrayList2.size();
                HashMap map = new HashMap();
                JSONArray jSONArray = new JSONArray();
                for (j jVar : arrayList2) {
                    jVar.getClass();
                    JSONObject jSONObject = new JSONObject();
                    try {
                        jSONObject.put("oldText", jVar.f28155a.toString());
                        jSONObject.put("deltaText", jVar.f28156b.toString());
                        jSONObject.put("deltaStart", jVar.f28157c);
                        jSONObject.put("deltaEnd", jVar.f28158d);
                        jSONObject.put("selectionBase", jVar.f28159e);
                        jSONObject.put("selectionExtent", jVar.f28160f);
                        jSONObject.put("composingBase", jVar.f28161g);
                        jSONObject.put("composingExtent", jVar.f28162h);
                    } catch (JSONException e10) {
                        e10.toString();
                    }
                    jSONArray.put(jSONObject);
                }
                map.put("deltas", jSONArray);
                p0Var.f25143a.invokeMethod("TextInputClient.updateEditingStateWithDeltas", Arrays.asList(Integer.valueOf(i10), map));
                this.f28171f.f28141e.clear();
            } else {
                int i11 = this.f28170e.f28165b;
                String string2 = this.f28171f.toString();
                p0Var.getClass();
                p0Var.f25143a.invokeMethod("TextInputClient.updateEditingState", Arrays.asList(Integer.valueOf(i11), p0.b(selectionStart, selectionEnd, composingSpanStart, composingSpanEnd, string2)));
            }
            this.f28175j = new n0(selectionStart, selectionEnd, composingSpanStart, composingSpanEnd, this.f28171f.toString());
            return;
        }
        this.f28171f.f28141e.clear();
    }

    /* JADX WARN: Removed duplicated region for block: B:73:0x00b3  */
    /* JADX WARN: Removed duplicated region for block: B:74:0x00b6  */
    @Nullable
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public InputConnection createInputConnection(@NonNull View view, @NonNull c0 c0Var, @NonNull EditorInfo editorInfo) {
        int i10;
        TextInputChannel$TextCapitalization textInputChannel$TextCapitalization;
        TextInputChannel$TextCapitalization textInputChannel$TextCapitalization2;
        int i11;
        l lVar = this.f28170e;
        TextInputPlugin$InputTarget$Type textInputPlugin$InputTarget$Type = lVar.f28164a;
        if (textInputPlugin$InputTarget$Type == TextInputPlugin$InputTarget$Type.f28116a) {
            this.lastInputConnection = null;
            return null;
        }
        if (textInputPlugin$InputTarget$Type == TextInputPlugin$InputTarget$Type.f28119d) {
            return null;
        }
        if (textInputPlugin$InputTarget$Type == TextInputPlugin$InputTarget$Type.f28118c) {
            if (this.f28176k) {
                return this.lastInputConnection;
            }
            InputConnection inputConnectionOnCreateInputConnection = this.f28173h.getPlatformViewById(lVar.f28165b).onCreateInputConnection(editorInfo);
            this.lastInputConnection = inputConnectionOnCreateInputConnection;
            return inputConnectionOnCreateInputConnection;
        }
        l0 l0Var = this.configuration;
        m0 m0Var = l0Var.f25133g;
        TextInputChannel$TextInputType textInputChannel$TextInputType = m0Var.f25134a;
        if (textInputChannel$TextInputType == TextInputChannel$TextInputType.DATETIME) {
            i10 = 4;
        } else if (textInputChannel$TextInputType == TextInputChannel$TextInputType.NUMBER) {
            int i12 = m0Var.f25135b ? 4098 : 2;
            i10 = m0Var.f25136c ? i12 | 8192 : i12;
        } else if (textInputChannel$TextInputType == TextInputChannel$TextInputType.PHONE) {
            i10 = 3;
        } else if (textInputChannel$TextInputType == TextInputChannel$TextInputType.NONE) {
            i10 = 0;
        } else {
            i10 = textInputChannel$TextInputType == TextInputChannel$TextInputType.MULTILINE ? IjkMediaPlayer.OnNativeInvokeListener.CTRL_WILL_TCP_OPEN : (textInputChannel$TextInputType == TextInputChannel$TextInputType.EMAIL_ADDRESS || textInputChannel$TextInputType == TextInputChannel$TextInputType.TWITTER) ? 33 : (textInputChannel$TextInputType == TextInputChannel$TextInputType.URL || textInputChannel$TextInputType == TextInputChannel$TextInputType.WEB_SEARCH) ? 17 : textInputChannel$TextInputType == TextInputChannel$TextInputType.VISIBLE_PASSWORD ? 145 : textInputChannel$TextInputType == TextInputChannel$TextInputType.NAME ? 97 : textInputChannel$TextInputType == TextInputChannel$TextInputType.POSTAL_ADDRESS ? 113 : 1;
            if (!l0Var.f25127a) {
                if (l0Var.f25128b) {
                    i10 |= 32768;
                }
                i11 = l0Var.f25129c ? 524416 : 524432;
                textInputChannel$TextCapitalization = TextInputChannel$TextCapitalization.CHARACTERS;
                textInputChannel$TextCapitalization2 = l0Var.f25132f;
                if (textInputChannel$TextCapitalization2 != textInputChannel$TextCapitalization) {
                    i10 |= 4096;
                } else if (textInputChannel$TextCapitalization2 == TextInputChannel$TextCapitalization.WORDS) {
                    i10 |= 8192;
                } else if (textInputChannel$TextCapitalization2 == TextInputChannel$TextCapitalization.SENTENCES) {
                    i10 |= 16384;
                }
            }
            i10 |= i11;
            textInputChannel$TextCapitalization = TextInputChannel$TextCapitalization.CHARACTERS;
            textInputChannel$TextCapitalization2 = l0Var.f25132f;
            if (textInputChannel$TextCapitalization2 != textInputChannel$TextCapitalization) {
            }
        }
        editorInfo.inputType = i10;
        editorInfo.imeOptions = 33554432;
        int i13 = Build.VERSION.SDK_INT;
        if (i13 >= 26 && !l0Var.f25130d) {
            editorInfo.imeOptions = 50331648;
        }
        Integer num = l0Var.inputAction;
        int iIntValue = num == null ? (131072 & i10) != 0 ? 1 : 6 : num.intValue();
        l0 l0Var2 = this.configuration;
        String str = l0Var2.actionLabel;
        if (str != null) {
            editorInfo.actionLabel = str;
            editorInfo.actionId = iIntValue;
        }
        editorInfo.imeOptions = iIntValue | editorInfo.imeOptions;
        String[] strArr = l0Var2.contentCommitMimeTypes;
        if (strArr != null) {
            t0.b.setContentMimeTypes(editorInfo, strArr);
        }
        if (i13 >= 34) {
            if (m0.a.d()) {
                t0.a.a(editorInfo);
            }
            if (editorInfo.extras == null) {
                editorInfo.extras = new Bundle();
            }
            editorInfo.extras.putBoolean("androidx.core.view.inputmethod.EditorInfoCompat.STYLUS_HANDWRITING_ENABLED", true);
        }
        d dVar = new d(view, this.f28170e.f28165b, this.f28169d, c0Var, this.f28171f, editorInfo);
        g gVar = this.f28171f;
        gVar.getClass();
        editorInfo.initialSelStart = Selection.getSelectionStart(gVar);
        g gVar2 = this.f28171f;
        gVar2.getClass();
        editorInfo.initialSelEnd = Selection.getSelectionEnd(gVar2);
        this.lastInputConnection = dVar;
        return dVar;
    }

    public final void e(SparseArray sparseArray) {
        l0 l0Var;
        k0 k0Var;
        k0 k0Var2;
        if (Build.VERSION.SDK_INT < 26 || (l0Var = this.configuration) == null || this.autofillConfiguration == null || (k0Var = l0Var.autofill) == null) {
            return;
        }
        HashMap map = new HashMap();
        for (int i10 = 0; i10 < sparseArray.size(); i10++) {
            l0 l0Var2 = this.autofillConfiguration.get(sparseArray.keyAt(i10));
            if (l0Var2 != null && (k0Var2 = l0Var2.autofill) != null) {
                String string = io.flutter.embedding.android.a.g(sparseArray.valueAt(i10)).getTextValue().toString();
                n0 n0Var = new n0(string.length(), string.length(), -1, -1, string);
                if (k0Var2.f25123a.equals(k0Var.f25123a)) {
                    this.f28171f.e(n0Var);
                } else {
                    map.put(k0Var2.f25123a, n0Var);
                }
            }
        }
        int i11 = this.f28170e.f28165b;
        p0 p0Var = this.f28169d;
        p0Var.getClass();
        String.valueOf(map.size());
        HashMap map2 = new HashMap();
        for (Map.Entry entry : map.entrySet()) {
            n0 n0Var2 = (n0) entry.getValue();
            map2.put((String) entry.getKey(), p0.b(n0Var2.f25139b, n0Var2.f25140c, -1, -1, n0Var2.f25138a));
        }
        p0Var.f25143a.invokeMethod("TextInputClient.updateEditingStateWithTag", Arrays.asList(Integer.valueOf(i11), map2));
    }

    public final void f(int i10) {
        l lVar = this.f28170e;
        TextInputPlugin$InputTarget$Type textInputPlugin$InputTarget$Type = lVar.f28164a;
        if ((textInputPlugin$InputTarget$Type == TextInputPlugin$InputTarget$Type.f28118c || textInputPlugin$InputTarget$Type == TextInputPlugin$InputTarget$Type.f28119d) && lVar.f28165b == i10) {
            this.f28170e = new l(TextInputPlugin$InputTarget$Type.f28116a, 0);
            k();
            View view = this.f28166a;
            IBinder applicationWindowToken = view.getApplicationWindowToken();
            InputMethodManager inputMethodManager = this.f28167b;
            inputMethodManager.hideSoftInputFromWindow(applicationWindowToken, 0);
            inputMethodManager.restartInput(view);
            this.f28172g = false;
        }
    }

    public final void g() {
        if (this.f28170e.f28164a == TextInputPlugin$InputTarget$Type.f28118c) {
            return;
        }
        this.f28171f.d(this);
        k();
        this.configuration = null;
        p(null);
        this.f28170e = new l(TextInputPlugin$InputTarget$Type.f28116a, 0);
        o();
        this.lastClientRect = null;
    }

    @Nullable
    public InputConnection getLastInputConnection() {
        return this.lastInputConnection;
    }

    public final void h() {
        this.f28173h.m();
        this.f28169d.setTextInputMethodHandler(null);
        k();
        this.f28171f.d(this);
        ImeSyncDeferringInsetsCallback imeSyncDeferringInsetsCallback = this.f28174i;
        if (imeSyncDeferringInsetsCallback != null) {
            imeSyncDeferringInsetsCallback.remove();
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:31:0x0088  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final boolean i(KeyEvent keyEvent) {
        InputConnection inputConnection;
        if (!this.f28167b.isAcceptingText() || (inputConnection = this.lastInputConnection) == null) {
            return false;
        }
        if (!(inputConnection instanceof d)) {
            return inputConnection.sendKeyEvent(keyEvent);
        }
        d dVar = (d) inputConnection;
        dVar.getClass();
        if (keyEvent.getAction() != 0) {
            return false;
        }
        if (keyEvent.getKeyCode() == 21) {
            return dVar.d(true, keyEvent.isShiftPressed());
        }
        if (keyEvent.getKeyCode() == 22) {
            return dVar.d(false, keyEvent.isShiftPressed());
        }
        if (keyEvent.getKeyCode() == 19) {
            return dVar.e(true, keyEvent.isShiftPressed());
        }
        if (keyEvent.getKeyCode() == 20) {
            return dVar.e(false, keyEvent.isShiftPressed());
        }
        if (keyEvent.getKeyCode() == 66 || keyEvent.getKeyCode() == 160) {
            EditorInfo editorInfo = dVar.f28126e;
            if ((editorInfo.inputType & 131072) == 0) {
                dVar.performEditorAction(editorInfo.imeOptions & 255);
            } else {
                g gVar = dVar.f28125d;
                int selectionStart = Selection.getSelectionStart(gVar);
                int selectionEnd = Selection.getSelectionEnd(gVar);
                int unicodeChar = keyEvent.getUnicodeChar();
                if (selectionStart < 0 || selectionEnd < 0 || unicodeChar == 0) {
                    return false;
                }
                int iMin = Math.min(selectionStart, selectionEnd);
                int iMax = Math.max(selectionStart, selectionEnd);
                dVar.beginBatchEdit();
                if (iMin != iMax) {
                    gVar.delete(iMin, iMax);
                }
                gVar.insert(iMin, (CharSequence) String.valueOf((char) unicodeChar));
                int i10 = iMin + 1;
                dVar.setSelection(i10, i10);
                dVar.endBatchEdit();
            }
        }
        return true;
    }

    public final void j() {
        if (this.f28170e.f28164a == TextInputPlugin$InputTarget$Type.f28118c) {
            this.f28176k = true;
        }
    }

    public final void k() {
        AutofillManager autofillManager;
        l0 l0Var;
        k0 k0Var;
        if (Build.VERSION.SDK_INT < 26 || (autofillManager = this.f28168c) == null || (l0Var = this.configuration) == null || (k0Var = l0Var.autofill) == null || this.autofillConfiguration == null) {
            return;
        }
        autofillManager.notifyViewExited(this.f28166a, k0Var.f25123a.hashCode());
    }

    public final void l(ViewStructure viewStructure) {
        Rect rect;
        if (Build.VERSION.SDK_INT < 26 || this.autofillConfiguration == null) {
            return;
        }
        String str = this.configuration.autofill.f25123a;
        AutofillId autofillId = viewStructure.getAutofillId();
        for (int i10 = 0; i10 < this.autofillConfiguration.size(); i10++) {
            int iKeyAt = this.autofillConfiguration.keyAt(i10);
            k0 k0Var = this.autofillConfiguration.valueAt(i10).autofill;
            if (k0Var != null) {
                viewStructure.addChildCount(1);
                ViewStructure viewStructureNewChild = viewStructure.newChild(i10);
                viewStructureNewChild.setAutofillId(autofillId, iKeyAt);
                String[] strArr = k0Var.f25124b;
                if (strArr.length > 0) {
                    viewStructureNewChild.setAutofillHints(strArr);
                }
                viewStructureNewChild.setAutofillType(1);
                viewStructureNewChild.setVisibility(0);
                String str2 = k0Var.f25126d;
                if (str2 != null) {
                    viewStructureNewChild.setHint(str2);
                }
                if (str.hashCode() != iKeyAt || (rect = this.lastClientRect) == null) {
                    viewStructureNewChild.setDimens(0, 0, 0, 0, 1, 1);
                    viewStructureNewChild.setAutofillValue(AutofillValue.forText(k0Var.f25125c.f25138a));
                } else {
                    viewStructureNewChild.setDimens(rect.left, rect.top, 0, 0, rect.width(), this.lastClientRect.height());
                    viewStructureNewChild.setAutofillValue(AutofillValue.forText(this.f28171f));
                }
            }
        }
    }

    public final void m(int i10, l0 l0Var) {
        k();
        this.configuration = l0Var;
        this.f28170e = new l(TextInputPlugin$InputTarget$Type.f28117b, i10);
        this.f28171f.d(this);
        k0 k0Var = l0Var.autofill;
        this.f28171f = new g(k0Var != null ? k0Var.f25125c : null, this.f28166a);
        p(l0Var);
        this.f28172g = true;
        o();
        this.lastClientRect = null;
        g gVar = this.f28171f;
        int i11 = gVar.f28138b;
        if (gVar.f28137a > 0) {
            gVar.f28140d.add(this);
        } else {
            gVar.f28139c.add(this);
        }
    }

    public final void n(View view) {
        m0 m0Var;
        l0 l0Var = this.configuration;
        InputMethodManager inputMethodManager = this.f28167b;
        if (l0Var != null && (m0Var = l0Var.f25133g) != null) {
            if (m0Var.f25134a == TextInputChannel$TextInputType.NONE) {
                k();
                inputMethodManager.hideSoftInputFromWindow(view.getApplicationWindowToken(), 0);
                return;
            }
        }
        view.requestFocus();
        inputMethodManager.showSoftInput(view, 0);
    }

    public final void o() {
        if (this.f28170e.f28164a == TextInputPlugin$InputTarget$Type.f28118c) {
            this.f28176k = false;
        }
    }

    public final void p(l0 l0Var) {
        if (Build.VERSION.SDK_INT < 26) {
            return;
        }
        if (l0Var == null || l0Var.autofill == null) {
            this.autofillConfiguration = null;
            return;
        }
        l0[] l0VarArr = l0Var.fields;
        SparseArray<l0> sparseArray = new SparseArray<>();
        this.autofillConfiguration = sparseArray;
        if (l0VarArr == null) {
            sparseArray.put(l0Var.autofill.f25123a.hashCode(), l0Var);
            return;
        }
        for (l0 l0Var2 : l0VarArr) {
            k0 k0Var = l0Var2.autofill;
            if (k0Var != null) {
                SparseArray<l0> sparseArray2 = this.autofillConfiguration;
                String str = k0Var.f25123a;
                sparseArray2.put(str.hashCode(), l0Var2);
                this.f28168c.notifyValueChanged(this.f28166a, str.hashCode(), AutofillValue.forText(k0Var.f25125c.f25138a));
            }
        }
    }
}
