Loading services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +8 −2 Original line number Diff line number Diff line Loading @@ -439,6 +439,8 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { private static final String TAG_TRANSFER_OWNERSHIP_BUNDLE = "transfer-ownership-bundle"; private static final String PARENTALCONTROL_PKG = "foundation.e.parentalcontrol"; private static final int REQUEST_EXPIRE_PASSWORD = 5571; private static final int REQUEST_PROFILE_OFF_DEADLINE = 5572; Loading Loading @@ -8442,6 +8444,10 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { + PackageManager.FEATURE_DEVICE_ADMIN + " feature."); } private boolean isParentalControl(ComponentName admin) { return admin != null && PARENTALCONTROL_PKG.equals(admin.getPackageName()); } @Override public boolean setDeviceOwner(ComponentName admin, String ownerName, int userId, boolean setProfileOwnerOnCurrentUserIfNecessary) { Loading @@ -8459,7 +8465,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { if (!hasIncompatibleAccountsOrNonAdb) { synchronized (getLockObject()) { if (!isAdminTestOnlyLocked(admin, userId) && hasAccountsOnAnyUser()) { if (!isAdminTestOnlyLocked(admin, userId) && hasAccountsOnAnyUser() && !isParentalControl(admin)) { Slogf.w(LOG_TAG, "Non test-only owner can't be installed with existing accounts."); return false; Loading Loading @@ -15545,7 +15551,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { return true; } // Allow parental control with accounts if (owner != null && "foundation.e.parentalcontrol".equals(owner.getPackageName())) { if (isParentalControl(owner)) { return false; } wtfIfInLock(); Loading
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +8 −2 Original line number Diff line number Diff line Loading @@ -439,6 +439,8 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { private static final String TAG_TRANSFER_OWNERSHIP_BUNDLE = "transfer-ownership-bundle"; private static final String PARENTALCONTROL_PKG = "foundation.e.parentalcontrol"; private static final int REQUEST_EXPIRE_PASSWORD = 5571; private static final int REQUEST_PROFILE_OFF_DEADLINE = 5572; Loading Loading @@ -8442,6 +8444,10 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { + PackageManager.FEATURE_DEVICE_ADMIN + " feature."); } private boolean isParentalControl(ComponentName admin) { return admin != null && PARENTALCONTROL_PKG.equals(admin.getPackageName()); } @Override public boolean setDeviceOwner(ComponentName admin, String ownerName, int userId, boolean setProfileOwnerOnCurrentUserIfNecessary) { Loading @@ -8459,7 +8465,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { if (!hasIncompatibleAccountsOrNonAdb) { synchronized (getLockObject()) { if (!isAdminTestOnlyLocked(admin, userId) && hasAccountsOnAnyUser()) { if (!isAdminTestOnlyLocked(admin, userId) && hasAccountsOnAnyUser() && !isParentalControl(admin)) { Slogf.w(LOG_TAG, "Non test-only owner can't be installed with existing accounts."); return false; Loading Loading @@ -15545,7 +15551,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { return true; } // Allow parental control with accounts if (owner != null && "foundation.e.parentalcontrol".equals(owner.getPackageName())) { if (isParentalControl(owner)) { return false; } wtfIfInLock();