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

Commit ce8d4299 authored by Simranjit Kohli's avatar Simranjit Kohli Committed by Android (Google) Code Review
Browse files

Merge "Add logs for no synchronous autofill" into main

parents f43c3308 811d74ac
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -3010,16 +3010,34 @@ public final class AutofillManager {
                mLastAutofilledData.put(view.getAutofillId(), targetValue);
            }
            view.setAutofilled(true, hideHighlight);
            if (sDebug) {
                Log.d(TAG, "View " + view.getAutofillId() + " autofilled synchronously.");
            }
            try {
                mService.setViewAutofilled(mSessionId, view.getAutofillId(), mContext.getUserId());
            } catch (RemoteException e) {
                // The failure could be a consequence of something going wrong on the server side.
                // Do nothing here since it's just logging, but it's possible follow-up actions may
                // fail.
                Log.w(TAG, "Unable to log due to " + e);
            }
        } else {
            if (sDebug) {
                Log.d(TAG, "View " + view.getAutofillId() + " " + view.getClass().toString()
                        + " from " + view.getClass().getPackageName()
                        + " : didn't fill in synchronously. It may fill asynchronously.");
            }
        }
    }

    /**
     * Returns String with text "null" if the object is null, or the actual string represented by
     * the object.
     */
    private @NonNull String getString(Object obj) {
        return obj == null ? "null" : obj.toString();
    }

    private void onGetCredentialException(int sessionId, AutofillId id, String errorType,
            String errorMsg) {
        synchronized (mLock) {
+3 −0
Original line number Diff line number Diff line
@@ -14051,6 +14051,9 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
    @Override
    public void autofill(AutofillValue value) {
        if (android.view.autofill.Helper.sVerbose) {
            Log.v(LOG_TAG, "autofill() called on textview for id:" + getAutofillId());
        }
        if (!isTextAutofillable()) {
            Log.w(LOG_TAG, "cannot autofill non-editable TextView: " + this);
            return;