Update work challenge header in Settings

* If organization name has been set for
  a managed profile, work challenge
  should display it as the header.

Bug: 155274026
Test: manual testing

Manual Testing Steps
* Set up device with managed profile
* Set organization name via TestDPC
* Go Settings > Security > Work profile security
  and add a work profile lock
* Select 'Work profile lock' and verify
  organization name is shown in header

Change-Id: I83209383fd2cf9179c34ccfdf8c097c379ec933e
This commit is contained in:
Alex Johnston
2020-04-29 15:14:20 +01:00
parent 4eeb99d63e
commit 439947aec7
2 changed files with 7 additions and 0 deletions

View File

@@ -159,6 +159,9 @@ public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity {
ConfirmDeviceCredentialBaseFragment.HEADER_TEXT);
CharSequence detailsMessage = intent.getCharSequenceExtra(
ConfirmDeviceCredentialBaseFragment.DETAILS_TEXT);
if (TextUtils.isEmpty(headerMessage) && mIsManagedProfile) {
headerMessage = mDevicePolicyManager.getOrganizationNameForUser(mUserId);
}
if (TextUtils.isEmpty(headerMessage)) {
headerMessage = getString(getDefaultHeader());
}