Loading core/java/android/view/autofill/AutofillManager.java +40 −3 Original line number Diff line number Diff line Loading @@ -47,6 +47,7 @@ import android.os.SystemClock; import android.service.autofill.AutofillService; import android.service.autofill.FillEventHistory; import android.service.autofill.UserData; import android.text.TextUtils; import android.util.ArrayMap; import android.util.ArraySet; import android.util.DebugUtils; Loading @@ -61,6 +62,7 @@ import android.view.accessibility.AccessibilityManager; import android.view.accessibility.AccessibilityNodeInfo; import android.view.accessibility.AccessibilityNodeProvider; import android.view.accessibility.AccessibilityWindowInfo; import android.widget.EditText; import com.android.internal.annotations.GuardedBy; import com.android.internal.logging.MetricsLogger; Loading Loading @@ -1073,6 +1075,8 @@ public final class AutofillManager { } else if (sVerbose) { Log.v(TAG, "Ignoring visibility change on " + id + ": no tracked views"); } } else if (!virtual && isVisible) { startAutofillIfNeededLocked(view); } } } Loading Loading @@ -1238,10 +1242,12 @@ public final class AutofillManager { return; } if (!mEnabled || !isActiveLocked()) { if (!startAutofillIfNeededLocked(view)) { if (sVerbose) { Log.v(TAG, "notifyValueChanged(" + view.getAutofillId() + "): ignoring on state " + getStateAsStringLocked()); } } return; } Loading Loading @@ -1879,6 +1885,37 @@ public final class AutofillManager { } } @GuardedBy("mLock") private boolean startAutofillIfNeededLocked(View view) { if (mState == STATE_UNKNOWN && mSessionId == NO_SESSION && view instanceof EditText && !TextUtils.isEmpty(((EditText) view).getText()) && !view.isFocused() && view.isImportantForAutofill() && view.isLaidOut() && view.isVisibleToUser()) { ensureServiceClientAddedIfNeededLocked(); if (sVerbose) { Log.v(TAG, "startAutofillIfNeededLocked(): enabled=" + mEnabled); } if (mEnabled && !isClientDisablingEnterExitEvent()) { final AutofillId id = view.getAutofillId(); final AutofillValue value = view.getAutofillValue(); // Starts new session. startSessionLocked(id, /* bounds= */ null, /* value= */ null, /* flags= */ 0); // Updates value. updateSessionLocked(id, /* bounds= */ null, value, ACTION_VALUE_CHANGED, /* flags= */ 0); addEnteredIdLocked(id); return true; } } return false; } /** * Registers a {@link AutofillCallback} to receive autofill events. * Loading Loading
core/java/android/view/autofill/AutofillManager.java +40 −3 Original line number Diff line number Diff line Loading @@ -47,6 +47,7 @@ import android.os.SystemClock; import android.service.autofill.AutofillService; import android.service.autofill.FillEventHistory; import android.service.autofill.UserData; import android.text.TextUtils; import android.util.ArrayMap; import android.util.ArraySet; import android.util.DebugUtils; Loading @@ -61,6 +62,7 @@ import android.view.accessibility.AccessibilityManager; import android.view.accessibility.AccessibilityNodeInfo; import android.view.accessibility.AccessibilityNodeProvider; import android.view.accessibility.AccessibilityWindowInfo; import android.widget.EditText; import com.android.internal.annotations.GuardedBy; import com.android.internal.logging.MetricsLogger; Loading Loading @@ -1073,6 +1075,8 @@ public final class AutofillManager { } else if (sVerbose) { Log.v(TAG, "Ignoring visibility change on " + id + ": no tracked views"); } } else if (!virtual && isVisible) { startAutofillIfNeededLocked(view); } } } Loading Loading @@ -1238,10 +1242,12 @@ public final class AutofillManager { return; } if (!mEnabled || !isActiveLocked()) { if (!startAutofillIfNeededLocked(view)) { if (sVerbose) { Log.v(TAG, "notifyValueChanged(" + view.getAutofillId() + "): ignoring on state " + getStateAsStringLocked()); } } return; } Loading Loading @@ -1879,6 +1885,37 @@ public final class AutofillManager { } } @GuardedBy("mLock") private boolean startAutofillIfNeededLocked(View view) { if (mState == STATE_UNKNOWN && mSessionId == NO_SESSION && view instanceof EditText && !TextUtils.isEmpty(((EditText) view).getText()) && !view.isFocused() && view.isImportantForAutofill() && view.isLaidOut() && view.isVisibleToUser()) { ensureServiceClientAddedIfNeededLocked(); if (sVerbose) { Log.v(TAG, "startAutofillIfNeededLocked(): enabled=" + mEnabled); } if (mEnabled && !isClientDisablingEnterExitEvent()) { final AutofillId id = view.getAutofillId(); final AutofillValue value = view.getAutofillValue(); // Starts new session. startSessionLocked(id, /* bounds= */ null, /* value= */ null, /* flags= */ 0); // Updates value. updateSessionLocked(id, /* bounds= */ null, value, ACTION_VALUE_CHANGED, /* flags= */ 0); addEnteredIdLocked(id); return true; } } return false; } /** * Registers a {@link AutofillCallback} to receive autofill events. * Loading