diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index 459b48fc54236..ae28797c32aad 100644 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -4585,6 +4585,9 @@ Autofill options + + Contents can\u2019t be autofilled + Save to %1$s? diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index fa13fbf93267b..741115c6f1353 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -2874,6 +2874,7 @@ + diff --git a/services/autofill/java/com/android/server/autofill/Session.java b/services/autofill/java/com/android/server/autofill/Session.java index 801769cc42e12..b02db18a4c86e 100644 --- a/services/autofill/java/com/android/server/autofill/Session.java +++ b/services/autofill/java/com/android/server/autofill/Session.java @@ -56,6 +56,7 @@ import android.view.autofill.AutofillValue; import android.view.autofill.IAutoFillManagerClient; import android.view.autofill.IAutofillWindowPresenter; +import com.android.internal.R; import com.android.internal.annotations.GuardedBy; import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.nano.MetricsProto.MetricsEvent; @@ -181,6 +182,9 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState public void onFillRequestSuccess(@Nullable FillResponse response, @NonNull String servicePackageName) { if (response == null) { + if ((mFlags & FLAG_MANUAL_REQUEST) != 0) { + getUiForShowing().showError(R.string.autofill_error_cannot_autofill); + } // Nothing to be done, but need to notify client. notifyUnavailableToClient(); removeSelf(); 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 832ff9a4435c3..257256dc58e74 100644 --- a/services/autofill/java/com/android/server/autofill/ui/AutoFillUI.java +++ b/services/autofill/java/com/android/server/autofill/ui/AutoFillUI.java @@ -86,6 +86,13 @@ public final class AutoFillUI { }); } + /** + * Displays an error message to the user. + */ + public void showError(int resId) { + showError(mContext.getString(resId)); + } + /** * Displays an error message to the user. */