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

Commit 5b32ebe4 authored by Felipe Leme's avatar Felipe Leme
Browse files

Improved Autofill logging.

Test: manual verification
Bug: 73172668

Change-Id: I8c77f2a792f3195efa44f44a4c9888c355eaee3c
parent aacda9d2
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package android.app;

import static android.Manifest.permission.CONTROL_REMOTE_APP_TRANSITION_ANIMATIONS;

import static java.lang.Character.MIN_VALUE;

import android.annotation.CallSuper;
@@ -135,6 +136,7 @@ import java.io.PrintWriter;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;

@@ -1898,7 +1900,7 @@ public class Activity extends ContextThemeWrapper

        if (isFinishing()) {
            if (mAutoFillResetNeeded) {
                getAutofillManager().onActivityFinished();
                getAutofillManager().onActivityFinishing();
            } else if (mIntent != null
                    && mIntent.hasExtra(AutofillManager.EXTRA_RESTORE_SESSION_TOKEN)) {
                // Activity was launched when user tapped a link in the Autofill Save UI - since
@@ -7689,6 +7691,9 @@ public class Activity extends ContextThemeWrapper
                }
            }
        }
        if (android.view.autofill.Helper.sVerbose) {
            Log.v(TAG, "autofillClientGetViewVisibility(): " + Arrays.toString(visible));
        }
        return visible;
    }

+9 −4
Original line number Diff line number Diff line
@@ -1089,16 +1089,16 @@ public final class AutofillManager {
     *
     * @hide
     */
    public void onActivityFinished() {
    public void onActivityFinishing() {
        if (!hasAutofillFeature()) {
            return;
        }
        synchronized (mLock) {
            if (mSaveOnFinish) {
                if (sDebug) Log.d(TAG, "Committing session on finish() as requested by service");
                if (sDebug) Log.d(TAG, "onActivityFinishing(): calling commitLocked()");
                commitLocked();
            } else {
                if (sDebug) Log.d(TAG, "Cancelling session on finish() as requested by service");
                if (sDebug) Log.d(TAG, "onActivityFinishing(): calling cancelLocked()");
                cancelLocked();
            }
        }
@@ -1119,6 +1119,7 @@ public final class AutofillManager {
        if (!hasAutofillFeature()) {
            return;
        }
        if (sVerbose) Log.v(TAG, "commit() called by app");
        synchronized (mLock) {
            commitLocked();
        }
@@ -2332,6 +2333,7 @@ public final class AutofillManager {
                final boolean[] isVisible;

                if (client.autofillClientIsVisibleForAutofill()) {
                    if (sVerbose) Log.v(TAG, "client is visible, check tracked ids");
                    isVisible = client.autofillClientGetViewVisibility(trackedIds);
                } else {
                    // All false
@@ -2351,7 +2353,7 @@ public final class AutofillManager {
            }

            if (sVerbose) {
                Log.v(TAG, "TrackedViews(trackedIds=" + trackedIds + "): "
                Log.v(TAG, "TrackedViews(trackedIds=" + Arrays.toString(trackedIds) + "): "
                        + " mVisibleTrackedIds=" + mVisibleTrackedIds
                        + " mInvisibleTrackedIds=" + mInvisibleTrackedIds);
            }
@@ -2457,6 +2459,9 @@ public final class AutofillManager {
            }

            if (mVisibleTrackedIds == null) {
                if (sVerbose) {
                    Log.v(TAG, "onVisibleForAutofillChangedLocked(): no more visible ids");
                }
                finishSessionLocked();
            }
        }