Loading core/java/android/app/admin/DevicePolicyManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -878,7 +878,7 @@ public class DevicePolicyManager { = "android.app.action.DEVICE_POLICY_MANAGER_STATE_CHANGED"; /** * Broadcast action: sent when the device owner is set or changed. * Broadcast action: sent when the device owner is set, changed or cleared. * * This broadcast is sent only to the primary user. * @see #ACTION_PROVISION_MANAGED_DEVICE Loading services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +2 −0 Original line number Diff line number Diff line Loading @@ -5883,6 +5883,8 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { try { clearDeviceOwnerLocked(admin, deviceOwnerUserId); removeActiveAdminLocked(deviceOwnerComponent, deviceOwnerUserId); Intent intent = new Intent(DevicePolicyManager.ACTION_DEVICE_OWNER_CHANGED); mContext.sendBroadcastAsUser(intent, UserHandle.of(deviceOwnerUserId)); } finally { mInjector.binderRestoreCallingIdentity(ident); } Loading services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java +6 −0 Original line number Diff line number Diff line Loading @@ -839,6 +839,12 @@ public class DevicePolicyManagerTest extends DpmTestBase { ); assertFalse(dpm.isAdminActiveAsUser(admin1, UserHandle.USER_SYSTEM)); // ACTION_DEVICE_OWNER_CHANGED should be sent twice, once for setting the device owner // and once for clearing it. verify(mContext.spiedContext, times(2)).sendBroadcastAsUser( MockUtils.checkIntentAction(DevicePolicyManager.ACTION_DEVICE_OWNER_CHANGED), MockUtils.checkUserHandle(UserHandle.USER_SYSTEM)); // TODO Check other calls. } Loading Loading
core/java/android/app/admin/DevicePolicyManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -878,7 +878,7 @@ public class DevicePolicyManager { = "android.app.action.DEVICE_POLICY_MANAGER_STATE_CHANGED"; /** * Broadcast action: sent when the device owner is set or changed. * Broadcast action: sent when the device owner is set, changed or cleared. * * This broadcast is sent only to the primary user. * @see #ACTION_PROVISION_MANAGED_DEVICE Loading
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +2 −0 Original line number Diff line number Diff line Loading @@ -5883,6 +5883,8 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { try { clearDeviceOwnerLocked(admin, deviceOwnerUserId); removeActiveAdminLocked(deviceOwnerComponent, deviceOwnerUserId); Intent intent = new Intent(DevicePolicyManager.ACTION_DEVICE_OWNER_CHANGED); mContext.sendBroadcastAsUser(intent, UserHandle.of(deviceOwnerUserId)); } finally { mInjector.binderRestoreCallingIdentity(ident); } Loading
services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java +6 −0 Original line number Diff line number Diff line Loading @@ -839,6 +839,12 @@ public class DevicePolicyManagerTest extends DpmTestBase { ); assertFalse(dpm.isAdminActiveAsUser(admin1, UserHandle.USER_SYSTEM)); // ACTION_DEVICE_OWNER_CHANGED should be sent twice, once for setting the device owner // and once for clearing it. verify(mContext.spiedContext, times(2)).sendBroadcastAsUser( MockUtils.checkIntentAction(DevicePolicyManager.ACTION_DEVICE_OWNER_CHANGED), MockUtils.checkUserHandle(UserHandle.USER_SYSTEM)); // TODO Check other calls. } Loading