Allow Device Management Role Holder to update Settings strings.

Test: manual
Bug: 188414370
Change-Id: I6e1a06619799a9e99382d791e72e2e4518f93cac
This commit is contained in:
Jonathan Scott
2022-01-19 15:19:08 +00:00
parent 47d115c3ff
commit e0d439472f
55 changed files with 788 additions and 231 deletions

View File

@@ -16,6 +16,8 @@
package com.android.settings.utils;
import static android.app.admin.DevicePolicyResources.Strings.Settings.WORK_PROFILE_NOTIFICATION_LISTENER_BLOCKED;
import android.annotation.Nullable;
import android.app.Dialog;
import android.app.admin.DevicePolicyManager;
@@ -134,7 +136,9 @@ public abstract class ManagedServiceSettings extends EmptyTextSettings {
if (managedProfileId != UserHandle.USER_NULL
&& !mDpm.isNotificationListenerServicePermitted(
service.packageName, managedProfileId)) {
pref.setSummary(R.string.work_profile_notification_access_blocked_summary);
pref.setSummary(mDpm.getString(WORK_PROFILE_NOTIFICATION_LISTENER_BLOCKED,
() -> getString(
R.string.work_profile_notification_access_blocked_summary)));
}
pref.setOnPreferenceChangeListener((preference, newValue) -> {
final boolean enable = (boolean) newValue;