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

Commit 887d3128 authored by Nithishraj Vallavaraj's avatar Nithishraj Vallavaraj Committed by Android (Google) Code Review
Browse files

Merge "Log verbose autofill logs with autofill tag" into main

parents c6734ad6 88d94ff9
Loading
Loading
Loading
Loading
+27 −20
Original line number Diff line number Diff line
@@ -910,6 +910,12 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
    // set if a session is not started.
    private static final String AUTOFILL_LOG_TAG = "View.Autofill";
    /**
     * The logging tag used by this class when logging verbose and chatty (high volume)
     * autofill-related messages.
     */
    private static final String AUTOFILL_CHATTY_LOG_TAG = "View.Autofill.Chatty";
    /**
     * The logging tag used by this class when logging content capture-related messages.
     */
@@ -8691,8 +8697,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
    @CallSuper
    protected void onFocusChanged(boolean gainFocus, @FocusDirection int direction,
            @Nullable Rect previouslyFocusedRect) {
        if (DBG) {
            Log.d(VIEW_LOG_TAG, "onFocusChanged() entered. gainFocus: "
        if (Log.isLoggable(AUTOFILL_CHATTY_LOG_TAG, Log.VERBOSE)) {
            Log.v(AUTOFILL_CHATTY_LOG_TAG, "onFocusChanged() entered. gainFocus: "
                    + gainFocus);
        }
        if (gainFocus) {
@@ -8760,8 +8766,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
        if (canNotifyAutofillEnterExitEvent()) {
            AutofillManager afm = getAutofillManager();
            if (afm != null) {
                if (DBG) {
                    Log.d(VIEW_LOG_TAG, this + " afm is not null");
                if (Log.isLoggable(AUTOFILL_CHATTY_LOG_TAG, Log.VERBOSE)) {
                    Log.v(AUTOFILL_CHATTY_LOG_TAG, this + " afm is not null");
                }
                if (enter) {
                    // We have not been laid out yet, hence cannot evaluate
@@ -8774,8 +8780,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
                    // animation beginning. On the time, the view is not visible
                    // to the user. And then as the animation progresses, the view
                    // becomes visible to the user.
                    if (DBG) {
                        Log.d(VIEW_LOG_TAG,
                    if (Log.isLoggable(AUTOFILL_CHATTY_LOG_TAG, Log.VERBOSE)) {
                        Log.v(AUTOFILL_CHATTY_LOG_TAG,
                                "notifyEnterOrExitForAutoFillIfNeeded:"
                                + " isLaidOut(): " + isLaidOut()
                                + " isVisibleToUser(): " + isVisibleToUser()
@@ -11007,28 +11013,28 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
    }
    private boolean isAutofillable() {
        if (DBG) {
            Log.d(VIEW_LOG_TAG, "isAutofillable() entered.");
        if (Log.isLoggable(AUTOFILL_CHATTY_LOG_TAG, Log.VERBOSE)) {
            Log.v(AUTOFILL_CHATTY_LOG_TAG, "isAutofillable() entered.");
        }
        if (getAutofillType() == AUTOFILL_TYPE_NONE) {
            if (DBG) {
                Log.d(VIEW_LOG_TAG, "getAutofillType() returns AUTOFILL_TYPE_NONE");
            if (Log.isLoggable(AUTOFILL_CHATTY_LOG_TAG, Log.VERBOSE)) {
                Log.v(AUTOFILL_CHATTY_LOG_TAG, "getAutofillType() returns AUTOFILL_TYPE_NONE");
            }
            return false;
        }
        final AutofillManager afm = getAutofillManager();
        if (afm == null) {
            if (DBG) {
                Log.d(VIEW_LOG_TAG, "AutofillManager is null");
            if (Log.isLoggable(AUTOFILL_CHATTY_LOG_TAG, Log.VERBOSE)) {
                Log.v(AUTOFILL_CHATTY_LOG_TAG, "AutofillManager is null");
            }
            return false;
        }
        // Check whether view is not part of an activity. If it's not, return false.
        if (getAutofillViewId() <= LAST_APP_AUTOFILL_ID) {
            if (DBG) {
                Log.d(VIEW_LOG_TAG, "getAutofillViewId()<=LAST_APP_AUTOFILL_ID");
            if (Log.isLoggable(AUTOFILL_CHATTY_LOG_TAG, Log.VERBOSE)) {
                Log.v(AUTOFILL_CHATTY_LOG_TAG, "getAutofillViewId()<=LAST_APP_AUTOFILL_ID");
            }
            return false;
        }
@@ -11039,8 +11045,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
        if ((isImportantForAutofill() && afm.isTriggerFillRequestOnFilteredImportantViewsEnabled())
                || (!isImportantForAutofill()
                    && afm.isTriggerFillRequestOnUnimportantViewEnabled())) {
            if (DBG) {
                Log.d(VIEW_LOG_TAG, "isImportantForAutofill(): " + isImportantForAutofill()
            if (Log.isLoggable(AUTOFILL_CHATTY_LOG_TAG, Log.VERBOSE)) {
                Log.v(AUTOFILL_CHATTY_LOG_TAG,
                        "isImportantForAutofill(): " + isImportantForAutofill()
                        + "afm.isAutofillable(): " + afm.isAutofillable(this));
            }
            return afm.isAutofillable(this) ? true : notifyAugmentedAutofillIfNeeded(afm);
@@ -11048,8 +11055,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
        // If the previous condition is not met, fall back to the previous way to trigger fill
        // request based on autofill importance instead.
        if (DBG) {
            Log.d(VIEW_LOG_TAG, "isImportantForAutofill(): " + isImportantForAutofill());
        if (Log.isLoggable(AUTOFILL_CHATTY_LOG_TAG, Log.VERBOSE)) {
            Log.v(AUTOFILL_CHATTY_LOG_TAG, "isImportantForAutofill(): " + isImportantForAutofill());
        }
        return isImportantForAutofill() ? true : notifyAugmentedAutofillIfNeeded(afm);
    }
@@ -11065,8 +11072,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
    /** @hide */
    public boolean canNotifyAutofillEnterExitEvent() {
        if (DBG) {
            Log.d(VIEW_LOG_TAG, "canNotifyAutofillEnterExitEvent() entered. "
        if (Log.isLoggable(AUTOFILL_CHATTY_LOG_TAG, Log.VERBOSE)) {
            Log.v(AUTOFILL_CHATTY_LOG_TAG, "canNotifyAutofillEnterExitEvent() entered. "
                    + " isAutofillable(): " + isAutofillable()
                    + " isAttachedToWindow(): " + isAttachedToWindow());
        }