Loading src/com/android/settings/applications/specialaccess/deviceadmin/DeviceAdminAdd.java +15 −6 Original line number Diff line number Diff line Loading @@ -457,12 +457,20 @@ public class DeviceAdminAdd extends Activity { private void showPolicyTransparencyDialogIfRequired() { if (isManagedProfile(mDeviceAdmin) && mDeviceAdmin.getComponent().equals(mDPM.getProfileOwner())) { EnforcedAdmin enforcedAdmin; ComponentName adminComponent = mDPM.getProfileOwnerAsUser(getUserId()); if (adminComponent != null && mDPM.isOrganizationOwnedDeviceWithManagedProfile()) { enforcedAdmin = new EnforcedAdmin(adminComponent, UserManager.DISALLOW_REMOVE_MANAGED_PROFILE, UserHandle.of(getUserId())); } else { // Todo (b/151061366): Investigate this case to check if it is still viable. if (hasBaseCantRemoveProfileRestriction()) { // If DISALLOW_REMOVE_MANAGED_PROFILE is set by the system, there's no // point showing a dialog saying it's disabled by an admin. return; } EnforcedAdmin enforcedAdmin = getAdminEnforcingCantRemoveProfile(); enforcedAdmin = getAdminEnforcingCantRemoveProfile(); } if (enforcedAdmin != null) { RestrictedLockUtils.sendShowAdminSupportDetailsIntent( DeviceAdminAdd.this, Loading Loading @@ -640,7 +648,8 @@ public class DeviceAdminAdd extends Activity { final EnforcedAdmin admin = getAdminEnforcingCantRemoveProfile(); final boolean hasBaseRestriction = hasBaseCantRemoveProfileRestriction(); if (admin != null && !hasBaseRestriction) { if ((hasBaseRestriction && mDPM.isOrganizationOwnedDeviceWithManagedProfile()) || (admin != null && !hasBaseRestriction)) { findViewById(R.id.restricted_icon).setVisibility(View.VISIBLE); } mActionButton.setEnabled(admin == null && !hasBaseRestriction); Loading Loading
src/com/android/settings/applications/specialaccess/deviceadmin/DeviceAdminAdd.java +15 −6 Original line number Diff line number Diff line Loading @@ -457,12 +457,20 @@ public class DeviceAdminAdd extends Activity { private void showPolicyTransparencyDialogIfRequired() { if (isManagedProfile(mDeviceAdmin) && mDeviceAdmin.getComponent().equals(mDPM.getProfileOwner())) { EnforcedAdmin enforcedAdmin; ComponentName adminComponent = mDPM.getProfileOwnerAsUser(getUserId()); if (adminComponent != null && mDPM.isOrganizationOwnedDeviceWithManagedProfile()) { enforcedAdmin = new EnforcedAdmin(adminComponent, UserManager.DISALLOW_REMOVE_MANAGED_PROFILE, UserHandle.of(getUserId())); } else { // Todo (b/151061366): Investigate this case to check if it is still viable. if (hasBaseCantRemoveProfileRestriction()) { // If DISALLOW_REMOVE_MANAGED_PROFILE is set by the system, there's no // point showing a dialog saying it's disabled by an admin. return; } EnforcedAdmin enforcedAdmin = getAdminEnforcingCantRemoveProfile(); enforcedAdmin = getAdminEnforcingCantRemoveProfile(); } if (enforcedAdmin != null) { RestrictedLockUtils.sendShowAdminSupportDetailsIntent( DeviceAdminAdd.this, Loading Loading @@ -640,7 +648,8 @@ public class DeviceAdminAdd extends Activity { final EnforcedAdmin admin = getAdminEnforcingCantRemoveProfile(); final boolean hasBaseRestriction = hasBaseCantRemoveProfileRestriction(); if (admin != null && !hasBaseRestriction) { if ((hasBaseRestriction && mDPM.isOrganizationOwnedDeviceWithManagedProfile()) || (admin != null && !hasBaseRestriction)) { findViewById(R.id.restricted_icon).setVisibility(View.VISIBLE); } mActionButton.setEnabled(admin == null && !hasBaseRestriction); Loading