Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 01f4f031 authored by Felipe Leme's avatar Felipe Leme
Browse files

Ignores Resources.NotFoundException when setting ViewStructure.setTestIdEntry().

Test: manual verification using com.facebook.katana
Fixes: 71695541

Change-Id: Idefc7d3799f2ef5525a5050d63ca29a19cab730a
parent 61823f3a
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -310,7 +310,6 @@ import java.util.Locale;
public class TextView extends View implements ViewTreeObserver.OnPreDrawListener {
    static final String LOG_TAG = "TextView";
    static final boolean DEBUG_EXTRACT = false;
    static final boolean DEBUG_AUTOFILL = false;
    private static final float[] TEMP_POSITION = new float[2];

    // Enum for the "typeface" XML parameter.
@@ -9463,7 +9462,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
        }
        final AutofillManager afm = mContext.getSystemService(AutofillManager.class);
        if (afm != null) {
            if (DEBUG_AUTOFILL) {
            if (android.view.autofill.Helper.sVerbose) {
                Log.v(LOG_TAG, "sendAfterTextChanged(): notify AFM for text=" + mText);
            }
            afm.notifyValueChanged(TextView.this);
@@ -10243,7 +10242,14 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
        if (forAutofill) {
            structure.setDataIsSensitive(!mSetFromXmlOrResourceId);
            if (mTextId != ResourceId.ID_NULL) {
                try {
                    structure.setTextIdEntry(getResources().getResourceEntryName(mTextId));
                } catch (Resources.NotFoundException e) {
                    if (android.view.autofill.Helper.sVerbose) {
                        Log.v(LOG_TAG, "onProvideAutofillStructure(): cannot set name for text id "
                                + mTextId + ": " + e.getMessage());
                    }
                }
            }
        }