Improved Autofill logging.

Test: manual verification
Bug: 73172668

Change-Id: I8c77f2a792f3195efa44f44a4c9888c355eaee3c
This commit is contained in:
Felipe Leme
2018-02-15 12:52:19 -08:00
parent aacda9d287
commit 5b32ebe4df
2 changed files with 15 additions and 5 deletions

View File

@@ -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;
}

View File

@@ -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();
}
}