Merge "Add UI type on selected event" into tm-dev am: afdd611f6c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17937861 Change-Id: I410c3ead357194ed7a1fa043c371237336e494a2 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -805,12 +805,13 @@ final class AutofillManagerServiceImpl
|
|||||||
* Updates the last fill response when a dataset was selected.
|
* Updates the last fill response when a dataset was selected.
|
||||||
*/
|
*/
|
||||||
void logDatasetSelected(@Nullable String selectedDataset, int sessionId,
|
void logDatasetSelected(@Nullable String selectedDataset, int sessionId,
|
||||||
@Nullable Bundle clientState) {
|
@Nullable Bundle clientState, int presentationType) {
|
||||||
synchronized (mLock) {
|
synchronized (mLock) {
|
||||||
if (isValidEventLocked("logDatasetSelected()", sessionId)) {
|
if (isValidEventLocked("logDatasetSelected()", sessionId)) {
|
||||||
mEventHistory.addEvent(
|
mEventHistory.addEvent(
|
||||||
new Event(Event.TYPE_DATASET_SELECTED, selectedDataset, clientState, null,
|
new Event(Event.TYPE_DATASET_SELECTED, selectedDataset, clientState, null,
|
||||||
null, null, null, null, null, null, null));
|
null, null, null, null, null, null, null, NO_SAVE_UI_REASON_NONE,
|
||||||
|
presentationType));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import static android.service.autofill.AutofillService.EXTRA_FILL_RESPONSE;
|
|||||||
import static android.service.autofill.FillEventHistory.Event.UI_TYPE_DIALOG;
|
import static android.service.autofill.FillEventHistory.Event.UI_TYPE_DIALOG;
|
||||||
import static android.service.autofill.FillEventHistory.Event.UI_TYPE_INLINE;
|
import static android.service.autofill.FillEventHistory.Event.UI_TYPE_INLINE;
|
||||||
import static android.service.autofill.FillEventHistory.Event.UI_TYPE_MENU;
|
import static android.service.autofill.FillEventHistory.Event.UI_TYPE_MENU;
|
||||||
|
import static android.service.autofill.FillEventHistory.Event.UI_TYPE_UNKNOWN;
|
||||||
import static android.service.autofill.FillRequest.FLAG_MANUAL_REQUEST;
|
import static android.service.autofill.FillRequest.FLAG_MANUAL_REQUEST;
|
||||||
import static android.service.autofill.FillRequest.FLAG_PASSWORD_INPUT_TYPE;
|
import static android.service.autofill.FillRequest.FLAG_PASSWORD_INPUT_TYPE;
|
||||||
import static android.service.autofill.FillRequest.FLAG_SUPPORTS_FILL_DIALOG;
|
import static android.service.autofill.FillRequest.FLAG_SUPPORTS_FILL_DIALOG;
|
||||||
@@ -1406,7 +1407,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
|
|||||||
|
|
||||||
// AutoFillUiCallback
|
// AutoFillUiCallback
|
||||||
@Override
|
@Override
|
||||||
public void fill(int requestId, int datasetIndex, Dataset dataset) {
|
public void fill(int requestId, int datasetIndex, Dataset dataset, int uiType) {
|
||||||
synchronized (mLock) {
|
synchronized (mLock) {
|
||||||
if (mDestroyed) {
|
if (mDestroyed) {
|
||||||
Slog.w(TAG, "Call to Session#fill() rejected - session: "
|
Slog.w(TAG, "Call to Session#fill() rejected - session: "
|
||||||
@@ -1416,7 +1417,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
|
|||||||
}
|
}
|
||||||
mHandler.sendMessage(obtainMessage(
|
mHandler.sendMessage(obtainMessage(
|
||||||
Session::autoFill,
|
Session::autoFill,
|
||||||
this, requestId, datasetIndex, dataset, true));
|
this, requestId, datasetIndex, dataset, true, uiType));
|
||||||
}
|
}
|
||||||
|
|
||||||
// AutoFillUiCallback
|
// AutoFillUiCallback
|
||||||
@@ -1657,7 +1658,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
|
|||||||
if (!isAuthResultDatasetEphemeral(oldDataset, data)) {
|
if (!isAuthResultDatasetEphemeral(oldDataset, data)) {
|
||||||
authenticatedResponse.getDatasets().set(datasetIdx, dataset);
|
authenticatedResponse.getDatasets().set(datasetIdx, dataset);
|
||||||
}
|
}
|
||||||
autoFill(requestId, datasetIdx, dataset, false);
|
autoFill(requestId, datasetIdx, dataset, false, UI_TYPE_UNKNOWN);
|
||||||
} else {
|
} else {
|
||||||
Slog.w(TAG, "invalid index (" + datasetIdx + ") for authentication id "
|
Slog.w(TAG, "invalid index (" + datasetIdx + ") for authentication id "
|
||||||
+ authenticationId);
|
+ authenticationId);
|
||||||
@@ -3376,7 +3377,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
|
|||||||
new InlineFillUi.InlineSuggestionUiCallback() {
|
new InlineFillUi.InlineSuggestionUiCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void autofill(@NonNull Dataset dataset, int datasetIndex) {
|
public void autofill(@NonNull Dataset dataset, int datasetIndex) {
|
||||||
fill(response.getRequestId(), datasetIndex, dataset);
|
fill(response.getRequestId(), datasetIndex, dataset, UI_TYPE_INLINE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -3895,7 +3896,8 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
|
|||||||
return viewState;
|
return viewState;
|
||||||
}
|
}
|
||||||
|
|
||||||
void autoFill(int requestId, int datasetIndex, Dataset dataset, boolean generateEvent) {
|
void autoFill(int requestId, int datasetIndex, Dataset dataset, boolean generateEvent,
|
||||||
|
int uiType) {
|
||||||
if (sDebug) {
|
if (sDebug) {
|
||||||
Slog.d(TAG, "autoFill(): requestId=" + requestId + "; datasetIdx=" + datasetIndex
|
Slog.d(TAG, "autoFill(): requestId=" + requestId + "; datasetIdx=" + datasetIndex
|
||||||
+ "; dataset=" + dataset);
|
+ "; dataset=" + dataset);
|
||||||
@@ -3909,7 +3911,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
|
|||||||
// Autofill it directly...
|
// Autofill it directly...
|
||||||
if (dataset.getAuthentication() == null) {
|
if (dataset.getAuthentication() == null) {
|
||||||
if (generateEvent) {
|
if (generateEvent) {
|
||||||
mService.logDatasetSelected(dataset.getId(), id, mClientState);
|
mService.logDatasetSelected(dataset.getId(), id, mClientState, uiType);
|
||||||
}
|
}
|
||||||
if (mCurrentViewId != null) {
|
if (mCurrentViewId != null) {
|
||||||
mInlineSessionController.hideInlineSuggestionsUiLocked(mCurrentViewId);
|
mInlineSessionController.hideInlineSuggestionsUiLocked(mCurrentViewId);
|
||||||
|
|||||||
@@ -15,6 +15,9 @@
|
|||||||
*/
|
*/
|
||||||
package com.android.server.autofill.ui;
|
package com.android.server.autofill.ui;
|
||||||
|
|
||||||
|
import static android.service.autofill.FillEventHistory.Event.UI_TYPE_DIALOG;
|
||||||
|
import static android.service.autofill.FillEventHistory.Event.UI_TYPE_MENU;
|
||||||
|
|
||||||
import static com.android.server.autofill.Helper.sDebug;
|
import static com.android.server.autofill.Helper.sDebug;
|
||||||
import static com.android.server.autofill.Helper.sVerbose;
|
import static com.android.server.autofill.Helper.sVerbose;
|
||||||
|
|
||||||
@@ -31,6 +34,7 @@ import android.os.Handler;
|
|||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
import android.service.autofill.Dataset;
|
import android.service.autofill.Dataset;
|
||||||
|
import android.service.autofill.FillEventHistory;
|
||||||
import android.service.autofill.FillResponse;
|
import android.service.autofill.FillResponse;
|
||||||
import android.service.autofill.SaveInfo;
|
import android.service.autofill.SaveInfo;
|
||||||
import android.service.autofill.ValueFinder;
|
import android.service.autofill.ValueFinder;
|
||||||
@@ -81,7 +85,8 @@ public final class AutoFillUI {
|
|||||||
public interface AutoFillUiCallback {
|
public interface AutoFillUiCallback {
|
||||||
void authenticate(int requestId, int datasetIndex, @NonNull IntentSender intent,
|
void authenticate(int requestId, int datasetIndex, @NonNull IntentSender intent,
|
||||||
@Nullable Bundle extras, boolean authenticateInline);
|
@Nullable Bundle extras, boolean authenticateInline);
|
||||||
void fill(int requestId, int datasetIndex, @NonNull Dataset dataset);
|
void fill(int requestId, int datasetIndex, @NonNull Dataset dataset,
|
||||||
|
@FillEventHistory.Event.UiType int uiType);
|
||||||
void save();
|
void save();
|
||||||
void cancelSave();
|
void cancelSave();
|
||||||
void requestShowFillUi(AutofillId id, int width, int height,
|
void requestShowFillUi(AutofillId id, int width, int height,
|
||||||
@@ -236,7 +241,8 @@ public final class AutoFillUI {
|
|||||||
hideFillUiUiThread(callback, true);
|
hideFillUiUiThread(callback, true);
|
||||||
if (mCallback != null) {
|
if (mCallback != null) {
|
||||||
final int datasetIndex = response.getDatasets().indexOf(dataset);
|
final int datasetIndex = response.getDatasets().indexOf(dataset);
|
||||||
mCallback.fill(response.getRequestId(), datasetIndex, dataset);
|
mCallback.fill(response.getRequestId(), datasetIndex,
|
||||||
|
dataset, UI_TYPE_MENU);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -414,7 +420,8 @@ public final class AutoFillUI {
|
|||||||
hideFillDialogUiThread(callback);
|
hideFillDialogUiThread(callback);
|
||||||
if (mCallback != null) {
|
if (mCallback != null) {
|
||||||
final int datasetIndex = response.getDatasets().indexOf(dataset);
|
final int datasetIndex = response.getDatasets().indexOf(dataset);
|
||||||
mCallback.fill(response.getRequestId(), datasetIndex, dataset);
|
mCallback.fill(response.getRequestId(), datasetIndex, dataset,
|
||||||
|
UI_TYPE_DIALOG);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user