Merge "Update the strings for the autofill enable dialog" into oc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
0770f85cdc
@@ -8622,9 +8622,16 @@
|
|||||||
<string name="autofill_app">Autofill service</string>
|
<string name="autofill_app">Autofill service</string>
|
||||||
<!-- Keywords for the auto-fill feature. [CHAR LIMIT=NONE] -->
|
<!-- Keywords for the auto-fill feature. [CHAR LIMIT=NONE] -->
|
||||||
<string name="autofill_keywords">auto, fill, autofill</string>
|
<string name="autofill_keywords">auto, fill, autofill</string>
|
||||||
<!-- Title of the warning dialog for setting the auto-fill app. [CHAR_LIMIT=NONE] -->
|
|
||||||
|
<!-- Message of the warning dialog for setting the auto-fill app. [CHAR_LIMIT=NONE] -->
|
||||||
<string name="autofill_confirmation_message">
|
<string name="autofill_confirmation_message">
|
||||||
Make <xliff:g id="app_name">%1$s</xliff:g> your autofill app? <xliff:g id="app_name">%1$s</xliff:g> will be able to read your screen and fill fields in other apps.
|
<![CDATA[
|
||||||
|
<b>Make sure you trust this app</b>
|
||||||
|
<br/>
|
||||||
|
<br/>
|
||||||
|
<xliff:g id="app_name" example="Google Autofill">%1$s</xliff:g> uses what\'s on
|
||||||
|
your screen to determine what can be autofilled.
|
||||||
|
]]>
|
||||||
</string>
|
</string>
|
||||||
|
|
||||||
<!-- Name of setting for switching device theme [CHAR LIMIT=60] -->
|
<!-- Name of setting for switching device theme [CHAR LIMIT=60] -->
|
||||||
|
@@ -50,7 +50,7 @@ public abstract class DefaultAppPickerFragment extends RadioButtonPickerFragment
|
|||||||
@Override
|
@Override
|
||||||
public void onRadioButtonClicked(RadioButtonPreference selected) {
|
public void onRadioButtonClicked(RadioButtonPreference selected) {
|
||||||
final String selectedKey = selected.getKey();
|
final String selectedKey = selected.getKey();
|
||||||
final String confirmationMessage = getConfirmationMessage(getCandidate(selectedKey));
|
final CharSequence confirmationMessage = getConfirmationMessage(getCandidate(selectedKey));
|
||||||
final Activity activity = getActivity();
|
final Activity activity = getActivity();
|
||||||
if (TextUtils.isEmpty(confirmationMessage)) {
|
if (TextUtils.isEmpty(confirmationMessage)) {
|
||||||
super.onRadioButtonClicked(selected);
|
super.onRadioButtonClicked(selected);
|
||||||
@@ -74,7 +74,7 @@ public abstract class DefaultAppPickerFragment extends RadioButtonPickerFragment
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String getConfirmationMessage(CandidateInfo info) {
|
protected CharSequence getConfirmationMessage(CandidateInfo info) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,11 +91,11 @@ public abstract class DefaultAppPickerFragment extends RadioButtonPickerFragment
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static ConfirmationDialogFragment newInstance(DefaultAppPickerFragment parent,
|
public static ConfirmationDialogFragment newInstance(DefaultAppPickerFragment parent,
|
||||||
String key, String message) {
|
String key, CharSequence message) {
|
||||||
final ConfirmationDialogFragment fragment = new ConfirmationDialogFragment();
|
final ConfirmationDialogFragment fragment = new ConfirmationDialogFragment();
|
||||||
final Bundle argument = new Bundle();
|
final Bundle argument = new Bundle();
|
||||||
argument.putString(EXTRA_KEY, key);
|
argument.putString(EXTRA_KEY, key);
|
||||||
argument.putString(EXTRA_MESSAGE, message);
|
argument.putCharSequence(EXTRA_MESSAGE, message);
|
||||||
fragment.setArguments(argument);
|
fragment.setArguments(argument);
|
||||||
fragment.setTargetFragment(parent, 0);
|
fragment.setTargetFragment(parent, 0);
|
||||||
return fragment;
|
return fragment;
|
||||||
@@ -105,7 +105,7 @@ public abstract class DefaultAppPickerFragment extends RadioButtonPickerFragment
|
|||||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||||
final Bundle bundle = getArguments();
|
final Bundle bundle = getArguments();
|
||||||
final AlertDialog.Builder builder = new AlertDialog.Builder(getActivity())
|
final AlertDialog.Builder builder = new AlertDialog.Builder(getActivity())
|
||||||
.setMessage(bundle.getString(EXTRA_MESSAGE))
|
.setMessage(bundle.getCharSequence(EXTRA_MESSAGE))
|
||||||
.setPositiveButton(android.R.string.ok, this)
|
.setPositiveButton(android.R.string.ok, this)
|
||||||
.setNegativeButton(android.R.string.cancel, null);
|
.setNegativeButton(android.R.string.cancel, null);
|
||||||
return builder.create();
|
return builder.create();
|
||||||
|
@@ -24,6 +24,7 @@ import android.content.pm.ServiceInfo;
|
|||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
import android.service.autofill.AutofillService;
|
import android.service.autofill.AutofillService;
|
||||||
import android.service.autofill.AutofillServiceInfo;
|
import android.service.autofill.AutofillServiceInfo;
|
||||||
|
import android.text.Html;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
|
||||||
import com.android.internal.logging.nano.MetricsProto;
|
import com.android.internal.logging.nano.MetricsProto;
|
||||||
@@ -65,12 +66,14 @@ public class DefaultAutofillPicker extends DefaultAppPickerFragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String getConfirmationMessage(CandidateInfo appInfo) {
|
protected CharSequence getConfirmationMessage(CandidateInfo appInfo) {
|
||||||
if (appInfo == null) {
|
if (appInfo == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final CharSequence appName = appInfo.loadLabel();
|
final CharSequence appName = appInfo.loadLabel();
|
||||||
return getContext().getString(R.string.autofill_confirmation_message, appName);
|
final String message = getContext().getString(
|
||||||
|
R.string.autofill_confirmation_message, appName);
|
||||||
|
return Html.fromHtml(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Reference in New Issue
Block a user