Don't allow removing admin to be added again
Bug 27909181 Change-Id: I15bcff0f790e8f701bacea912c1624be926a2076
This commit is contained in:
committed by
Amith Yamasani
parent
91f287908b
commit
d141856586
@@ -245,6 +245,12 @@ public class DeviceAdminAdd extends Activity {
|
||||
if (DevicePolicyManager.ACTION_ADD_DEVICE_ADMIN.equals(getIntent().getAction())) {
|
||||
mRefreshing = false;
|
||||
if (mDPM.isAdminActive(who)) {
|
||||
if (mDPM.isRemovingAdmin(who, android.os.Process.myUserHandle().getIdentifier())) {
|
||||
Log.w(TAG, "Requested admin is already being removed: " + who);
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
|
||||
ArrayList<DeviceAdminInfo.PolicyInfo> newPolicies = mDeviceAdmin.getUsedPolicies();
|
||||
for (int i = 0; i < newPolicies.size(); i++) {
|
||||
DeviceAdminInfo.PolicyInfo pi = newPolicies.get(i);
|
||||
|
Reference in New Issue
Block a user