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

Commit 9c8c4dfa authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Improved Autofill logging."

parents 72ec028b 5b32ebe4
Loading
Loading
Loading
Loading
+6 −1
Original line number Original line Diff line number Diff line
@@ -17,6 +17,7 @@
package android.app;
package android.app;


import static android.Manifest.permission.CONTROL_REMOTE_APP_TRANSITION_ANIMATIONS;
import static android.Manifest.permission.CONTROL_REMOTE_APP_TRANSITION_ANIMATIONS;

import static java.lang.Character.MIN_VALUE;
import static java.lang.Character.MIN_VALUE;


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


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


        if (isFinishing()) {
        if (isFinishing()) {
            if (mAutoFillResetNeeded) {
            if (mAutoFillResetNeeded) {
                getAutofillManager().onActivityFinished();
                getAutofillManager().onActivityFinishing();
            } else if (mIntent != null
            } else if (mIntent != null
                    && mIntent.hasExtra(AutofillManager.EXTRA_RESTORE_SESSION_TOKEN)) {
                    && mIntent.hasExtra(AutofillManager.EXTRA_RESTORE_SESSION_TOKEN)) {
                // Activity was launched when user tapped a link in the Autofill Save UI - since
                // 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;
        return visible;
    }
    }


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


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


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


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