am 01dbfbf9: am efd88e2c: Merge "Permit deactivation of malformed Device Admins." into jb-dev

* commit '01dbfbf9c3e14253b7c3a2e822c55c013d0e4b17':
  Permit deactivation of malformed Device Admins.
This commit is contained in:
Alex Klyubin
2013-06-06 15:28:53 -07:00
committed by Android Git Automerger

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;