Loading services/autofill/java/com/android/server/autofill/Session.java +24 −16 Original line number Diff line number Diff line Loading @@ -1559,9 +1559,18 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState Slog.e(TAG, "Error sending input show up notification", e); } } } // AutoFillUiCallback @Override public void requestFallbackFromFillDialog() { setFillDialogDisabled(); synchronized (mLock) { // stop to show fill dialog mSessionFlags.mFillDialogDisabled = true; if (mCurrentViewId == null) { return; } final ViewState currentView = mViewStates.get(mCurrentViewId); currentView.maybeCallOnFillReady(mFlags); } } Loading Loading @@ -3208,6 +3217,8 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState return; } final AutofillId[] ids = response.getFillDialogTriggerIds(); if (ids != null && ArrayUtils.contains(ids, filledId)) { if (requestShowFillDialog(response, filledId, filterText, flags)) { synchronized (mLock) { final ViewState currentView = mViewStates.get(mCurrentViewId); Loading @@ -3215,9 +3226,10 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState mService.logDatasetShown(id, mClientState, UI_TYPE_DIALOG); } return; } } else { setFillDialogDisabled(); } } if (response.supportsInlineSuggestions()) { synchronized (mLock) { Loading Loading @@ -3324,15 +3336,11 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState return false; } final AutofillId[] ids = response.getFillDialogTriggerIds(); if (ids == null || !ArrayUtils.contains(ids, filledId)) { return false; } final Drawable serviceIcon = getServiceIcon(); getUiForShowing().showFillDialog(filledId, response, filterText, mService.getServicePackageName(), mComponentName, serviceIcon, this); mService.getServicePackageName(), mComponentName, serviceIcon, this, id, mCompatMode); return true; } Loading services/autofill/java/com/android/server/autofill/ui/AutoFillUI.java +25 −2 Original line number Diff line number Diff line Loading @@ -97,6 +97,7 @@ public final class AutoFillUI { void dispatchUnhandledKey(AutofillId id, KeyEvent keyEvent); void cancelSession(); void requestShowSoftInput(AutofillId id); void requestFallbackFromFillDialog(); } public AutoFillUI(@NonNull Context context) { Loading Loading @@ -388,13 +389,19 @@ public final class AutoFillUI { public void showFillDialog(@NonNull AutofillId focusedId, @NonNull FillResponse response, @Nullable String filterText, @Nullable String servicePackageName, @NonNull ComponentName componentName, @Nullable Drawable serviceIcon, @NonNull AutoFillUiCallback callback) { @NonNull AutoFillUiCallback callback, int sessionId, boolean compatMode) { if (sVerbose) { Slog.v(TAG, "showFillDialog for " + componentName.toShortString() + ": " + response); } // TODO: enable LogMaker final LogMaker log = Helper .newLogMaker(MetricsEvent.AUTOFILL_FILL_UI, componentName, servicePackageName, sessionId, compatMode) .addTaggedData(MetricsEvent.FIELD_AUTOFILL_FILTERTEXT_LEN, filterText == null ? 0 : filterText.length()) .addTaggedData(MetricsEvent.FIELD_AUTOFILL_NUM_DATASETS, response.getDatasets() == null ? 0 : response.getDatasets().size()); mHandler.post(() -> { if (callback != mCallback) { Loading @@ -406,6 +413,7 @@ public final class AutoFillUI { mUiModeMgr.isNightMode(), new DialogFillUi.UiCallback() { @Override public void onResponsePicked(FillResponse response) { log(MetricsEvent.TYPE_DETAIL); hideFillDialogUiThread(callback); if (mCallback != null) { mCallback.authenticate(response.getRequestId(), Loading @@ -417,6 +425,7 @@ public final class AutoFillUI { @Override public void onDatasetPicked(Dataset dataset) { log(MetricsEvent.TYPE_ACTION); hideFillDialogUiThread(callback); if (mCallback != null) { final int datasetIndex = response.getDatasets().indexOf(dataset); Loading @@ -425,16 +434,30 @@ public final class AutoFillUI { } } @Override public void onDismissed() { log(MetricsEvent.TYPE_DISMISS); hideFillDialogUiThread(callback); callback.requestShowSoftInput(focusedId); } @Override public void onCanceled() { log(MetricsEvent.TYPE_CLOSE); hideFillDialogUiThread(callback); callback.requestShowSoftInput(focusedId); callback.requestFallbackFromFillDialog(); } @Override public void startIntentSender(IntentSender intentSender) { mCallback.startIntentSenderAndFinishSession(intentSender); } private void log(int type) { log.setType(type); mMetricsLogger.write(log); } }); }); } Loading services/autofill/java/com/android/server/autofill/ui/DialogFillUi.java +3 −1 Original line number Diff line number Diff line Loading @@ -81,6 +81,7 @@ final class DialogFillUi { interface UiCallback { void onResponsePicked(@NonNull FillResponse response); void onDatasetPicked(@NonNull Dataset dataset); void onDismissed(); void onCanceled(); void startIntentSender(IntentSender intentSender); } Loading Loading @@ -144,6 +145,7 @@ final class DialogFillUi { mDialog = new Dialog(mContext, mThemeId); mDialog.setContentView(decor); setDialogParamsAsBottomSheet(); mDialog.setOnCancelListener((d) -> mCallback.onCanceled()); show(); } Loading Loading @@ -220,7 +222,7 @@ final class DialogFillUi { final TextView noButton = decor.findViewById(R.id.autofill_dialog_no); // set "No thinks" by default noButton.setText(R.string.autofill_save_no); noButton.setOnClickListener((v) -> mCallback.onCanceled()); noButton.setOnClickListener((v) -> mCallback.onDismissed()); } private void setContinueButton(View decor, View.OnClickListener listener) { Loading Loading
services/autofill/java/com/android/server/autofill/Session.java +24 −16 Original line number Diff line number Diff line Loading @@ -1559,9 +1559,18 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState Slog.e(TAG, "Error sending input show up notification", e); } } } // AutoFillUiCallback @Override public void requestFallbackFromFillDialog() { setFillDialogDisabled(); synchronized (mLock) { // stop to show fill dialog mSessionFlags.mFillDialogDisabled = true; if (mCurrentViewId == null) { return; } final ViewState currentView = mViewStates.get(mCurrentViewId); currentView.maybeCallOnFillReady(mFlags); } } Loading Loading @@ -3208,6 +3217,8 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState return; } final AutofillId[] ids = response.getFillDialogTriggerIds(); if (ids != null && ArrayUtils.contains(ids, filledId)) { if (requestShowFillDialog(response, filledId, filterText, flags)) { synchronized (mLock) { final ViewState currentView = mViewStates.get(mCurrentViewId); Loading @@ -3215,9 +3226,10 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState mService.logDatasetShown(id, mClientState, UI_TYPE_DIALOG); } return; } } else { setFillDialogDisabled(); } } if (response.supportsInlineSuggestions()) { synchronized (mLock) { Loading Loading @@ -3324,15 +3336,11 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState return false; } final AutofillId[] ids = response.getFillDialogTriggerIds(); if (ids == null || !ArrayUtils.contains(ids, filledId)) { return false; } final Drawable serviceIcon = getServiceIcon(); getUiForShowing().showFillDialog(filledId, response, filterText, mService.getServicePackageName(), mComponentName, serviceIcon, this); mService.getServicePackageName(), mComponentName, serviceIcon, this, id, mCompatMode); return true; } Loading
services/autofill/java/com/android/server/autofill/ui/AutoFillUI.java +25 −2 Original line number Diff line number Diff line Loading @@ -97,6 +97,7 @@ public final class AutoFillUI { void dispatchUnhandledKey(AutofillId id, KeyEvent keyEvent); void cancelSession(); void requestShowSoftInput(AutofillId id); void requestFallbackFromFillDialog(); } public AutoFillUI(@NonNull Context context) { Loading Loading @@ -388,13 +389,19 @@ public final class AutoFillUI { public void showFillDialog(@NonNull AutofillId focusedId, @NonNull FillResponse response, @Nullable String filterText, @Nullable String servicePackageName, @NonNull ComponentName componentName, @Nullable Drawable serviceIcon, @NonNull AutoFillUiCallback callback) { @NonNull AutoFillUiCallback callback, int sessionId, boolean compatMode) { if (sVerbose) { Slog.v(TAG, "showFillDialog for " + componentName.toShortString() + ": " + response); } // TODO: enable LogMaker final LogMaker log = Helper .newLogMaker(MetricsEvent.AUTOFILL_FILL_UI, componentName, servicePackageName, sessionId, compatMode) .addTaggedData(MetricsEvent.FIELD_AUTOFILL_FILTERTEXT_LEN, filterText == null ? 0 : filterText.length()) .addTaggedData(MetricsEvent.FIELD_AUTOFILL_NUM_DATASETS, response.getDatasets() == null ? 0 : response.getDatasets().size()); mHandler.post(() -> { if (callback != mCallback) { Loading @@ -406,6 +413,7 @@ public final class AutoFillUI { mUiModeMgr.isNightMode(), new DialogFillUi.UiCallback() { @Override public void onResponsePicked(FillResponse response) { log(MetricsEvent.TYPE_DETAIL); hideFillDialogUiThread(callback); if (mCallback != null) { mCallback.authenticate(response.getRequestId(), Loading @@ -417,6 +425,7 @@ public final class AutoFillUI { @Override public void onDatasetPicked(Dataset dataset) { log(MetricsEvent.TYPE_ACTION); hideFillDialogUiThread(callback); if (mCallback != null) { final int datasetIndex = response.getDatasets().indexOf(dataset); Loading @@ -425,16 +434,30 @@ public final class AutoFillUI { } } @Override public void onDismissed() { log(MetricsEvent.TYPE_DISMISS); hideFillDialogUiThread(callback); callback.requestShowSoftInput(focusedId); } @Override public void onCanceled() { log(MetricsEvent.TYPE_CLOSE); hideFillDialogUiThread(callback); callback.requestShowSoftInput(focusedId); callback.requestFallbackFromFillDialog(); } @Override public void startIntentSender(IntentSender intentSender) { mCallback.startIntentSenderAndFinishSession(intentSender); } private void log(int type) { log.setType(type); mMetricsLogger.write(log); } }); }); } Loading
services/autofill/java/com/android/server/autofill/ui/DialogFillUi.java +3 −1 Original line number Diff line number Diff line Loading @@ -81,6 +81,7 @@ final class DialogFillUi { interface UiCallback { void onResponsePicked(@NonNull FillResponse response); void onDatasetPicked(@NonNull Dataset dataset); void onDismissed(); void onCanceled(); void startIntentSender(IntentSender intentSender); } Loading Loading @@ -144,6 +145,7 @@ final class DialogFillUi { mDialog = new Dialog(mContext, mThemeId); mDialog.setContentView(decor); setDialogParamsAsBottomSheet(); mDialog.setOnCancelListener((d) -> mCallback.onCanceled()); show(); } Loading Loading @@ -220,7 +222,7 @@ final class DialogFillUi { final TextView noButton = decor.findViewById(R.id.autofill_dialog_no); // set "No thinks" by default noButton.setText(R.string.autofill_save_no); noButton.setOnClickListener((v) -> mCallback.onCanceled()); noButton.setOnClickListener((v) -> mCallback.onDismissed()); } private void setContinueButton(View decor, View.OnClickListener listener) { Loading