Permit deactivation of malformed Device Admins.

Bug: 9074296
Change-Id: I4a3b2f972cb297b9f985a762219c8d67d8e3a425
This commit is contained in:
Alex Klyubin
2013-06-06 14:56:24 -07:00
parent d608612581
commit 29de9d5153

View File

@@ -116,7 +116,10 @@ public class DeviceAdminAdd extends Activity {
return;
}
// Make sure the given component name is actually a valid device admin.
// When activating, make sure the given component name is actually a valid device admin.
// No need to check this when deactivating, because it is safe to deactivate an active
// invalid device admin.
if (!mDPM.isAdminActive(cn)) {
List<ResolveInfo> avail = getPackageManager().queryBroadcastReceivers(
new Intent(DeviceAdminReceiver.ACTION_DEVICE_ADMIN_ENABLED),
0);
@@ -145,6 +148,7 @@ public class DeviceAdminAdd extends Activity {
finish();
return;
}
}
ResolveInfo ri = new ResolveInfo();
ri.activityInfo = ai;