summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Simranjit Kohli <simranjit@google.com> 2024-02-14 14:31:23 -0800
committer Simranjit Kohli <simranjit@google.com> 2024-02-16 04:52:07 +0000
commitb7ca92d021ebb3528266481412f2156855c1c3eb (patch)
treea8f163d4dec84fd0f8147a9f5f5016d2026699d7
parent6031b0b255b6b7ba6dd2d5a05361b8e7567ef33b (diff)
Autofill: Add logs for better debugging
Add logs to identify issues from logcat. BUG: 325318537 Test: build, logging only Change-Id: I014f3e02471a86b49f0cd24d5f92fdb788ec7832
-rw-r--r--core/java/android/view/autofill/AutofillManager.java2
-rw-r--r--services/autofill/java/com/android/server/autofill/Session.java16
2 files changed, 17 insertions, 1 deletions
diff --git a/core/java/android/view/autofill/AutofillManager.java b/core/java/android/view/autofill/AutofillManager.java
index bd9f5049321d..83683caa2ea8 100644
--- a/core/java/android/view/autofill/AutofillManager.java
+++ b/core/java/android/view/autofill/AutofillManager.java
@@ -2364,6 +2364,7 @@ public final class AutofillManager {
synchronized (mLock) {
if (!isActiveLocked()) {
+ Log.w(TAG, "onAuthenticationResult(): sessionId=" + mSessionId + " not active");
return;
}
mState = STATE_ACTIVE;
@@ -2380,6 +2381,7 @@ public final class AutofillManager {
}
if (data == null) {
// data is set to null when result is not RESULT_OK
+ Log.i(TAG, "onAuthenticationResult(): empty intent");
return;
}
diff --git a/services/autofill/java/com/android/server/autofill/Session.java b/services/autofill/java/com/android/server/autofill/Session.java
index d47245eb2272..5a3421799aae 100644
--- a/services/autofill/java/com/android/server/autofill/Session.java
+++ b/services/autofill/java/com/android/server/autofill/Session.java
@@ -2770,6 +2770,10 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
+ id + " destroyed");
return;
}
+ if (sDebug) {
+ Slog.d(TAG, "setAuthenticationResultLocked(): id= " + authenticationId
+ + ", data=" + data);
+ }
final int requestId = AutofillManager.getRequestIdFromAuthenticationId(authenticationId);
if (requestId == AUGMENTED_AUTOFILL_REQUEST_ID) {
setAuthenticationResultForAugmentedAutofillLocked(data, authenticationId);
@@ -2823,12 +2827,18 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
+ ", clientState=" + newClientState + ", authenticationId=" + authenticationId);
}
if (result instanceof FillResponse) {
+ if (sDebug) {
+ Slog.d(TAG, "setAuthenticationResultLocked(): received FillResponse from"
+ + " authentication flow");
+ }
logAuthenticationStatusLocked(requestId, MetricsEvent.AUTOFILL_AUTHENTICATED);
mPresentationStatsEventLogger.maybeSetAuthenticationResult(
AUTHENTICATION_RESULT_SUCCESS);
replaceResponseLocked(authenticatedResponse, (FillResponse) result, newClientState);
} else if (result instanceof GetCredentialResponse) {
- Slog.d(TAG, "Received GetCredentialResponse from authentication flow");
+ if (sDebug) {
+ Slog.d(TAG, "Received GetCredentialResponse from authentication flow");
+ }
boolean isCredmanCallbackInvoked = false;
if (Flags.autofillCredmanIntegration()) {
GetCredentialResponse response = (GetCredentialResponse) result;
@@ -2843,6 +2853,10 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
}
}
} else if (result instanceof Dataset) {
+ if (sDebug) {
+ Slog.d(TAG, "setAuthenticationResultLocked(): received Dataset from"
+ + " authentication flow");
+ }
if (datasetIdx != AutofillManager.AUTHENTICATION_ID_DATASET_ID_UNDEFINED) {
logAuthenticationStatusLocked(requestId,
MetricsEvent.AUTOFILL_DATASET_AUTHENTICATED);