diff --git a/core/java/android/service/autofill/AutofillService.java b/core/java/android/service/autofill/AutofillService.java index 2755e8e7bee19..1dcaef4476b76 100644 --- a/core/java/android/service/autofill/AutofillService.java +++ b/core/java/android/service/autofill/AutofillService.java @@ -306,7 +306,7 @@ import com.android.internal.os.SomeArgs; *
* private static String getCanonicalDomain(String domain) {
* InternetDomainName idn = InternetDomainName.from(domain);
- * while (!idn.isTopPrivateDomain() && idn != null) {
+ * while (idn != null && !idn.isTopPrivateDomain()) {
* idn = idn.parent();
* }
* return idn == null ? null : idn.toString();
@@ -314,8 +314,9 @@ import com.android.internal.os.SomeArgs;
*
*
* If the association between the web domain and app package cannot be verified through the steps - * above, the service can still autofill the app, but it should warn the user about the potential - * data leakage first, and askfor the user to confirm. For example, the service could: + * above, but the service thinks that it is appropriate to fill persisted credentials that are + * stored for the web domain, the service should warn the user about the potential data + * leakage first, and ask for the user to confirm. For example, the service could: * *
This same procedure could also be used when the autofillable data is contained inside an * {@code IFRAME}, in which case the WebView generates a new autofill context when a node inside - * the {@code IFRAME} is focused, which the root node containing the {@code IFRAME}'s {@code src} + * the {@code IFRAME} is focused, with the root node containing the {@code IFRAME}'s {@code src} * attribute on {@link android.app.assist.AssistStructure.ViewNode#getWebDomain()}. A typical and * legitimate use case for this scenario is a financial app that allows the user * to login on different bank accounts. For example, a financial app {@code my_financial_app} could