Loading services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +10 −0 Original line number Diff line number Diff line Loading @@ -623,6 +623,8 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { 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 @@ -17320,6 +17322,10 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { + "current user cannot be system user when setting device owner"); return STATUS_SYSTEM_USER; } // Allow parental control with accounts if (owner != null && PARENTALCONTROL_PKG.equals(owner.getPackageName())) { return STATUS_OK; } if (hasIncompatibleAccountsOrNonAdb) { return STATUS_ACCOUNTS_NOT_EMPTY; } Loading Loading @@ -18785,6 +18791,10 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { if (!isAdb(caller)) { return true; } // Allow parental control with accounts if (owner != null && PARENTALCONTROL_PKG.equals(owner.getPackageName())) { return false; } wtfIfInLock(); return mInjector.binderWithCleanCallingIdentity(() -> { Loading
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +10 −0 Original line number Diff line number Diff line Loading @@ -623,6 +623,8 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { 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 @@ -17320,6 +17322,10 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { + "current user cannot be system user when setting device owner"); return STATUS_SYSTEM_USER; } // Allow parental control with accounts if (owner != null && PARENTALCONTROL_PKG.equals(owner.getPackageName())) { return STATUS_OK; } if (hasIncompatibleAccountsOrNonAdb) { return STATUS_ACCOUNTS_NOT_EMPTY; } Loading Loading @@ -18785,6 +18791,10 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { if (!isAdb(caller)) { return true; } // Allow parental control with accounts if (owner != null && PARENTALCONTROL_PKG.equals(owner.getPackageName())) { return false; } wtfIfInLock(); return mInjector.binderWithCleanCallingIdentity(() -> {