Fix DPM unit tests, also fix a log message.

Bug 31446501

Change-Id: I37debbe2f4e983fb8bad026f8dd9bd91b7448dce
This commit is contained in:
Makoto Onuki
2016-09-19 14:23:02 -07:00
parent d0f20c2bbd
commit 6ad5f92512
2 changed files with 3 additions and 3 deletions

View File

@@ -3010,8 +3010,8 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
throw new IllegalStateException(e);
}
if (ai == null) {
throw new IllegalStateException("Couldn't find package to remove admin "
+ packageName + " " + userHandle);
throw new IllegalStateException("Couldn't find package: "
+ packageName + " on user " + userHandle);
}
return (ai.flags & ApplicationInfo.FLAG_TEST_ONLY) != 0;
}

View File

@@ -131,7 +131,7 @@ public abstract class DpmTestBase extends AndroidTestCase {
doReturn(ai).when(mMockContext.ipackageManager).getApplicationInfo(
eq(admin.getPackageName()),
eq(PackageManager.GET_DISABLED_UNTIL_USED_COMPONENTS),
anyInt(),
eq(UserHandle.getUserId(packageUid)));
// Set up queryBroadcastReceivers().