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

Commit 811d74ac authored by Simranjit Kohli's avatar Simranjit Kohli
Browse files

Add logs for no synchronous autofill

Add logs for when autofill doesn't fill in the views synchronously.

BUG: 238252288
Test: log only
Change-Id: I5fc51e3d56eb01b610f6ec7cb5757d4c47e23271
parent a1dcd5ae
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -2985,16 +2985,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;