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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user