RESTRICT AUTOMERGE Refactor device policy resource APIs to a separate class

Bug: 217388602
Bug: 218875965
Test: atest EnterpriseResourcesTests
Test: manual
Change-Id: I4775d7741c7819fd811c3fc4eda1636b1e04b398
(cherry picked from commit de78149c16)
Merged-In: I4775d7741c7819fd811c3fc4eda1636b1e04b398
This commit is contained in:
kholoud mohamed
2022-03-14 11:11:33 +00:00
committed by Kholoud Mohamed
parent 5cc09fbd7f
commit 90afe190e8
49 changed files with 162 additions and 141 deletions

View File

@@ -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));
}