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,9 @@
package com.android.settings.enterprise;
import static android.app.admin.DevicePolicyResources.Strings.Settings.DEVICE_MANAGED_WITHOUT_NAME;
import static android.app.admin.DevicePolicyResources.Strings.Settings.DEVICE_MANAGED_WITH_NAME;
import android.app.admin.DevicePolicyManager;
import android.content.ComponentName;
import android.content.Context;
@@ -95,10 +98,12 @@ public class EnterprisePrivacyFeatureProviderImpl implements EnterprisePrivacyFe
final SpannableStringBuilder disclosure = new SpannableStringBuilder();
final CharSequence organizationName = mDpm.getDeviceOwnerOrganizationName();
if (organizationName != null) {
disclosure.append(mResources.getString(R.string.do_disclosure_with_name,
organizationName));
disclosure.append(mDpm.getString(DEVICE_MANAGED_WITH_NAME,
() -> mResources.getString(R.string.do_disclosure_with_name,
organizationName), organizationName));
} else {
disclosure.append(mResources.getString(R.string.do_disclosure_generic));
disclosure.append(mDpm.getString(DEVICE_MANAGED_WITHOUT_NAME,
() -> mResources.getString(R.string.do_disclosure_generic)));
}
return disclosure;
}