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

Commit 84108cb6 authored by Haoran Zhang's avatar Haoran Zhang
Browse files

[Autofill Framework] Update some confusing save related debug logs

1. AutofillManagerServiceImpl#finishSessionLocked: While it's printing whether save is shown, it's logging a value that's rather confusing. For example "finishSessionLocked(): session finished on save? true" actually means session finished, save UI did not show.

2. AutofillManager#notifyViewVisibilityChangedLocked. Both save trigger id and dialog tracking id are using the exact same log "No more visible ids. Invisible = ", it's hard to differentiate which kind of views are becoming invisible.

3. Session#updateTrackedIdsLocked. Not sure why there is a "=>" between "trackedViews" and "fillableIds". A develper reading the log may think the framework is trying to update the "trackedViews" to be "fillableIds", which is not the case.

Bug: b/334165576
Test: atest CtsAutoFillServiceTestCases
Change-Id: I61e169b5a25dcc9b7b40a7a18c87644a83a2096b
parent f43c3308
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -4308,14 +4308,16 @@ public final class AutofillManager {

            if (mIsTrackedSaveView && mVisibleTrackedIds.isEmpty()) {
                if (sVerbose) {
                    Log.v(TAG, "No more visible ids. Invisible = " + mInvisibleTrackedIds);
                    Log.v(TAG, "No more visible tracked save ids. Invisible = "
                            + mInvisibleTrackedIds);
                }
                finishSessionLocked(/* commitReason= */ COMMIT_REASON_VIEW_CHANGED);

            }
            if (mVisibleDialogTrackedIds.isEmpty()) {
                if (sVerbose) {
                    Log.v(TAG, "No more visible ids. Invisible = " + mInvisibleDialogTrackedIds);
                    Log.v(TAG, "No more visible tracked fill dialog ids. Invisible = "
                            + mInvisibleDialogTrackedIds);
                }
                processNoVisibleTrackedAllViews();
            }
+4 −1
Original line number Diff line number Diff line
@@ -515,7 +515,10 @@ final class AutofillManagerServiceImpl
        }

        final boolean finished = saveResult.isRemoveSession();
        if (sVerbose) Slog.v(TAG, "finishSessionLocked(): session finished on save? " + finished);
        if (sVerbose) {
            Slog.v(TAG, "finishSessionLocked(): session finished? " + finished
                    + ", showing save UI? " + saveResult.isLogSaveShown());
        }

        if (finished) {
            session.removeFromServiceLocked();
+4 −3
Original line number Diff line number Diff line
@@ -5441,9 +5441,10 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState

        try {
            if (sVerbose) {
                Slog.v(TAG, "updateTrackedIdsLocked(): " + trackedViews + " => " + fillableIds
                        + " triggerId: " + saveTriggerId + " saveOnFinish:" + saveOnFinish
                        + " flags: " + flags + " hasSaveInfo: " + (saveInfo != null));
                Slog.v(TAG, "updateTrackedIdsLocked(): trackedViews: " + trackedViews
                        + " fillableIds: " + fillableIds + " triggerId: " + saveTriggerId
                        + " saveOnFinish:" + saveOnFinish + " flags: " + flags
                        + " hasSaveInfo: " + (saveInfo != null));
            }
            mClient.setTrackedViews(id, toArray(trackedViews), mSaveOnAllViewsInvisible,
                    saveOnFinish, toArray(fillableIds), saveTriggerId);