Snap for 8326520 from 763f9c5a98 to tm-release
Change-Id: I9f78bf5e6a048876953e390cc64f9793674a963e
This commit is contained in:
@@ -184,6 +184,19 @@
|
||||
<!-- Keywords for bluetooth pairing item [CHAR LIMIT=30] -->
|
||||
<string name="keywords_add_bt_device">bluetooth</string>
|
||||
|
||||
<!-- Connected devices settings. Title of the dialog to hint user to pair other ear of the hearing aid device. Shows when only one of the hearing aid device set is connected. [CHAR LIMIT=25] -->
|
||||
<string name="bluetooth_pair_other_ear_dialog_title">Pair your other ear</string>
|
||||
<!-- Connected devices settings. Message of the dialog to hint user to pair right ear of the hearing aid device. Shows when only left side of hearing aid device set is connected. [CHAR LIMIT=NONE] -->
|
||||
<string name="bluetooth_pair_other_ear_dialog_left_ear_message">Your left hearing aid is connected.\n\nTo pair the right one, make sure it\u2019s turned on and ready to pair.</string>
|
||||
<!-- Connected devices settings. Message of the dialog to hint user to pair other ear of the hearing aid device. Shows when only right side of the hearing aid device set is connected. [CHAR LIMIT=NONE] -->
|
||||
<string name="bluetooth_pair_other_ear_dialog_right_ear_message">Your right hearing aid is connected.\n\nTo pair the left one, make sure it\u2019s turned on and ready to pair.</string>
|
||||
<!-- Connected devices settings. Positive button of the dialog to help user to pair right ear of the hearing aid device. Dialog shows when only one of the hearing aid device set is connected. [CHAR LIMIT=20] -->
|
||||
<string name="bluetooth_pair_other_ear_dialog_right_ear_positive_button">Pair right ear</string>
|
||||
<!-- Connected devices settings. Positive button of the dialog to help user to pair left ear of the hearing aid device. Dialog shows when only one of the hearing aid device set is connected. [CHAR LIMIT=20] -->
|
||||
<string name="bluetooth_pair_other_ear_dialog_left_ear_positive_button">Pair left ear</string>
|
||||
|
||||
<!-- Title for related tools section. This section will list related tools below. [CHAR LIMIT=15] -->
|
||||
<string name="bluetooth_screen_related">Related</string>
|
||||
<!-- Bluetooth Visibility message. This message informs the user that their device is now visible to other bluetooth devices. [CHAR LIMIT=NONE] -->
|
||||
<string name="bluetooth_is_visible_message"><xliff:g id="device_name">%1$s</xliff:g> is visible to nearby devices while Bluetooth settings is open.</string>
|
||||
<!-- Bluetooth mac address message. This message shows the bluetooth mac address for this device. [CHAR LIMIT=120] -->
|
||||
@@ -5276,11 +5289,11 @@
|
||||
<!-- Title for the entry of the text reading options. [CHAR LIMIT=NONE] -->
|
||||
<string name="accessibility_text_reading_options_suggestion_title">Change how text displays</string>
|
||||
<!-- Subject for the mail content of the accessibility text reading preview. [CHAR LIMIT=NONE] -->
|
||||
<string name="accessibility_text_reading_preview_mail_subject">Email: Plans for time machine, v2</string>
|
||||
<string name="accessibility_text_reading_preview_mail_subject">Subject: Hot air balloon designs</string>
|
||||
<!-- Message for the mail content of the accessibility text reading preview. [CHAR LIMIT=NONE] -->
|
||||
<string name="accessibility_text_reading_preview_mail_from">From: bill@email.com</string>
|
||||
<string name="accessibility_text_reading_preview_mail_from">From: Bill</string>
|
||||
<!-- Content for the mail content of the accessibility text reading preview. [CHAR LIMIT=NONE] -->
|
||||
<string name="accessibility_text_reading_preview_mail_content">Good morning! Following up on our last conversation, I’d like to check in on the progress of your time machine development plan. Will you be able to have a prototype ready to demo at E3 this year?</string>
|
||||
<string name="accessibility_text_reading_preview_mail_content">Good morning!\n\nI just wanted to check how the designs are coming. Will they be ready before we start building the new balloons?</string>
|
||||
<!-- Title for the reset button of the accessibility text reading page to reset all preferences state. [CHAR LIMIT=NONE] -->
|
||||
<string name="accessibility_text_reading_reset_button_title">Reset</string>
|
||||
<!-- Title for the footer text to explain what option accessibility service does. [CHAR LIMIT=35] -->
|
||||
@@ -5633,10 +5646,20 @@
|
||||
<string name="accessibility_hearingaid_not_connected_summary">No hearing aids connected</string>
|
||||
<!-- Summary for the accessibility preference for hearing aid when adding new devices. [CHAR LIMIT=50] -->
|
||||
<string name="accessibility_hearingaid_adding_summary">Add hearing aids</string>
|
||||
<!-- Message to ask the user to make sure that their hearing aid devices are in pairing mode. [CHAR LIMIT=NONE] -->
|
||||
<string name="accessibility_hearingaid_pair_instructions_message">To pair your hearing aids, find and tap your device on the next screen. Make sure your hearing aids are in pairing mode.</string>
|
||||
<!-- Title of the pair instruction dialog. Dialog shows to ask the user to make sure that their hearing aid devices are in pairing mode. [CHAR LIMIT=25] -->
|
||||
<string name="accessibility_hearingaid_pair_instructions_title">Pair hearing aids</string>
|
||||
<!-- Message of the pair instruction dialog. Dialog shows to ask the user to make sure that their hearing aid devices are in pairing mode. [CHAR LIMIT=NONE] -->
|
||||
<string name="accessibility_hearingaid_pair_instructions_message">On the next screen, tap on your hearing aids. You may need to pair the left and right ears separately.\n\nMake sure your hearing aids are turned on and ready to pair.</string>
|
||||
<!-- Summary for the accessibility preference for hearing aid when there is an active device. [CHAR LIMIT=50] -->
|
||||
<string name="accessibility_hearingaid_active_device_summary"><xliff:g id="device_name">%1$s</xliff:g> active</string>
|
||||
<string name="accessibility_hearingaid_active_device_summary"><xliff:g id="device_name" example="GN Hearing Aids">%1$s</xliff:g> active</string>
|
||||
<!-- Summary for the accessibility preference for hearing aid when there is only left side active. [CHAR LIMIT=50] -->
|
||||
<string name="accessibility_hearingaid_left_side_device_summary"><xliff:g id="device_name" example="GN Hearing Aids">%1$s</xliff:g>, left only</string>
|
||||
<!-- Summary for the accessibility preference for hearing aid when there is only right side active. [CHAR LIMIT=50] -->
|
||||
<string name="accessibility_hearingaid_right_side_device_summary"><xliff:g id="device_name" example="GN Hearing Aids">%1$s</xliff:g>, right only</string>
|
||||
<!-- Summary for the accessibility preference for hearing aid when both left side and right side are active. [CHAR LIMIT=50] -->
|
||||
<string name="accessibility_hearingaid_left_and_right_side_device_summary"><xliff:g id="device_name" example="GN Hearing Aids">%1$s</xliff:g>, left and right</string>
|
||||
<!-- Summary for the accessibility preference for hearing aid when there are more than one set of devices are active. [CHAR LIMIT=50] -->
|
||||
<string name="accessibility_hearingaid_more_device_summary"><xliff:g id="device_name" example="GN Hearing Aids">%1$s</xliff:g> +1 more</string>
|
||||
<!-- Summary for the accessibility preference for hearing aid when there are saved devices. [CHAR LIMIT=50] -->
|
||||
<plurals name="show_number_hearingaid_count">
|
||||
<item quantity="one"><xliff:g id="number_device_count">%1$d</xliff:g> saved hearing aid</item>
|
||||
|
||||
@@ -500,10 +500,10 @@ public class MainClear extends InstrumentedFragment implements OnGlobalLayoutLis
|
||||
context.getSystemService(DevicePolicyManager.class);
|
||||
|
||||
if (userInfo.isManagedProfile()) {
|
||||
titleText.setText(devicePolicyManager.getString(
|
||||
titleText.setText(devicePolicyManager.getResources().getString(
|
||||
WORK_CATEGORY_HEADER, () -> getString(R.string.category_work)));
|
||||
} else {
|
||||
titleText.setText(devicePolicyManager.getString(
|
||||
titleText.setText(devicePolicyManager.getResources().getString(
|
||||
PERSONAL_CATEGORY_HEADER, () -> getString(R.string.category_personal)));
|
||||
}
|
||||
contents.addView(titleView);
|
||||
|
||||
@@ -54,7 +54,7 @@ public class RemoteBugreportActivity extends Activity {
|
||||
|
||||
if (notificationType == DevicePolicyManager.NOTIFICATION_BUGREPORT_ACCEPTED_NOT_FINISHED) {
|
||||
AlertDialog dialog = new AlertDialog.Builder(this)
|
||||
.setMessage(devicePolicyManager.getString(
|
||||
.setMessage(devicePolicyManager.getResources().getString(
|
||||
SHARING_REMOTE_BUGREPORT_MESSAGE,
|
||||
() -> getString(R.string.sharing_remote_bugreport_dialog_message)))
|
||||
.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
||||
@@ -85,9 +85,10 @@ public class RemoteBugreportActivity extends Activity {
|
||||
: SHARE_REMOTE_BUGREPORT_FINISHED_REQUEST_CONSENT;
|
||||
|
||||
AlertDialog dialog = new AlertDialog.Builder(this)
|
||||
.setTitle(devicePolicyManager.getString(SHARE_REMOTE_BUGREPORT_DIALOG_TITLE,
|
||||
.setTitle(devicePolicyManager.getResources().getString(
|
||||
SHARE_REMOTE_BUGREPORT_DIALOG_TITLE,
|
||||
() -> getString(R.string.share_remote_bugreport_dialog_title)))
|
||||
.setMessage(devicePolicyManager.getString(overrideMessageId,
|
||||
.setMessage(devicePolicyManager.getResources().getString(overrideMessageId,
|
||||
() -> getString(defaultMessageId)))
|
||||
.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
||||
@Override
|
||||
|
||||
@@ -389,10 +389,11 @@ public class TrustedCredentialsSettings extends InstrumentedFragment
|
||||
|
||||
final TextView title = (TextView) convertView.findViewById(android.R.id.title);
|
||||
if (getUserInfoByGroup(groupPosition).isManagedProfile()) {
|
||||
title.setText(mDevicePolicyManager.getString(WORK_CATEGORY_HEADER,
|
||||
title.setText(mDevicePolicyManager.getResources().getString(WORK_CATEGORY_HEADER,
|
||||
() -> getString(R.string.category_work)));
|
||||
} else {
|
||||
title.setText(mDevicePolicyManager.getString(PERSONAL_CATEGORY_HEADER,
|
||||
title.setText(mDevicePolicyManager.getResources().getString(
|
||||
PERSONAL_CATEGORY_HEADER,
|
||||
() -> getString(R.string.category_personal)));
|
||||
|
||||
}
|
||||
|
||||
@@ -199,7 +199,7 @@ public class AccountPreferenceController extends AbstractPreferenceController
|
||||
UserHandle.myUserId())) {
|
||||
final SearchIndexableRaw data = new SearchIndexableRaw(mContext);
|
||||
data.key = PREF_KEY_REMOVE_PROFILE;
|
||||
data.title = mDpm.getString(
|
||||
data.title = mDpm.getResources().getString(
|
||||
REMOVE_WORK_PROFILE,
|
||||
() -> res.getString(R.string.remove_managed_profile_label));
|
||||
data.screenTitle = screenTitle;
|
||||
@@ -207,7 +207,7 @@ public class AccountPreferenceController extends AbstractPreferenceController
|
||||
}
|
||||
final SearchIndexableRaw data = new SearchIndexableRaw(mContext);
|
||||
data.key = PREF_KEY_WORK_PROFILE_SETTING;
|
||||
data.title = mDpm.getString(MANAGED_PROFILE_SETTINGS_TITLE,
|
||||
data.title = mDpm.getResources().getString(MANAGED_PROFILE_SETTINGS_TITLE,
|
||||
() -> res.getString(R.string.managed_profile_settings_title));
|
||||
data.screenTitle = screenTitle;
|
||||
rawData.add(data);
|
||||
@@ -267,7 +267,7 @@ public class AccountPreferenceController extends AbstractPreferenceController
|
||||
new SubSettingLauncher(mContext)
|
||||
.setSourceMetricsCategory(metricsCategory)
|
||||
.setDestination(ManagedProfileSettings.class.getName())
|
||||
.setTitleText(mDpm.getString(MANAGED_PROFILE_SETTINGS_TITLE,
|
||||
.setTitleText(mDpm.getResources().getString(MANAGED_PROFILE_SETTINGS_TITLE,
|
||||
() -> mContext.getString(R.string.managed_profile_settings_title)))
|
||||
.setArguments(arguments)
|
||||
.launch();
|
||||
@@ -347,12 +347,12 @@ public class AccountPreferenceController extends AbstractPreferenceController
|
||||
} else if (userInfo.isManagedProfile()) {
|
||||
if (mType == ProfileSelectFragment.ProfileType.ALL) {
|
||||
preferenceGroup.setTitle(
|
||||
mDpm.getString(WORK_CATEGORY_HEADER,
|
||||
mDpm.getResources().getString(WORK_CATEGORY_HEADER,
|
||||
() -> mContext.getString(R.string.category_work)));
|
||||
final String workGroupSummary = getWorkGroupSummary(context, userInfo);
|
||||
preferenceGroup.setSummary(workGroupSummary);
|
||||
preferenceGroup.setContentDescription(
|
||||
mDpm.getString(ACCESSIBILITY_CATEGORY_WORK, () ->
|
||||
mDpm.getResources().getString(ACCESSIBILITY_CATEGORY_WORK, () ->
|
||||
mContext.getString(
|
||||
R.string.accessibility_category_work, workGroupSummary)));
|
||||
}
|
||||
@@ -363,10 +363,10 @@ public class AccountPreferenceController extends AbstractPreferenceController
|
||||
} else {
|
||||
if (mType == ProfileSelectFragment.ProfileType.ALL) {
|
||||
preferenceGroup.setTitle(
|
||||
mDpm.getString(PERSONAL_CATEGORY_HEADER,
|
||||
mDpm.getResources().getString(PERSONAL_CATEGORY_HEADER,
|
||||
() -> mContext.getString(R.string.category_personal)));
|
||||
preferenceGroup.setContentDescription(
|
||||
mDpm.getString(ACCESSIBILITY_CATEGORY_PERSONAL, () ->
|
||||
mDpm.getResources().getString(ACCESSIBILITY_CATEGORY_PERSONAL, () ->
|
||||
mContext.getString(R.string.accessibility_category_personal)));
|
||||
}
|
||||
}
|
||||
@@ -401,7 +401,7 @@ public class AccountPreferenceController extends AbstractPreferenceController
|
||||
mFragment.getPreferenceManager().getContext());
|
||||
preference.setKey(PREF_KEY_REMOVE_PROFILE);
|
||||
preference.setTitle(
|
||||
mDpm.getString(REMOVE_WORK_PROFILE,
|
||||
mDpm.getResources().getString(REMOVE_WORK_PROFILE,
|
||||
() -> mContext.getString(R.string.remove_managed_profile_label)));
|
||||
preference.setIcon(R.drawable.ic_delete);
|
||||
preference.setOnPreferenceClickListener(this);
|
||||
@@ -413,7 +413,7 @@ public class AccountPreferenceController extends AbstractPreferenceController
|
||||
private Preference newManagedProfileSettings() {
|
||||
Preference preference = new Preference(mFragment.getPreferenceManager().getContext());
|
||||
preference.setKey(PREF_KEY_WORK_PROFILE_SETTING);
|
||||
preference.setTitle(mDpm.getString(MANAGED_PROFILE_SETTINGS_TITLE,
|
||||
preference.setTitle(mDpm.getResources().getString(MANAGED_PROFILE_SETTINGS_TITLE,
|
||||
() -> mContext.getString(R.string.managed_profile_settings_title)));
|
||||
preference.setIcon(R.drawable.ic_settings_24dp);
|
||||
preference.setOnPreferenceClickListener(this);
|
||||
@@ -428,7 +428,7 @@ public class AccountPreferenceController extends AbstractPreferenceController
|
||||
return null;
|
||||
}
|
||||
CharSequence appLabel = packageManager.getApplicationLabel(adminApplicationInfo);
|
||||
return mDpm.getString(MANAGED_BY,
|
||||
return mDpm.getResources().getString(MANAGED_BY,
|
||||
() -> mContext.getString(R.string.managing_admin, appLabel), appLabel);
|
||||
}
|
||||
|
||||
@@ -508,7 +508,7 @@ public class AccountPreferenceController extends AbstractPreferenceController
|
||||
mProfileNotAvailablePreference.setIcon(R.drawable.empty_icon);
|
||||
mProfileNotAvailablePreference.setTitle(null);
|
||||
mProfileNotAvailablePreference.setSummary(
|
||||
mDpm.getString(
|
||||
mDpm.getResources().getString(
|
||||
WORK_PROFILE_NOT_AVAILABLE, () -> mContext.getString(
|
||||
R.string.managed_profile_not_available_label)));
|
||||
profileData.preferenceGroup.addPreference(mProfileNotAvailablePreference);
|
||||
|
||||
@@ -163,10 +163,11 @@ public class AccountSyncSettings extends AccountPreferenceBase {
|
||||
|
||||
String accessibilityTitle =
|
||||
isWorkProfile
|
||||
? devicePolicyManager.getString(ACCESSIBILITY_WORK_ACCOUNT_TITLE,
|
||||
? devicePolicyManager.getResources().getString(
|
||||
ACCESSIBILITY_WORK_ACCOUNT_TITLE,
|
||||
() -> getString(R.string.accessibility_work_account_title,
|
||||
currentTitle), currentTitle)
|
||||
: devicePolicyManager.getString(
|
||||
: devicePolicyManager.getResources().getString(
|
||||
ACCESSIBILITY_PERSONAL_ACCOUNT_TITLE,
|
||||
() -> getString(
|
||||
R.string.accessibility_personal_account_title,
|
||||
|
||||
@@ -217,6 +217,7 @@ public class RemoveAccountPreferenceController extends AbstractPreferenceControl
|
||||
return new AlertDialog.Builder(context)
|
||||
.setTitle(R.string.remove_account_label)
|
||||
.setMessage(getContext().getSystemService(DevicePolicyManager.class)
|
||||
.getResources()
|
||||
.getString(REMOVE_ACCOUNT_FAILED_ADMIN_RESTRICTION,
|
||||
() -> getString(R.string.remove_account_failed)))
|
||||
.setPositiveButton(android.R.string.ok, null)
|
||||
|
||||
@@ -87,13 +87,13 @@ public class WorkModePreferenceController extends BasePreferenceController imple
|
||||
@Override
|
||||
public CharSequence getSummary() {
|
||||
if (isChecked()) {
|
||||
return mDevicePolicyManager
|
||||
.getString(WORK_PROFILE_SETTING_ON_SUMMARY,
|
||||
() -> mContext.getString(R.string.work_mode_on_summary));
|
||||
return mDevicePolicyManager.getResources().getString(
|
||||
WORK_PROFILE_SETTING_ON_SUMMARY,
|
||||
() -> mContext.getString(R.string.work_mode_on_summary));
|
||||
}
|
||||
|
||||
return mDevicePolicyManager
|
||||
.getString(WORK_PROFILE_SETTING_OFF_SUMMARY,
|
||||
return mDevicePolicyManager.getResources().getString(
|
||||
WORK_PROFILE_SETTING_OFF_SUMMARY,
|
||||
() -> mContext.getString(R.string.work_mode_off_summary));
|
||||
}
|
||||
|
||||
|
||||
@@ -97,7 +97,8 @@ public class UsageAccessDetails extends AppInfoWithHeader implements OnPreferenc
|
||||
new AlertDialog.Builder(getContext())
|
||||
.setIcon(com.android.internal.R.drawable.ic_dialog_alert_material)
|
||||
.setTitle(android.R.string.dialog_alert_title)
|
||||
.setMessage(mDpm.getString(WORK_PROFILE_DISABLE_USAGE_ACCESS_WARNING,
|
||||
.setMessage(mDpm.getResources().getString(
|
||||
WORK_PROFILE_DISABLE_USAGE_ACCESS_WARNING,
|
||||
() -> getString(R.string.work_profile_usage_access_warning)))
|
||||
.setPositiveButton(R.string.okay, null)
|
||||
.show();
|
||||
|
||||
@@ -335,7 +335,7 @@ public class DeviceAdminAdd extends CollapsingToolbarBaseActivity {
|
||||
|
||||
// Build and show the simplified dialog
|
||||
final Dialog dialog = new AlertDialog.Builder(this)
|
||||
.setTitle(mDPM.getString(SET_PROFILE_OWNER_DIALOG_TITLE,
|
||||
.setTitle(mDPM.getResources().getString(SET_PROFILE_OWNER_DIALOG_TITLE,
|
||||
() -> getString(R.string.profile_owner_add_title_simplified)))
|
||||
.setView(R.layout.profile_owner_add)
|
||||
.setPositiveButton(R.string.allow, new DialogInterface.OnClickListener() {
|
||||
@@ -358,7 +358,7 @@ public class DeviceAdminAdd extends CollapsingToolbarBaseActivity {
|
||||
mAddMsg.setText(mAddMsgText);
|
||||
mAdminWarning = dialog.findViewById(R.id.admin_warning_simplified);
|
||||
mAdminWarning.setText(
|
||||
mDPM.getString(NEW_DEVICE_ADMIN_WARNING_SIMPLIFIED, () ->
|
||||
mDPM.getResources().getString(NEW_DEVICE_ADMIN_WARNING_SIMPLIFIED, () ->
|
||||
getString(R.string.device_admin_warning_simplified,
|
||||
mProfileOwnerName), mProfileOwnerName));
|
||||
return;
|
||||
@@ -371,7 +371,7 @@ public class DeviceAdminAdd extends CollapsingToolbarBaseActivity {
|
||||
mProfileOwnerWarning = (TextView) findViewById(R.id.profile_owner_warning);
|
||||
|
||||
mProfileOwnerWarning.setText(
|
||||
mDPM.getString(SET_PROFILE_OWNER_POSTSETUP_WARNING,
|
||||
mDPM.getResources().getString(SET_PROFILE_OWNER_POSTSETUP_WARNING,
|
||||
() -> getString(R.string.adding_profile_owner_warning)));
|
||||
|
||||
mAddMsg = (TextView)findViewById(R.id.add_msg);
|
||||
@@ -419,7 +419,7 @@ public class DeviceAdminAdd extends CollapsingToolbarBaseActivity {
|
||||
});
|
||||
|
||||
mUninstallButton = (Button) findViewById(R.id.uninstall_button);
|
||||
mUninstallButton.setText(mDPM.getString(UNINSTALL_DEVICE_ADMIN,
|
||||
mUninstallButton.setText(mDPM.getResources().getString(UNINSTALL_DEVICE_ADMIN,
|
||||
() -> getString(R.string.uninstall_device_admin)));
|
||||
mUninstallButton.setFilterTouchesWhenObscured(true);
|
||||
mUninstallButton.setOnClickListener(new View.OnClickListener() {
|
||||
@@ -681,9 +681,10 @@ public class DeviceAdminAdd extends CollapsingToolbarBaseActivity {
|
||||
final boolean isManagedProfile = isManagedProfile(mDeviceAdmin);
|
||||
if (isProfileOwner && isManagedProfile) {
|
||||
// Profile owner in a managed profile, user can remove profile to disable admin.
|
||||
mAdminWarning.setText(mDPM.getString(WORK_PROFILE_ADMIN_POLICIES_WARNING,
|
||||
mAdminWarning.setText(mDPM.getResources().getString(
|
||||
WORK_PROFILE_ADMIN_POLICIES_WARNING,
|
||||
() -> getString(R.string.admin_profile_owner_message)));
|
||||
mActionButton.setText(mDPM.getString(REMOVE_WORK_PROFILE,
|
||||
mActionButton.setText(mDPM.getResources().getString(REMOVE_WORK_PROFILE,
|
||||
() -> getString(R.string.remove_managed_profile_label)));
|
||||
|
||||
final EnforcedAdmin admin = getAdminEnforcingCantRemoveProfile();
|
||||
@@ -698,32 +699,34 @@ public class DeviceAdminAdd extends CollapsingToolbarBaseActivity {
|
||||
// Profile owner in a user or device owner, user can't disable admin.
|
||||
if (isProfileOwner) {
|
||||
// Show profile owner in a user description.
|
||||
mAdminWarning.setText(mDPM.getString(USER_ADMIN_POLICIES_WARNING,
|
||||
mAdminWarning.setText(mDPM.getResources().getString(USER_ADMIN_POLICIES_WARNING,
|
||||
() -> getString(R.string.admin_profile_owner_user_message)));
|
||||
} else {
|
||||
// Show device owner description.
|
||||
if (isFinancedDevice()) {
|
||||
mAdminWarning.setText(R.string.admin_financed_message);
|
||||
} else {
|
||||
mAdminWarning.setText(mDPM.getString(DEVICE_ADMIN_POLICIES_WARNING,
|
||||
mAdminWarning.setText(mDPM.getResources().getString(
|
||||
DEVICE_ADMIN_POLICIES_WARNING,
|
||||
() -> getString(R.string.admin_device_owner_message)));
|
||||
}
|
||||
}
|
||||
mActionButton.setText(mDPM.getString(REMOVE_DEVICE_ADMIN,
|
||||
mActionButton.setText(mDPM.getResources().getString(REMOVE_DEVICE_ADMIN,
|
||||
() -> getString(R.string.remove_device_admin)));
|
||||
mActionButton.setEnabled(false);
|
||||
} else {
|
||||
addDeviceAdminPolicies(false /* showDescription */);
|
||||
CharSequence label = mDeviceAdmin.getActivityInfo().applicationInfo.loadLabel(
|
||||
getPackageManager());
|
||||
mAdminWarning.setText(mDPM.getString(ACTIVE_DEVICE_ADMIN_WARNING,
|
||||
mAdminWarning.setText(mDPM.getResources().getString(ACTIVE_DEVICE_ADMIN_WARNING,
|
||||
() -> getString(R.string.device_admin_status, label), label));
|
||||
setTitle(R.string.active_device_admin_msg);
|
||||
if (mUninstalling) {
|
||||
mActionButton.setText(mDPM.getString(REMOVE_AND_UNINSTALL_DEVICE_ADMIN,
|
||||
mActionButton.setText(mDPM.getResources().getString(
|
||||
REMOVE_AND_UNINSTALL_DEVICE_ADMIN,
|
||||
() -> getString(R.string.remove_and_uninstall_device_admin)));
|
||||
} else {
|
||||
mActionButton.setText(mDPM.getString(REMOVE_DEVICE_ADMIN,
|
||||
mActionButton.setText(mDPM.getResources().getString(REMOVE_DEVICE_ADMIN,
|
||||
() -> getString(R.string.remove_device_admin)));
|
||||
}
|
||||
}
|
||||
@@ -740,12 +743,12 @@ public class DeviceAdminAdd extends CollapsingToolbarBaseActivity {
|
||||
CharSequence label = mDeviceAdmin.getActivityInfo()
|
||||
.applicationInfo.loadLabel(getPackageManager());
|
||||
mAdminWarning.setText(
|
||||
mDPM.getString(NEW_DEVICE_ADMIN_WARNING, () ->
|
||||
mDPM.getResources().getString(NEW_DEVICE_ADMIN_WARNING, () ->
|
||||
getString(R.string.device_admin_warning, label
|
||||
), label));
|
||||
setTitle(mDPM.getString(ACTIVATE_DEVICE_ADMIN_APP,
|
||||
setTitle(mDPM.getResources().getString(ACTIVATE_DEVICE_ADMIN_APP,
|
||||
() -> getString(R.string.add_device_admin_msg)));
|
||||
mActionButton.setText(mDPM.getString(ACTIVATE_THIS_DEVICE_ADMIN_APP,
|
||||
mActionButton.setText(mDPM.getResources().getString(ACTIVATE_THIS_DEVICE_ADMIN_APP,
|
||||
() -> getString(R.string.add_device_admin)));
|
||||
if (isAdminUninstallable()) {
|
||||
mUninstallButton.setVisibility(View.VISIBLE);
|
||||
|
||||
@@ -156,7 +156,7 @@ public class InteractAcrossProfilesDetails extends AppInfoBase
|
||||
}
|
||||
|
||||
preference.setSummary(
|
||||
mDevicePolicyManager.getString(overrideKey,
|
||||
mDevicePolicyManager.getResources().getString(overrideKey,
|
||||
() -> getString(resource)));
|
||||
}
|
||||
|
||||
@@ -296,19 +296,20 @@ public class InteractAcrossProfilesDetails extends AppInfoBase
|
||||
|
||||
final TextView dialogTitle = dialogView.findViewById(
|
||||
R.id.interact_across_profiles_consent_dialog_title);
|
||||
dialogTitle.setText(mDpm.getString(CONNECT_APPS_DIALOG_TITLE, () ->
|
||||
dialogTitle.setText(mDpm.getResources().getString(CONNECT_APPS_DIALOG_TITLE, () ->
|
||||
getString(R.string.interact_across_profiles_consent_dialog_title, mAppLabel),
|
||||
mAppLabel));
|
||||
|
||||
final TextView appDataSummary = dialogView.findViewById(R.id.app_data_summary);
|
||||
appDataSummary.setText(
|
||||
mDpm.getString(APP_CAN_ACCESS_PERSONAL_DATA,
|
||||
mDpm.getResources().getString(APP_CAN_ACCESS_PERSONAL_DATA,
|
||||
() -> getString(
|
||||
R.string.interact_across_profiles_consent_dialog_app_data_summary,
|
||||
mAppLabel), mAppLabel));
|
||||
|
||||
final TextView permissionsSummary = dialogView.findViewById(R.id.permissions_summary);
|
||||
permissionsSummary.setText(mDpm.getString(APP_CAN_ACCESS_PERSONAL_PERMISSIONS,
|
||||
permissionsSummary.setText(mDpm.getResources().getString(
|
||||
APP_CAN_ACCESS_PERSONAL_PERMISSIONS,
|
||||
() -> getString(
|
||||
R.string.interact_across_profiles_consent_dialog_permissions_summary,
|
||||
mAppLabel),
|
||||
@@ -316,7 +317,7 @@ public class InteractAcrossProfilesDetails extends AppInfoBase
|
||||
|
||||
final TextView dialogSummary =
|
||||
dialogView.findViewById(R.id.interact_across_profiles_consent_dialog_summary);
|
||||
dialogSummary.setText(mDpm.getString(CONNECT_APPS_DIALOG_SUMMARY,
|
||||
dialogSummary.setText(mDpm.getResources().getString(CONNECT_APPS_DIALOG_SUMMARY,
|
||||
() -> getString(
|
||||
R.string.interact_across_profiles_consent_dialog_summary)));
|
||||
|
||||
@@ -445,7 +446,7 @@ public class InteractAcrossProfilesDetails extends AppInfoBase
|
||||
}
|
||||
if (!mInstalledInPersonal) {
|
||||
mInstallBanner.setTitle(
|
||||
mDpm.getString(INSTALL_IN_PERSONAL_PROFILE_TO_CONNECT_PROMPT,
|
||||
mDpm.getResources().getString(INSTALL_IN_PERSONAL_PROFILE_TO_CONNECT_PROMPT,
|
||||
() -> getString(
|
||||
R.string.interact_across_profiles_install_personal_app_title,
|
||||
mAppLabel),
|
||||
@@ -459,7 +460,7 @@ public class InteractAcrossProfilesDetails extends AppInfoBase
|
||||
}
|
||||
if (!mInstalledInWork) {
|
||||
mInstallBanner.setTitle(
|
||||
mDpm.getString(INSTALL_IN_WORK_PROFILE_TO_CONNECT_PROMPT,
|
||||
mDpm.getResources().getString(INSTALL_IN_WORK_PROFILE_TO_CONNECT_PROMPT,
|
||||
() -> getString(
|
||||
R.string.interact_across_profiles_install_work_app_title,
|
||||
mAppLabel),
|
||||
|
||||
@@ -95,7 +95,8 @@ public class InteractAcrossProfilesSettings extends EmptyTextSettings {
|
||||
@Override
|
||||
public boolean onPreferenceClick(Preference preference) {
|
||||
AppInfoBase.startAppInfoFragment(InteractAcrossProfilesDetails.class,
|
||||
mDevicePolicyManager.getString(CONNECTED_WORK_AND_PERSONAL_APPS_TITLE,
|
||||
mDevicePolicyManager.getResources().getString(
|
||||
CONNECTED_WORK_AND_PERSONAL_APPS_TITLE,
|
||||
() -> getString(R.string.interact_across_profiles_title)),
|
||||
packageName,
|
||||
appInfo.uid,
|
||||
|
||||
@@ -225,7 +225,7 @@ public class FaceEnrollIntroduction extends BiometricEnrollIntroduction {
|
||||
@Override
|
||||
protected String getDescriptionDisabledByAdmin() {
|
||||
DevicePolicyManager devicePolicyManager = getSystemService(DevicePolicyManager.class);
|
||||
return devicePolicyManager.getString(
|
||||
return devicePolicyManager.getResources().getString(
|
||||
FACE_UNLOCK_DISABLED,
|
||||
() -> getString(R.string.security_settings_face_enroll_introduction_message_unlock_disabled));
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ public class FaceProfileStatusPreferenceController extends FaceStatusPreferenceC
|
||||
super.updateState(preference);
|
||||
|
||||
preference.setTitle(
|
||||
mDevicePolicyManager.getString(FACE_SETTINGS_FOR_WORK_TITLE, () ->
|
||||
mDevicePolicyManager.getResources().getString(FACE_SETTINGS_FOR_WORK_TITLE, () ->
|
||||
mContext.getResources().getString(
|
||||
R.string.security_settings_face_profile_preference_title)));
|
||||
}
|
||||
|
||||
@@ -162,9 +162,9 @@ public class FaceSettings extends DashboardFragment {
|
||||
|
||||
if (mUserManager.getUserInfo(mUserId).isManagedProfile()) {
|
||||
getActivity().setTitle(
|
||||
mDevicePolicyManager.getString(FACE_SETTINGS_FOR_WORK_TITLE, () ->
|
||||
getActivity().getResources().getString(
|
||||
R.string.security_settings_face_profile_preference_title)));
|
||||
mDevicePolicyManager.getResources().getString(FACE_SETTINGS_FOR_WORK_TITLE,
|
||||
() -> getActivity().getResources().getString(
|
||||
R.string.security_settings_face_profile_preference_title)));
|
||||
}
|
||||
|
||||
mLockscreenController = Utils.isMultipleBiometricsSupported(context)
|
||||
|
||||
@@ -186,7 +186,7 @@ public class FingerprintEnrollIntroduction extends BiometricEnrollIntroduction {
|
||||
|
||||
@Override
|
||||
protected String getDescriptionDisabledByAdmin() {
|
||||
return mDevicePolicyManager.getString(
|
||||
return mDevicePolicyManager.getResources().getString(
|
||||
FINGERPRINT_UNLOCK_DISABLED,
|
||||
() -> getString(R.string.security_settings_fingerprint_enroll_introduction_message_unlock_disabled));
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ package com.android.settings.biometrics.fingerprint;
|
||||
|
||||
import static android.app.admin.DevicePolicyResources.Strings.Settings.FINGERPRINT_UNLOCK_DISABLED_EXPLANATION;
|
||||
import static android.app.admin.DevicePolicyResources.Strings.Settings.WORK_PROFILE_FINGERPRINT_LAST_DELETE_MESSAGE;
|
||||
import static android.app.admin.DevicePolicyResources.Strings.UNDEFINED;
|
||||
import static android.app.admin.DevicePolicyResources.UNDEFINED;
|
||||
|
||||
import static com.android.settings.Utils.SETTINGS_PACKAGE_NAME;
|
||||
|
||||
@@ -366,7 +366,7 @@ public class FingerprintSettings extends SubSettings {
|
||||
if (admin != null) {
|
||||
DevicePolicyManager devicePolicyManager =
|
||||
getSystemService(DevicePolicyManager.class);
|
||||
String footerText = devicePolicyManager.getString(
|
||||
String footerText = devicePolicyManager.getResources().getString(
|
||||
FINGERPRINT_UNLOCK_DISABLED_EXPLANATION,
|
||||
() -> getString(R.string.security_settings_fingerprint_enroll_disclaimer_lockscreen_disabled));
|
||||
|
||||
@@ -457,10 +457,8 @@ public class FingerprintSettings extends SubSettings {
|
||||
final Preference addPreference = findPreference(KEY_FINGERPRINT_ADD);
|
||||
|
||||
/* Disable preference if too many fingerprints added */
|
||||
final List<FingerprintSensorPropertiesInternal> props =
|
||||
mFingerprintManager.getSensorPropertiesInternal();
|
||||
// This will need to be updated for devices with multiple fingerprint sensors
|
||||
final int max = props.get(0).maxEnrollmentsPerUser;
|
||||
final int max = getContext().getResources().getInteger(
|
||||
com.android.internal.R.integer.config_fingerprintMaxTemplatesPerUser);
|
||||
boolean tooMany = mFingerprintManager.getEnrolledFingerprints(mUserId).size() >= max;
|
||||
// retryFingerprint() will be called when remove finishes
|
||||
// need to disable enroll or have a way to determine if enroll is in progress
|
||||
@@ -948,7 +946,7 @@ public class FingerprintSettings extends SubSettings {
|
||||
|
||||
final AlertDialog alertDialog = new AlertDialog.Builder(getActivity())
|
||||
.setTitle(R.string.fingerprint_last_delete_title)
|
||||
.setMessage(devicePolicyManager.getString(
|
||||
.setMessage(devicePolicyManager.getResources().getString(
|
||||
messageId, () -> getContext().getString(defaultMessageId)))
|
||||
.setPositiveButton(R.string.fingerprint_last_delete_confirm,
|
||||
new DialogInterface.OnClickListener() {
|
||||
|
||||
@@ -196,10 +196,10 @@ public class BugReportHandlerPicker extends DefaultAppPickerFragment {
|
||||
context.getSystemService(DevicePolicyManager.class);
|
||||
|
||||
if (userInfo != null && userInfo.isManagedProfile()) {
|
||||
return devicePolicyManager.getString(WORK_PROFILE_APP_SUBTEXT,
|
||||
return devicePolicyManager.getResources().getString(WORK_PROFILE_APP_SUBTEXT,
|
||||
() -> context.getString(R.string.work_profile_app_subtext));
|
||||
}
|
||||
return devicePolicyManager.getString(PERSONAL_PROFILE_APP_SUBTEXT,
|
||||
return devicePolicyManager.getResources().getString(PERSONAL_PROFILE_APP_SUBTEXT,
|
||||
() -> context.getString(R.string.personal_profile_app_subtext));
|
||||
}
|
||||
|
||||
|
||||
@@ -545,7 +545,7 @@ public abstract class DashboardFragment extends SettingsPreferenceFragment
|
||||
}
|
||||
|
||||
preference.setTitle(
|
||||
mDevicePolicyManager.getString(overrideKey,
|
||||
mDevicePolicyManager.getResources().getString(overrideKey,
|
||||
() -> getString(resource)));
|
||||
}
|
||||
|
||||
@@ -558,7 +558,7 @@ public abstract class DashboardFragment extends SettingsPreferenceFragment
|
||||
}
|
||||
|
||||
preference.setSummary(
|
||||
mDevicePolicyManager.getString(overrideKey,
|
||||
mDevicePolicyManager.getResources().getString(overrideKey,
|
||||
() -> getString(resource)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,11 +189,11 @@ public abstract class ProfileSelectFragment extends DashboardFragment {
|
||||
getContext().getSystemService(DevicePolicyManager.class);
|
||||
|
||||
if (position == WORK_TAB) {
|
||||
return devicePolicyManager.getString(WORK_CATEGORY_HEADER,
|
||||
return devicePolicyManager.getResources().getString(WORK_CATEGORY_HEADER,
|
||||
() -> getContext().getString(R.string.category_work));
|
||||
}
|
||||
|
||||
return devicePolicyManager.getString(PERSONAL_CATEGORY_HEADER,
|
||||
return devicePolicyManager.getResources().getString(PERSONAL_CATEGORY_HEADER,
|
||||
() -> getContext().getString(R.string.category_personal));
|
||||
}
|
||||
|
||||
|
||||
@@ -59,9 +59,9 @@ public class UserAdapter implements SpinnerAdapter, ListAdapter {
|
||||
UserInfo userInfo = um.getUserInfo(mUserHandle.getIdentifier());
|
||||
Drawable icon;
|
||||
if (userInfo.isManagedProfile()) {
|
||||
mName = context.getSystemService(DevicePolicyManager.class).getString(
|
||||
WORK_PROFILE_USER_LABEL,
|
||||
() -> context.getString(R.string.managed_user_title));
|
||||
mName = context.getSystemService(DevicePolicyManager.class).getResources()
|
||||
.getString(WORK_PROFILE_USER_LABEL,
|
||||
() -> context.getString(R.string.managed_user_title));
|
||||
icon = context.getPackageManager().getUserBadgeForDensityNoBackground(
|
||||
userHandle, /* density= */ 0);
|
||||
} else {
|
||||
@@ -119,10 +119,10 @@ public class UserAdapter implements SpinnerAdapter, ListAdapter {
|
||||
int userHandle = user.mUserHandle.getIdentifier();
|
||||
if (userHandle == UserHandle.USER_CURRENT
|
||||
|| userHandle == ActivityManager.getCurrentUser()) {
|
||||
return mDevicePolicyManager.getString(PERSONAL_CATEGORY_HEADER,
|
||||
return mDevicePolicyManager.getResources().getString(PERSONAL_CATEGORY_HEADER,
|
||||
() -> mContext.getString(R.string.category_personal));
|
||||
} else {
|
||||
return mDevicePolicyManager.getString(WORK_CATEGORY_HEADER,
|
||||
return mDevicePolicyManager.getResources().getString(WORK_CATEGORY_HEADER,
|
||||
() -> mContext.getString(R.string.category_work));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ public class StorageWizardMoveProgress extends StorageWizardBase {
|
||||
case PackageManager.MOVE_FAILED_INSUFFICIENT_STORAGE:
|
||||
return getString(R.string.insufficient_storage);
|
||||
case PackageManager.MOVE_FAILED_DEVICE_ADMIN:
|
||||
return getSystemService(DevicePolicyManager.class)
|
||||
return getSystemService(DevicePolicyManager.class).getResources()
|
||||
.getString(ERROR_MOVE_DEVICE_ADMIN,
|
||||
() -> getString(R.string.move_error_device_admin));
|
||||
case PackageManager.MOVE_FAILED_DOESNT_EXIST:
|
||||
|
||||
@@ -62,6 +62,7 @@ public class ScreenTimeoutPreferenceController extends BasePreferenceController
|
||||
if (admin != null) {
|
||||
preference.setEnabled(false);
|
||||
preference.setSummary(mContext.getSystemService(DevicePolicyManager.class)
|
||||
.getResources()
|
||||
.getString(DISABLED_BY_IT_ADMIN_TITLE,
|
||||
() -> mContext.getString(R.string.disabled_by_policy_title)));
|
||||
((RestrictedPreference) preference).setDisabledByAdmin(admin);
|
||||
|
||||
@@ -223,7 +223,7 @@ public class ScreenTimeoutSettings extends RadioButtonPickerFragment implements
|
||||
|
||||
@VisibleForTesting
|
||||
void setupDisabledFooterPreference() {
|
||||
final String textDisabledByAdmin = mDevicePolicyManager.getString(
|
||||
final String textDisabledByAdmin = mDevicePolicyManager.getResources().getString(
|
||||
OTHER_OPTIONS_DISABLED_BY_ADMIN, () -> getResources().getString(
|
||||
R.string.admin_disabled_other_options));
|
||||
final String textMoreDetails = getResources().getString(R.string.admin_more_details);
|
||||
|
||||
@@ -66,5 +66,10 @@ public class EmergencyDashboardFragment extends DashboardFragment {
|
||||
}
|
||||
|
||||
public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
||||
new BaseSearchIndexProvider(R.xml.emergency_settings);
|
||||
new BaseSearchIndexProvider(R.xml.emergency_settings) {
|
||||
@Override
|
||||
protected boolean isPageSearchEnabled(Context context) {
|
||||
return context.getResources().getBoolean(R.bool.config_show_emergency_settings);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ public final class ActionDisabledByAdminDialogHelper {
|
||||
mActivity.getSystemService(DevicePolicyManager.class);
|
||||
|
||||
TextView title = mDialogView.findViewById(R.id.admin_support_dialog_title);
|
||||
title.setText(devicePolicyManager.getString(DISABLED_BY_IT_ADMIN_TITLE,
|
||||
title.setText(devicePolicyManager.getResources().getString(DISABLED_BY_IT_ADMIN_TITLE,
|
||||
() -> mActivity.getString(R.string.disabled_by_policy_title)));
|
||||
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ public abstract class AdminActionPreferenceControllerBase extends
|
||||
}
|
||||
|
||||
private String getEnterprisePrivacyNone() {
|
||||
return mContext.getSystemService(DevicePolicyManager.class)
|
||||
return mContext.getSystemService(DevicePolicyManager.class).getResources()
|
||||
.getString(ADMIN_ACTION_NONE,
|
||||
() -> mContext.getString(R.string.enterprise_privacy_none));
|
||||
}
|
||||
|
||||
@@ -44,13 +44,13 @@ public class AlwaysOnVpnCurrentUserPreferenceController
|
||||
public void updateState(Preference preference) {
|
||||
if (mFeatureProvider.isInCompMode()) {
|
||||
preference.setTitle(
|
||||
mDevicePolicyManager.getString(
|
||||
mDevicePolicyManager.getResources().getString(
|
||||
ALWAYS_ON_VPN_PERSONAL_PROFILE,
|
||||
() -> mContext.getString(
|
||||
R.string.enterprise_privacy_always_on_vpn_personal)));
|
||||
} else {
|
||||
preference.setTitle(
|
||||
mDevicePolicyManager.getString(ALWAYS_ON_VPN_DEVICE,
|
||||
mDevicePolicyManager.getResources().getString(ALWAYS_ON_VPN_DEVICE,
|
||||
() -> mContext.getString(
|
||||
R.string.enterprise_privacy_always_on_vpn_device)));
|
||||
}
|
||||
|
||||
@@ -47,11 +47,11 @@ public class CaCertsCurrentUserPreferenceController extends CaCertsPreferenceCon
|
||||
super.updateState(preference);
|
||||
|
||||
if (mFeatureProvider.isInCompMode()) {
|
||||
preference.setTitle(mDevicePolicyManager.getString(
|
||||
preference.setTitle(mDevicePolicyManager.getResources().getString(
|
||||
CA_CERTS_PERSONAL_PROFILE,
|
||||
() -> mContext.getString(R.string.enterprise_privacy_ca_certs_personal)));
|
||||
} else {
|
||||
preference.setTitle(mDevicePolicyManager.getString(
|
||||
preference.setTitle(mDevicePolicyManager.getResources().getString(
|
||||
CA_CERTS_DEVICE,
|
||||
() -> mContext.getString(R.string.enterprise_privacy_ca_certs_device)));
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ class DeviceAdminStringProviderImpl implements DeviceAdminStringProvider {
|
||||
|
||||
@Override
|
||||
public String getDefaultDisabledByPolicyTitle() {
|
||||
return mDevicePolicyManager.getString(DISABLED_BY_IT_ADMIN_TITLE,
|
||||
return mDevicePolicyManager.getResources().getString(DISABLED_BY_IT_ADMIN_TITLE,
|
||||
() -> mContext.getString(R.string.disabled_by_policy_title));
|
||||
}
|
||||
|
||||
@@ -75,13 +75,13 @@ class DeviceAdminStringProviderImpl implements DeviceAdminStringProvider {
|
||||
|
||||
@Override
|
||||
public String getDefaultDisabledByPolicyContent() {
|
||||
return mDevicePolicyManager.getString(CONTACT_YOUR_IT_ADMIN,
|
||||
return mDevicePolicyManager.getResources().getString(CONTACT_YOUR_IT_ADMIN,
|
||||
() -> mContext.getString(R.string.default_admin_support_msg));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLearnMoreHelpPageUrl() {
|
||||
return mDevicePolicyManager.getString(IT_ADMIN_POLICY_DISABLING_INFO_URL,
|
||||
return mDevicePolicyManager.getResources().getString(IT_ADMIN_POLICY_DISABLING_INFO_URL,
|
||||
() -> mContext.getString(R.string.help_url_action_disabled_by_it_admin));
|
||||
}
|
||||
|
||||
|
||||
@@ -98,11 +98,11 @@ public class EnterprisePrivacyFeatureProviderImpl implements EnterprisePrivacyFe
|
||||
final SpannableStringBuilder disclosure = new SpannableStringBuilder();
|
||||
final CharSequence organizationName = mDpm.getDeviceOwnerOrganizationName();
|
||||
if (organizationName != null) {
|
||||
disclosure.append(mDpm.getString(DEVICE_MANAGED_WITH_NAME,
|
||||
disclosure.append(mDpm.getResources().getString(DEVICE_MANAGED_WITH_NAME,
|
||||
() -> mResources.getString(R.string.do_disclosure_with_name,
|
||||
organizationName), organizationName));
|
||||
} else {
|
||||
disclosure.append(mDpm.getString(DEVICE_MANAGED_WITHOUT_NAME,
|
||||
disclosure.append(mDpm.getResources().getString(DEVICE_MANAGED_WITHOUT_NAME,
|
||||
() -> mResources.getString(R.string.do_disclosure_generic)));
|
||||
}
|
||||
return disclosure;
|
||||
|
||||
@@ -134,11 +134,11 @@ public class EnterpriseSetDefaultAppsListPreferenceController extends
|
||||
final PreferenceCategory category = new PreferenceCategory(prefContext);
|
||||
screen.addPreference(category);
|
||||
if (userInfo.isManagedProfile()) {
|
||||
category.setTitle(devicePolicyManager.getString(
|
||||
category.setTitle(devicePolicyManager.getResources().getString(
|
||||
WORK_CATEGORY_HEADER,
|
||||
() -> mContext.getString(R.string.category_work)));
|
||||
} else {
|
||||
category.setTitle(devicePolicyManager.getString(
|
||||
category.setTitle(devicePolicyManager.getResources().getString(
|
||||
PERSONAL_CATEGORY_HEADER,
|
||||
() -> mContext.getString(R.string.category_personal)));
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ public class ImePreferenceController extends AbstractPreferenceController implem
|
||||
@Override
|
||||
public void updateState(Preference preference) {
|
||||
preference.setSummary(
|
||||
mContext.getSystemService(DevicePolicyManager.class)
|
||||
mContext.getSystemService(DevicePolicyManager.class).getResources()
|
||||
.getString(ADMIN_ACTION_SET_INPUT_METHOD_NAME, () ->
|
||||
mContext.getResources().getString(
|
||||
R.string.enterprise_privacy_input_method_name,
|
||||
|
||||
@@ -42,7 +42,7 @@ public class ManageDeviceAdminPreferenceController extends BasePreferenceControl
|
||||
= mFeatureProvider.getNumberOfActiveDeviceAdminsForCurrentUserAndManagedProfile();
|
||||
|
||||
if (activeAdmins == 0) {
|
||||
return mDevicePolicyManager.getString(NUMBER_OF_DEVICE_ADMINS_NONE,
|
||||
return mDevicePolicyManager.getResources().getString(NUMBER_OF_DEVICE_ADMINS_NONE,
|
||||
() -> mContext.getResources().getString(R.string.number_of_device_admins_none));
|
||||
}
|
||||
|
||||
|
||||
@@ -52,16 +52,16 @@ class PrivacyPreferenceControllerHelper {
|
||||
|
||||
final String organizationName = mFeatureProvider.getDeviceOwnerOrganizationName();
|
||||
if (organizationName == null) {
|
||||
preference.setSummary(mDevicePolicyManager.getString(
|
||||
preference.setSummary(mDevicePolicyManager.getResources().getString(
|
||||
MANAGED_DEVICE_INFO_SUMMARY,
|
||||
() -> mContext.getString(
|
||||
R.string.enterprise_privacy_settings_summary_generic)));
|
||||
} else {
|
||||
preference.setSummary(mDevicePolicyManager
|
||||
.getString(MANAGED_DEVICE_INFO_SUMMARY_WITH_NAME,
|
||||
() -> mContext.getResources().getString(
|
||||
R.string.enterprise_privacy_settings_summary_with_name,
|
||||
organizationName), organizationName));
|
||||
preference.setSummary(mDevicePolicyManager.getResources().getString(
|
||||
MANAGED_DEVICE_INFO_SUMMARY_WITH_NAME,
|
||||
() -> mContext.getResources().getString(
|
||||
R.string.enterprise_privacy_settings_summary_with_name,
|
||||
organizationName), organizationName));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ public class WorkModeConditionController implements ConditionalCardController {
|
||||
|
||||
@Override
|
||||
public ContextualCard buildContextualCard() {
|
||||
String conditionWorkTitle = mDpm.getString(WORK_PROFILE_OFF_CONDITION_TITLE,
|
||||
String conditionWorkTitle = mDpm.getResources().getString(WORK_PROFILE_OFF_CONDITION_TITLE,
|
||||
() -> mAppContext.getString(R.string.condition_work_title));
|
||||
return new ConditionalContextualCard.Builder()
|
||||
.setConditionId(ID)
|
||||
|
||||
@@ -107,7 +107,7 @@ public class NotificationAccessSettings extends EmptyTextSettings {
|
||||
if (UserManager.get(mContext).isManagedProfile()) {
|
||||
// Apps in the work profile do not support notification listeners.
|
||||
Toast.makeText(mContext,
|
||||
mDpm.getString(WORK_APPS_CANNOT_ACCESS_NOTIFICATION_SETTINGS,
|
||||
mDpm.getResources().getString(WORK_APPS_CANNOT_ACCESS_NOTIFICATION_SETTINGS,
|
||||
() -> mContext.getString(R.string.notification_settings_work_profile)),
|
||||
Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
@@ -168,7 +168,8 @@ public class NotificationAccessSettings extends EmptyTextSettings {
|
||||
if (managedProfileId != UserHandle.USER_NULL
|
||||
&& !mDpm.isNotificationListenerServicePermitted(
|
||||
service.packageName, managedProfileId)) {
|
||||
pref.setSummary(mDpm.getString(WORK_PROFILE_NOTIFICATION_LISTENER_BLOCKED,
|
||||
pref.setSummary(mDpm.getResources().getString(
|
||||
WORK_PROFILE_NOTIFICATION_LISTENER_BLOCKED,
|
||||
() -> getString(
|
||||
R.string.work_profile_notification_access_blocked_summary)));
|
||||
}
|
||||
|
||||
@@ -257,9 +257,9 @@ public class SoundWorkSettingsController extends AbstractPreferenceController
|
||||
private void enableWorkSyncSettings() {
|
||||
mWorkUsePersonalSounds.setChecked(true);
|
||||
|
||||
String summary = mContext.getSystemService(DevicePolicyManager.class).getString(
|
||||
WORK_PROFILE_SYNC_WITH_PERSONAL_SOUNDS_ACTIVE_SUMMARY,
|
||||
() -> mContext.getString(R.string.work_sound_same_as_personal)
|
||||
String summary = mContext.getSystemService(DevicePolicyManager.class).getResources()
|
||||
.getString(WORK_PROFILE_SYNC_WITH_PERSONAL_SOUNDS_ACTIVE_SUMMARY,
|
||||
() -> mContext.getString(R.string.work_sound_same_as_personal)
|
||||
);
|
||||
|
||||
if (mWorkPhoneRingtonePreference != null) {
|
||||
@@ -355,10 +355,10 @@ public class SoundWorkSettingsController extends AbstractPreferenceController
|
||||
context.getSystemService(DevicePolicyManager.class);
|
||||
|
||||
return new AlertDialog.Builder(getActivity())
|
||||
.setTitle(devicePolicyManager.getString(
|
||||
.setTitle(devicePolicyManager.getResources().getString(
|
||||
ENABLE_WORK_PROFILE_SYNC_WITH_PERSONAL_SOUNDS_DIALOG_TITLE,
|
||||
() -> context.getString(R.string.work_sync_dialog_title)))
|
||||
.setMessage(devicePolicyManager.getString(
|
||||
.setMessage(devicePolicyManager.getResources().getString(
|
||||
ENABLE_WORK_PROFILE_SYNC_WITH_PERSONAL_SOUNDS_DIALOG_MESSAGE,
|
||||
() -> context.getString(R.string.work_sync_dialog_message)))
|
||||
.setPositiveButton(R.string.work_sync_dialog_yes,
|
||||
|
||||
@@ -396,16 +396,18 @@ public class ChooseLockGeneric extends SettingsActivity {
|
||||
}
|
||||
} else {
|
||||
if (mIsManagedProfile) {
|
||||
textView.setText(mDpm.getString(WORK_PROFILE_SCREEN_LOCK_SETUP_MESSAGE,
|
||||
textView.setText(mDpm.getResources().getString(
|
||||
WORK_PROFILE_SCREEN_LOCK_SETUP_MESSAGE,
|
||||
() -> getString(R.string.lock_settings_picker_profile_message)));
|
||||
} else {
|
||||
int profileUserId = Utils.getManagedProfileId(mUserManager, mUserId);
|
||||
if (mController.isScreenLockRestrictedByAdmin()
|
||||
&& profileUserId != UserHandle.USER_NULL) {
|
||||
final StringBuilder description = new StringBuilder(
|
||||
mDpm.getString(WORK_PROFILE_IT_ADMIN_CANT_RESET_SCREEN_LOCK, () ->
|
||||
getString(
|
||||
R.string.lock_settings_picker_admin_restricted_personal_message)));
|
||||
mDpm.getResources().getString(
|
||||
WORK_PROFILE_IT_ADMIN_CANT_RESET_SCREEN_LOCK,
|
||||
() -> getString(
|
||||
R.string.lock_settings_picker_admin_restricted_personal_message)));
|
||||
final LinkifyUtils.OnClickListener clickListener = () -> {
|
||||
final Bundle extras = new Bundle();
|
||||
extras.putInt(Intent.EXTRA_USER_ID, profileUserId);
|
||||
|
||||
@@ -24,7 +24,7 @@ import static android.app.admin.DevicePolicyResources.Strings.Settings.REENTER_W
|
||||
import static android.app.admin.DevicePolicyResources.Strings.Settings.REENTER_WORK_PROFILE_PIN_HEADER;
|
||||
import static android.app.admin.DevicePolicyResources.Strings.Settings.SET_WORK_PROFILE_PASSWORD_HEADER;
|
||||
import static android.app.admin.DevicePolicyResources.Strings.Settings.SET_WORK_PROFILE_PIN_HEADER;
|
||||
import static android.app.admin.DevicePolicyResources.Strings.UNDEFINED;
|
||||
import static android.app.admin.DevicePolicyResources.UNDEFINED;
|
||||
|
||||
import static com.android.internal.widget.LockPatternUtils.CREDENTIAL_TYPE_NONE;
|
||||
import static com.android.internal.widget.PasswordValidationError.CONTAINS_INVALID_CHARACTERS;
|
||||
@@ -389,7 +389,7 @@ public class ChooseLockPassword extends SettingsActivity {
|
||||
} else if (type == TYPE_BIOMETRIC) {
|
||||
return context.getString(alphaHintForBiometrics);
|
||||
} else if (isProfile) {
|
||||
return context.getSystemService(DevicePolicyManager.class)
|
||||
return context.getSystemService(DevicePolicyManager.class).getResources()
|
||||
.getString(alphaHintOverrideForProfile,
|
||||
() -> context.getString(alphaHintForProfile));
|
||||
} else {
|
||||
@@ -403,7 +403,7 @@ public class ChooseLockPassword extends SettingsActivity {
|
||||
} else if (type == TYPE_BIOMETRIC) {
|
||||
return context.getString(numericHintForBiometrics);
|
||||
} else if (isProfile) {
|
||||
return context.getSystemService(DevicePolicyManager.class)
|
||||
return context.getSystemService(DevicePolicyManager.class).getResources()
|
||||
.getString(numericHintOverrideForProfile,
|
||||
() -> context.getString(numericHintForProfile));
|
||||
} else {
|
||||
@@ -848,11 +848,11 @@ public class ChooseLockPassword extends SettingsActivity {
|
||||
DevicePolicyManager devicePolicyManager =
|
||||
getContext().getSystemService(DevicePolicyManager.class);
|
||||
if (mIsAlphaMode) {
|
||||
messages.add(devicePolicyManager.getString(
|
||||
messages.add(devicePolicyManager.getResources().getString(
|
||||
PASSWORD_RECENTLY_USED,
|
||||
() -> getString(R.string.lockpassword_password_recently_used)));
|
||||
} else {
|
||||
messages.add(devicePolicyManager.getString(
|
||||
messages.add(devicePolicyManager.getResources().getString(
|
||||
PIN_RECENTLY_USED,
|
||||
() -> getString(R.string.lockpassword_pin_recently_used)));
|
||||
}
|
||||
|
||||
@@ -482,7 +482,7 @@ public class ChooseLockPattern extends SettingsActivity {
|
||||
} else if (mForFace) {
|
||||
msg = getString(R.string.lockpassword_choose_your_pattern_header_for_face);
|
||||
} else if (mIsManagedProfile) {
|
||||
msg = getContext().getSystemService(DevicePolicyManager.class)
|
||||
msg = getContext().getSystemService(DevicePolicyManager.class).getResources()
|
||||
.getString(SET_WORK_PROFILE_PATTERN_HEADER,
|
||||
() -> getString(
|
||||
R.string.lockpassword_choose_your_profile_pattern_header));
|
||||
|
||||
@@ -272,7 +272,7 @@ public class ConfirmDeviceCredentialActivity extends FragmentActivity {
|
||||
case LockPatternUtils.CREDENTIAL_TYPE_PIN:
|
||||
|
||||
if (isEffectiveUserManagedProfile) {
|
||||
return mDevicePolicyManager.getString(
|
||||
return mDevicePolicyManager.getResources().getString(
|
||||
CONFIRM_WORK_PROFILE_PIN_HEADER,
|
||||
() -> getString(R.string.lockpassword_confirm_your_work_pin_header));
|
||||
}
|
||||
@@ -280,7 +280,7 @@ public class ConfirmDeviceCredentialActivity extends FragmentActivity {
|
||||
return getString(R.string.lockpassword_confirm_your_pin_header);
|
||||
case LockPatternUtils.CREDENTIAL_TYPE_PATTERN:
|
||||
if (isEffectiveUserManagedProfile) {
|
||||
return mDevicePolicyManager.getString(
|
||||
return mDevicePolicyManager.getResources().getString(
|
||||
CONFIRM_WORK_PROFILE_PATTERN_HEADER,
|
||||
() -> getString(
|
||||
R.string.lockpassword_confirm_your_work_pattern_header));
|
||||
@@ -289,7 +289,7 @@ public class ConfirmDeviceCredentialActivity extends FragmentActivity {
|
||||
return getString(R.string.lockpassword_confirm_your_pattern_header);
|
||||
case LockPatternUtils.CREDENTIAL_TYPE_PASSWORD:
|
||||
if (isEffectiveUserManagedProfile) {
|
||||
return mDevicePolicyManager.getString(
|
||||
return mDevicePolicyManager.getResources().getString(
|
||||
CONFIRM_WORK_PROFILE_PASSWORD_HEADER,
|
||||
() -> getString(
|
||||
R.string.lockpassword_confirm_your_work_password_header));
|
||||
@@ -305,7 +305,7 @@ public class ConfirmDeviceCredentialActivity extends FragmentActivity {
|
||||
switch (credentialType) {
|
||||
case LockPatternUtils.CREDENTIAL_TYPE_PIN:
|
||||
if (isEffectiveUserManagedProfile) {
|
||||
return mDevicePolicyManager.getString(WORK_PROFILE_CONFIRM_PIN,
|
||||
return mDevicePolicyManager.getResources().getString(WORK_PROFILE_CONFIRM_PIN,
|
||||
() -> getString(
|
||||
R.string.lockpassword_confirm_your_pin_generic_profile));
|
||||
}
|
||||
@@ -313,7 +313,8 @@ public class ConfirmDeviceCredentialActivity extends FragmentActivity {
|
||||
return getString(R.string.lockpassword_confirm_your_pin_generic);
|
||||
case LockPatternUtils.CREDENTIAL_TYPE_PATTERN:
|
||||
if (isEffectiveUserManagedProfile) {
|
||||
return mDevicePolicyManager.getString(WORK_PROFILE_CONFIRM_PATTERN,
|
||||
return mDevicePolicyManager.getResources().getString(
|
||||
WORK_PROFILE_CONFIRM_PATTERN,
|
||||
() -> getString(
|
||||
R.string.lockpassword_confirm_your_pattern_generic_profile));
|
||||
}
|
||||
@@ -321,7 +322,8 @@ public class ConfirmDeviceCredentialActivity extends FragmentActivity {
|
||||
return getString(R.string.lockpassword_confirm_your_pattern_generic);
|
||||
case LockPatternUtils.CREDENTIAL_TYPE_PASSWORD:
|
||||
if (isEffectiveUserManagedProfile) {
|
||||
return mDevicePolicyManager.getString(WORK_PROFILE_CONFIRM_PASSWORD,
|
||||
return mDevicePolicyManager.getResources().getString(
|
||||
WORK_PROFILE_CONFIRM_PASSWORD,
|
||||
() -> getString(
|
||||
R.string.lockpassword_confirm_your_password_generic_profile));
|
||||
}
|
||||
|
||||
@@ -247,7 +247,7 @@ public abstract class ConfirmDeviceCredentialBaseFragment extends InstrumentedFr
|
||||
R.string.lock_last_attempt_before_wipe_warning_title);
|
||||
final String overrideMessageId = getLastTryOverrideErrorMessageId(userType);
|
||||
final int defaultMessageId = getLastTryDefaultErrorMessage(userType);
|
||||
final String message = mDevicePolicyManager.getString(
|
||||
final String message = mDevicePolicyManager.getResources().getString(
|
||||
overrideMessageId, () -> getString(defaultMessageId));
|
||||
LastTryDialog.show(fragmentManager, title, message,
|
||||
android.R.string.ok, false /* dismiss */);
|
||||
@@ -279,7 +279,8 @@ public abstract class ConfirmDeviceCredentialBaseFragment extends InstrumentedFr
|
||||
case USER_TYPE_PRIMARY:
|
||||
return getString(R.string.lock_failed_attempts_now_wiping_device);
|
||||
case USER_TYPE_MANAGED_PROFILE:
|
||||
return mDevicePolicyManager.getString(WORK_PROFILE_LOCK_ATTEMPTS_FAILED,
|
||||
return mDevicePolicyManager.getResources().getString(
|
||||
WORK_PROFILE_LOCK_ATTEMPTS_FAILED,
|
||||
() -> getString(R.string.lock_failed_attempts_now_wiping_profile));
|
||||
case USER_TYPE_SECONDARY:
|
||||
return getString(R.string.lock_failed_attempts_now_wiping_user);
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.android.settings.password;
|
||||
|
||||
import static android.app.admin.DevicePolicyResources.Strings.UNDEFINED;
|
||||
import static android.app.admin.DevicePolicyResources.Strings.Settings.CONFIRM_WORK_PROFILE_PASSWORD_HEADER;
|
||||
import static android.app.admin.DevicePolicyResources.Strings.Settings.CONFIRM_WORK_PROFILE_PIN_HEADER;
|
||||
import static android.app.admin.DevicePolicyResources.Strings.Settings.WORK_PROFILE_CONFIRM_PASSWORD;
|
||||
@@ -25,6 +24,7 @@ import static android.app.admin.DevicePolicyResources.Strings.Settings.WORK_PROF
|
||||
import static android.app.admin.DevicePolicyResources.Strings.Settings.WORK_PROFILE_LAST_PIN_ATTEMPT_BEFORE_WIPE;
|
||||
import static android.app.admin.DevicePolicyResources.Strings.Settings.WORK_PROFILE_PASSWORD_REQUIRED;
|
||||
import static android.app.admin.DevicePolicyResources.Strings.Settings.WORK_PROFILE_PIN_REQUIRED;
|
||||
import static android.app.admin.DevicePolicyResources.UNDEFINED;
|
||||
|
||||
import android.annotation.Nullable;
|
||||
import android.app.admin.DevicePolicyManager;
|
||||
@@ -256,12 +256,12 @@ public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity {
|
||||
}
|
||||
if (mIsManagedProfile) {
|
||||
if (mIsAlpha) {
|
||||
return mDevicePolicyManager.getString(
|
||||
return mDevicePolicyManager.getResources().getString(
|
||||
CONFIRM_WORK_PROFILE_PASSWORD_HEADER,
|
||||
() -> getString(
|
||||
R.string.lockpassword_confirm_your_work_password_header));
|
||||
}
|
||||
return mDevicePolicyManager.getString(
|
||||
return mDevicePolicyManager.getResources().getString(
|
||||
CONFIRM_WORK_PROFILE_PIN_HEADER,
|
||||
() -> getString(R.string.lockpassword_confirm_your_work_pin_header));
|
||||
}
|
||||
@@ -278,7 +278,7 @@ public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity {
|
||||
// Map boolean flags to an index by isStrongAuth << 2 + isManagedProfile << 1 + isAlpha.
|
||||
int index = ((isStrongAuthRequired ? 1 : 0) << 2) + ((mIsManagedProfile ? 1 : 0) << 1)
|
||||
+ (mIsAlpha ? 1 : 0);
|
||||
return mDevicePolicyManager.getString(
|
||||
return mDevicePolicyManager.getResources().getString(
|
||||
DETAIL_TEXT_OVERRIDES[index], () -> getString(DETAIL_TEXTS[index]));
|
||||
}
|
||||
|
||||
|
||||
@@ -16,11 +16,11 @@
|
||||
|
||||
package com.android.settings.password;
|
||||
|
||||
import static android.app.admin.DevicePolicyResources.Strings.UNDEFINED;
|
||||
import static android.app.admin.DevicePolicyResources.Strings.Settings.CONFIRM_WORK_PROFILE_PATTERN_HEADER;
|
||||
import static android.app.admin.DevicePolicyResources.Strings.Settings.WORK_PROFILE_CONFIRM_PATTERN;
|
||||
import static android.app.admin.DevicePolicyResources.Strings.Settings.WORK_PROFILE_LAST_PATTERN_ATTEMPT_BEFORE_WIPE;
|
||||
import static android.app.admin.DevicePolicyResources.Strings.Settings.WORK_PROFILE_PATTERN_REQUIRED;
|
||||
import static android.app.admin.DevicePolicyResources.UNDEFINED;
|
||||
|
||||
import android.annotation.Nullable;
|
||||
import android.annotation.SuppressLint;
|
||||
@@ -271,11 +271,13 @@ public class ConfirmLockPattern extends ConfirmDeviceCredentialBaseActivity {
|
||||
final boolean isStrongAuthRequired = isStrongAuthRequired();
|
||||
if (mIsManagedProfile) {
|
||||
if (isStrongAuthRequired) {
|
||||
return mDevicePolicyManager.getString(WORK_PROFILE_PATTERN_REQUIRED,
|
||||
return mDevicePolicyManager.getResources().getString(
|
||||
WORK_PROFILE_PATTERN_REQUIRED,
|
||||
() -> getString(
|
||||
R.string.lockpassword_strong_auth_required_work_pattern));
|
||||
} else {
|
||||
return mDevicePolicyManager.getString(WORK_PROFILE_CONFIRM_PATTERN,
|
||||
return mDevicePolicyManager.getResources().getString(
|
||||
WORK_PROFILE_CONFIRM_PATTERN,
|
||||
() -> getString(
|
||||
R.string.lockpassword_confirm_your_pattern_generic_profile));
|
||||
}
|
||||
@@ -368,7 +370,7 @@ public class ConfirmLockPattern extends ConfirmDeviceCredentialBaseActivity {
|
||||
if (mFrp) return getString(R.string.lockpassword_confirm_your_pattern_header_frp);
|
||||
|
||||
if (mIsManagedProfile) {
|
||||
return mDevicePolicyManager.getString(
|
||||
return mDevicePolicyManager.getResources().getString(
|
||||
CONFIRM_WORK_PROFILE_PATTERN_HEADER,
|
||||
() -> getString(R.string.lockpassword_confirm_your_work_pattern_header));
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ public class ForgotPasswordActivity extends Activity {
|
||||
|
||||
DevicePolicyManager devicePolicyManager = getSystemService(DevicePolicyManager.class);
|
||||
TextView forgotPasswordText = (TextView) findViewById(R.id.forgot_password_text);
|
||||
forgotPasswordText.setText(devicePolicyManager.getString(
|
||||
forgotPasswordText.setText(devicePolicyManager.getResources().getString(
|
||||
FORGOT_PASSWORD_TEXT, () -> getString(R.string.forgot_password_text)));
|
||||
|
||||
final GlifLayout layout = findViewById(R.id.setup_wizard_layout);
|
||||
|
||||
@@ -192,7 +192,8 @@ public class LockUnificationPreferenceController extends AbstractPreferenceContr
|
||||
*/
|
||||
public void startUnification() {
|
||||
// Confirm profile lock
|
||||
final String title = mDpm.getString(WORK_PROFILE_SET_UNLOCK_LAUNCH_PICKER_TITLE,
|
||||
final String title = mDpm.getResources().getString(
|
||||
WORK_PROFILE_SET_UNLOCK_LAUNCH_PICKER_TITLE,
|
||||
() -> mContext.getString(R.string.unlock_set_unlock_launch_picker_title_profile));
|
||||
final ChooseLockSettingsHelper.Builder builder =
|
||||
new ChooseLockSettingsHelper.Builder(mHost.getActivity(), mHost);
|
||||
|
||||
@@ -65,7 +65,7 @@ public class UnificationConfirmationDialog extends InstrumentedDialogFragment {
|
||||
|
||||
return new AlertDialog.Builder(getActivity())
|
||||
.setTitle(R.string.lock_settings_profile_unification_dialog_title)
|
||||
.setMessage(getContext().getSystemService(DevicePolicyManager.class)
|
||||
.setMessage(getContext().getSystemService(DevicePolicyManager.class).getResources()
|
||||
.getString(overrideMessageId, () -> getString(defaultMessageId)))
|
||||
.setPositiveButton(
|
||||
compliant ? R.string.lock_settings_profile_unification_dialog_confirm
|
||||
|
||||
@@ -124,7 +124,7 @@ public class LockAfterTimeoutPreferenceController extends AbstractPreferenceCont
|
||||
private void updateLockAfterPreferenceSummary(TimeoutListPreference preference) {
|
||||
final CharSequence summary;
|
||||
if (preference.isDisabledByAdmin()) {
|
||||
summary = mDPM.getString(DISABLED_BY_IT_ADMIN_TITLE,
|
||||
summary = mDPM.getResources().getString(DISABLED_BY_IT_ADMIN_TITLE,
|
||||
() -> mContext.getString(R.string.disabled_by_policy_title));
|
||||
} else {
|
||||
// Update summary message with current value
|
||||
|
||||
@@ -63,13 +63,13 @@ public final class UserDialogs {
|
||||
.setPositiveButton(R.string.user_delete_button, onConfirmListener)
|
||||
.setNegativeButton(android.R.string.cancel, null);
|
||||
if (userInfo.isManagedProfile()) {
|
||||
builder.setTitle(dpm.getString(WORK_PROFILE_CONFIRM_REMOVE_TITLE,
|
||||
builder.setTitle(dpm.getResources().getString(WORK_PROFILE_CONFIRM_REMOVE_TITLE,
|
||||
() -> context.getString(R.string.work_profile_confirm_remove_title)));
|
||||
View view = createRemoveManagedUserDialogView(context, removingUserId);
|
||||
if (view != null) {
|
||||
builder.setView(view);
|
||||
} else {
|
||||
builder.setMessage(dpm.getString(WORK_PROFILE_CONFIRM_REMOVE_MESSAGE,
|
||||
builder.setMessage(dpm.getResources().getString(WORK_PROFILE_CONFIRM_REMOVE_MESSAGE,
|
||||
() -> context.getString(R.string.work_profile_confirm_remove_message)));
|
||||
}
|
||||
} else if (UserHandle.myUserId() == removingUserId) {
|
||||
@@ -107,12 +107,14 @@ public final class UserDialogs {
|
||||
|
||||
TextView openingParagraph = (TextView)
|
||||
view.findViewById(R.id.delete_managed_profile_opening_paragraph);
|
||||
openingParagraph.setText(devicePolicyManager.getString(WORK_PROFILE_MANAGED_BY,
|
||||
openingParagraph.setText(devicePolicyManager.getResources().getString(
|
||||
WORK_PROFILE_MANAGED_BY,
|
||||
() -> context.getString(
|
||||
R.string.opening_paragraph_delete_profile_unknown_company)));
|
||||
TextView closingParagraph = (TextView)
|
||||
view.findViewById(R.id.delete_managed_profile_closing_paragraph);
|
||||
closingParagraph.setText(devicePolicyManager.getString(WORK_PROFILE_CONFIRM_REMOVE_MESSAGE,
|
||||
closingParagraph.setText(devicePolicyManager.getResources().getString(
|
||||
WORK_PROFILE_CONFIRM_REMOVE_MESSAGE,
|
||||
() -> context.getString(R.string.work_profile_confirm_remove_message)));
|
||||
|
||||
CharSequence appLabel = packageManager.getApplicationLabel(mdmApplicationInfo);
|
||||
|
||||
@@ -136,7 +136,8 @@ public abstract class ManagedServiceSettings extends EmptyTextSettings {
|
||||
if (managedProfileId != UserHandle.USER_NULL
|
||||
&& !mDpm.isNotificationListenerServicePermitted(
|
||||
service.packageName, managedProfileId)) {
|
||||
pref.setSummary(mDpm.getString(WORK_PROFILE_NOTIFICATION_LISTENER_BLOCKED,
|
||||
pref.setSummary(mDpm.getResources().getString(
|
||||
WORK_PROFILE_NOTIFICATION_LISTENER_BLOCKED,
|
||||
() -> getString(
|
||||
R.string.work_profile_notification_access_blocked_summary)));
|
||||
}
|
||||
|
||||
@@ -353,6 +353,7 @@ public class WifiP2pSettings extends DashboardFragment
|
||||
mWifiP2pManager.requestDeviceInfo(mChannel, WifiP2pSettings.this);
|
||||
mIsIgnoreInitConnectionInfoCallback = false;
|
||||
mWifiP2pManager.requestNetworkInfo(mChannel, networkInfo -> {
|
||||
if (mChannel == null) return;
|
||||
mWifiP2pManager.requestConnectionInfo(mChannel, wifip2pinfo -> {
|
||||
if (!mIsIgnoreInitConnectionInfoCallback) {
|
||||
if (networkInfo.isConnected()) {
|
||||
|
||||
Reference in New Issue
Block a user