OSDN Git Service

Fixing admins not being removed from DpmMockContext
authorSuprabh Shukla <suprabh@google.com>
Wed, 10 Aug 2016 00:20:57 +0000 (17:20 -0700)
committerSuprabh Shukla <suprabh@google.com>
Wed, 10 Aug 2016 00:52:54 +0000 (17:52 -0700)
commit3cb2b49f443a31b1bb043d0450e350b95acecc8b
treecd29c97dbdac2de536b318aa1ab74048408c2f3b
parent67abc837af97e887477a60fff58821df99f84c72
Fixing admins not being removed from DpmMockContext

We were not calling setActiveAdmin before calling setDeviceOwner or
setProfileOwner in these tests. They were passing because the admins
were not being properly removed in the first place. The admin is
actually removed from the admin list inside onReceive of the receiver
passed in sendOrderedBroadcastForUser, which was not overridden to call
onReceive in DpmMockContext.

Bug: 30726135
Change-Id: I08cab5821228738196b229a8f885f7488aaafa34
services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java
services/tests/servicestests/src/com/android/server/devicepolicy/DpmMockContext.java