Fix html injection in Autofill confirmation dialog

AutofillService can inject html in its label. The label will
be padded with line breaks which puts the warning off screen.
To fix the issue, disable html injection of the label.

Bug: 216117246
Test: Manual, check the label of the sample in
      the confirmation dialog
Change-Id: I244d8e9eadbacae6af615d1d2a5a99c86e4fa456
This commit is contained in:
TYM Tsai
2022-12-19 15:19:46 +08:00
parent 30783964b3
commit be9cb36c6e

View File

@@ -243,7 +243,7 @@ public class DefaultAutofillPicker extends DefaultAppPickerFragment {
} }
final CharSequence appName = appInfo.loadLabel(); final CharSequence appName = appInfo.loadLabel();
final String message = getContext().getString( final String message = getContext().getString(
R.string.autofill_confirmation_message, appName); R.string.autofill_confirmation_message, Html.escapeHtml(appName));
return Html.fromHtml(message); return Html.fromHtml(message);
} }