RESTRICT AUTOMERGE Refactor device policy resource APIs to a separate class
Bug: 217388602 Bug: 218875965 Test: atest EnterpriseResourcesTests Test: manual Change-Id: I4775d7741c7819fd811c3fc4eda1636b1e04b398
This commit is contained in:
@@ -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,
|
||||
|
Reference in New Issue
Block a user