Loading packages/SettingsLib/src/com/android/settingslib/RestrictedLockUtils.java +19 −1 Original line number Diff line number Diff line Loading @@ -69,6 +69,9 @@ public class RestrictedLockUtils { String userRestriction, int userId) { DevicePolicyManager dpm = (DevicePolicyManager) context.getSystemService( Context.DEVICE_POLICY_SERVICE); if (dpm == null) { return null; } ComponentName deviceOwner = dpm.getDeviceOwnerComponentOnAnyUser(); int deviceOwnerUserId = dpm.getDeviceOwnerUserId(); boolean enforcedByDeviceOwner = false; Loading Loading @@ -125,6 +128,9 @@ public class RestrictedLockUtils { int keyguardNotificationFeatures) { final DevicePolicyManager dpm = (DevicePolicyManager) context.getSystemService( Context.DEVICE_POLICY_SERVICE); if (dpm == null) { return null; } boolean isDisabledByMultipleAdmins = false; ComponentName adminComponent = null; List<ComponentName> admins = dpm.getActiveAdmins(); Loading Loading @@ -170,6 +176,9 @@ public class RestrictedLockUtils { if (ipm.getBlockUninstallForUser(packageName, userId)) { DevicePolicyManager dpm = (DevicePolicyManager) context.getSystemService( Context.DEVICE_POLICY_SERVICE); if (dpm == null) { return null; } ComponentName admin = dpm.getProfileOwner(); if (admin == null) { admin = dpm.getDeviceOwnerComponentOnCallingUser(); Loading Loading @@ -197,6 +206,9 @@ public class RestrictedLockUtils { } DevicePolicyManager dpm = (DevicePolicyManager) context.getSystemService( Context.DEVICE_POLICY_SERVICE); if (dpm == null) { return null; } boolean isAccountTypeDisabled = false; String[] disabledTypes = dpm.getAccountTypesWithManagementDisabled(); for (String type : disabledTypes) { Loading @@ -221,7 +233,7 @@ public class RestrictedLockUtils { public static EnforcedAdmin checkIfAutoTimeRequired(Context context) { DevicePolicyManager dpm = (DevicePolicyManager) context.getSystemService( Context.DEVICE_POLICY_SERVICE); if (dpm.getAutoTimeRequired()) { if (dpm == null || !dpm.getAutoTimeRequired()) { return null; } ComponentName adminComponent = dpm.getDeviceOwnerComponentOnCallingUser(); Loading @@ -240,6 +252,9 @@ public class RestrictedLockUtils { public static EnforcedAdmin checkIfPasswordQualityIsSet(Context context) { final DevicePolicyManager dpm = (DevicePolicyManager) context.getSystemService( Context.DEVICE_POLICY_SERVICE); if (dpm == null) { return null; } boolean isDisabledByMultipleAdmins = false; ComponentName adminComponent = null; List<ComponentName> admins = dpm.getActiveAdmins(); Loading Loading @@ -271,6 +286,9 @@ public class RestrictedLockUtils { public static EnforcedAdmin getProfileOrDeviceOwnerOnCallingUser(Context context) { final DevicePolicyManager dpm = (DevicePolicyManager) context.getSystemService( Context.DEVICE_POLICY_SERVICE); if (dpm == null) { return null; } ComponentName adminComponent = dpm.getDeviceOwnerComponentOnCallingUser(); if (adminComponent != null) { return new EnforcedAdmin(adminComponent, UserHandle.myUserId()); Loading Loading
packages/SettingsLib/src/com/android/settingslib/RestrictedLockUtils.java +19 −1 Original line number Diff line number Diff line Loading @@ -69,6 +69,9 @@ public class RestrictedLockUtils { String userRestriction, int userId) { DevicePolicyManager dpm = (DevicePolicyManager) context.getSystemService( Context.DEVICE_POLICY_SERVICE); if (dpm == null) { return null; } ComponentName deviceOwner = dpm.getDeviceOwnerComponentOnAnyUser(); int deviceOwnerUserId = dpm.getDeviceOwnerUserId(); boolean enforcedByDeviceOwner = false; Loading Loading @@ -125,6 +128,9 @@ public class RestrictedLockUtils { int keyguardNotificationFeatures) { final DevicePolicyManager dpm = (DevicePolicyManager) context.getSystemService( Context.DEVICE_POLICY_SERVICE); if (dpm == null) { return null; } boolean isDisabledByMultipleAdmins = false; ComponentName adminComponent = null; List<ComponentName> admins = dpm.getActiveAdmins(); Loading Loading @@ -170,6 +176,9 @@ public class RestrictedLockUtils { if (ipm.getBlockUninstallForUser(packageName, userId)) { DevicePolicyManager dpm = (DevicePolicyManager) context.getSystemService( Context.DEVICE_POLICY_SERVICE); if (dpm == null) { return null; } ComponentName admin = dpm.getProfileOwner(); if (admin == null) { admin = dpm.getDeviceOwnerComponentOnCallingUser(); Loading Loading @@ -197,6 +206,9 @@ public class RestrictedLockUtils { } DevicePolicyManager dpm = (DevicePolicyManager) context.getSystemService( Context.DEVICE_POLICY_SERVICE); if (dpm == null) { return null; } boolean isAccountTypeDisabled = false; String[] disabledTypes = dpm.getAccountTypesWithManagementDisabled(); for (String type : disabledTypes) { Loading @@ -221,7 +233,7 @@ public class RestrictedLockUtils { public static EnforcedAdmin checkIfAutoTimeRequired(Context context) { DevicePolicyManager dpm = (DevicePolicyManager) context.getSystemService( Context.DEVICE_POLICY_SERVICE); if (dpm.getAutoTimeRequired()) { if (dpm == null || !dpm.getAutoTimeRequired()) { return null; } ComponentName adminComponent = dpm.getDeviceOwnerComponentOnCallingUser(); Loading @@ -240,6 +252,9 @@ public class RestrictedLockUtils { public static EnforcedAdmin checkIfPasswordQualityIsSet(Context context) { final DevicePolicyManager dpm = (DevicePolicyManager) context.getSystemService( Context.DEVICE_POLICY_SERVICE); if (dpm == null) { return null; } boolean isDisabledByMultipleAdmins = false; ComponentName adminComponent = null; List<ComponentName> admins = dpm.getActiveAdmins(); Loading Loading @@ -271,6 +286,9 @@ public class RestrictedLockUtils { public static EnforcedAdmin getProfileOrDeviceOwnerOnCallingUser(Context context) { final DevicePolicyManager dpm = (DevicePolicyManager) context.getSystemService( Context.DEVICE_POLICY_SERVICE); if (dpm == null) { return null; } ComponentName adminComponent = dpm.getDeviceOwnerComponentOnCallingUser(); if (adminComponent != null) { return new EnforcedAdmin(adminComponent, UserHandle.myUserId()); Loading