diff --git a/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java b/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java index fe85db286fa80..20b2a74f5be58 100644 --- a/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java +++ b/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java @@ -766,12 +766,14 @@ final class AutofillManagerServiceImpl /** * Updates the last fill selection when an authentication was selected. */ - void setAuthenticationSelected(int sessionId, @Nullable Bundle clientState) { + void setAuthenticationSelected(int sessionId, @Nullable Bundle clientState, + int uiType) { synchronized (mLock) { if (isValidEventLocked("setAuthenticationSelected()", sessionId)) { mEventHistory.addEvent( new Event(Event.TYPE_AUTHENTICATION_SELECTED, null, clientState, null, null, - null, null, null, null, null, null)); + null, null, null, null, null, null, + NO_SAVE_UI_REASON_NONE, uiType)); } } } @@ -780,12 +782,13 @@ final class AutofillManagerServiceImpl * Updates the last fill selection when an dataset authentication was selected. */ void logDatasetAuthenticationSelected(@Nullable String selectedDataset, int sessionId, - @Nullable Bundle clientState) { + @Nullable Bundle clientState, int uiType) { synchronized (mLock) { if (isValidEventLocked("logDatasetAuthenticationSelected()", sessionId)) { mEventHistory.addEvent( new Event(Event.TYPE_DATASET_AUTHENTICATION_SELECTED, selectedDataset, - clientState, null, null, null, null, null, null, null, null)); + clientState, null, null, null, null, null, null, null, null, + NO_SAVE_UI_REASON_NONE, uiType)); } } } @@ -806,13 +809,13 @@ final class AutofillManagerServiceImpl * Updates the last fill response when a dataset was selected. */ void logDatasetSelected(@Nullable String selectedDataset, int sessionId, - @Nullable Bundle clientState, int presentationType) { + @Nullable Bundle clientState, int uiType) { synchronized (mLock) { if (isValidEventLocked("logDatasetSelected()", sessionId)) { mEventHistory.addEvent( new Event(Event.TYPE_DATASET_SELECTED, selectedDataset, clientState, null, null, null, null, null, null, null, null, NO_SAVE_UI_REASON_NONE, - presentationType)); + uiType)); } } } @@ -820,13 +823,13 @@ final class AutofillManagerServiceImpl /** * Updates the last fill response when a dataset is shown. */ - void logDatasetShown(int sessionId, @Nullable Bundle clientState, int presentationType) { + void logDatasetShown(int sessionId, @Nullable Bundle clientState, int uiType) { synchronized (mLock) { if (isValidEventLocked("logDatasetShown", sessionId)) { mEventHistory.addEvent( new Event(Event.TYPE_DATASETS_SHOWN, null, clientState, null, null, null, null, null, null, null, null, NO_SAVE_UI_REASON_NONE, - presentationType)); + uiType)); } } } diff --git a/services/autofill/java/com/android/server/autofill/Session.java b/services/autofill/java/com/android/server/autofill/Session.java index 0fe9f8f90cea5..262b883e75df5 100644 --- a/services/autofill/java/com/android/server/autofill/Session.java +++ b/services/autofill/java/com/android/server/autofill/Session.java @@ -1394,7 +1394,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState // AutoFillUiCallback @Override public void authenticate(int requestId, int datasetIndex, IntentSender intent, Bundle extras, - boolean authenticateInline) { + int uiType) { if (sDebug) { Slog.d(TAG, "authenticate(): requestId=" + requestId + "; datasetIdx=" + datasetIndex + "; intentSender=" + intent); @@ -1413,12 +1413,13 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState } } - mService.setAuthenticationSelected(id, mClientState); + mService.setAuthenticationSelected(id, mClientState, uiType); final int authenticationId = AutofillManager.makeAuthenticationId(requestId, datasetIndex); mHandler.sendMessage(obtainMessage( Session::startAuthentication, - this, authenticationId, intent, fillInIntent, authenticateInline)); + this, authenticationId, intent, fillInIntent, + /* authenticateInline= */ uiType == UI_TYPE_INLINE)); } // AutoFillUiCallback @@ -3450,7 +3451,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState public void authenticate(int requestId, int datasetIndex) { Session.this.authenticate(response.getRequestId(), datasetIndex, response.getAuthentication(), response.getClientState(), - /* authenticateInline= */ true); + UI_TYPE_INLINE); } @Override @@ -3990,7 +3991,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState } // ...or handle authentication. - mService.logDatasetAuthenticationSelected(dataset.getId(), id, mClientState); + mService.logDatasetAuthenticationSelected(dataset.getId(), id, mClientState, uiType); setViewStatesLocked(null, dataset, ViewState.STATE_WAITING_DATASET_AUTH, false); final Intent fillInIntent = createAuthFillInIntentLocked(requestId, mClientState); if (fillInIntent == null) { diff --git a/services/autofill/java/com/android/server/autofill/ui/AutoFillUI.java b/services/autofill/java/com/android/server/autofill/ui/AutoFillUI.java index e07f412045006..5f0f9a3f1577d 100644 --- a/services/autofill/java/com/android/server/autofill/ui/AutoFillUI.java +++ b/services/autofill/java/com/android/server/autofill/ui/AutoFillUI.java @@ -84,7 +84,7 @@ public final class AutoFillUI { public interface AutoFillUiCallback { void authenticate(int requestId, int datasetIndex, @NonNull IntentSender intent, - @Nullable Bundle extras, boolean authenticateInline); + @Nullable Bundle extras, int uiType); void fill(int requestId, int datasetIndex, @NonNull Dataset dataset, @FillEventHistory.Event.UiType int uiType); void save(); @@ -232,7 +232,7 @@ public final class AutoFillUI { mCallback.authenticate(response.getRequestId(), AutofillManager.AUTHENTICATION_ID_DATASET_ID_UNDEFINED, response.getAuthentication(), response.getClientState(), - /* authenticateInline= */ false); + UI_TYPE_MENU); } } @@ -419,7 +419,7 @@ public final class AutoFillUI { mCallback.authenticate(response.getRequestId(), AutofillManager.AUTHENTICATION_ID_DATASET_ID_UNDEFINED, response.getAuthentication(), response.getClientState(), - /* authenticateInline= */ false); + UI_TYPE_DIALOG); } }