diff options
author | Andrew Stadler <stadler@android.com> | 2010-02-05 01:00:13 -0800 |
---|---|---|
committer | Andrew Stadler <stadler@android.com> | 2010-02-05 01:00:13 -0800 |
commit | 4df6edb1acefcd927932b7c1cb71575298d53b86 (patch) | |
tree | 79cca8e54ad536d076af41b95d9b7bd5c8513262 /src/com/android/settings/DeviceAdminAdd.java | |
parent | c4e8d7e21a25e2a075fd80abccaa5326c3232b9d (diff) | |
download | packages_apps_Settings-4df6edb1acefcd927932b7c1cb71575298d53b86.zip packages_apps_Settings-4df6edb1acefcd927932b7c1cb71575298d53b86.tar.gz packages_apps_Settings-4df6edb1acefcd927932b7c1cb71575298d53b86.tar.bz2 |
Fix device administrator "add" logic
Due to a missing "else" the logic to activate a device administrator
was immediately falling through into the logic to remove it. As a result,
the add was immediately countermanded by a remove.
Diffstat (limited to 'src/com/android/settings/DeviceAdminAdd.java')
-rw-r--r-- | src/com/android/settings/DeviceAdminAdd.java | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/src/com/android/settings/DeviceAdminAdd.java b/src/com/android/settings/DeviceAdminAdd.java index 03db9ce..94cf714 100644 --- a/src/com/android/settings/DeviceAdminAdd.java +++ b/src/com/android/settings/DeviceAdminAdd.java @@ -140,24 +140,25 @@ public class DeviceAdminAdd extends Activity { mDPM.setActiveAdmin(mDeviceAdmin.getComponent()); setResult(Activity.RESULT_OK); finish(); - } - mDPM.getRemoveWarning(mDeviceAdmin.getComponent(), - new RemoteCallback(mHandler) { - @Override - protected void onResult(Bundle bundle) { - CharSequence msg = bundle != null - ? bundle.getCharSequence(DeviceAdmin.EXTRA_DISABLE_WARNING) - : null; - if (msg == null) { - mDPM.removeActiveAdmin(mDeviceAdmin.getComponent()); - finish(); - } else { - Bundle args = new Bundle(); - args.putCharSequence(DeviceAdmin.EXTRA_DISABLE_WARNING, msg); - showDialog(DIALOG_WARNING, args); + } else { + mDPM.getRemoveWarning(mDeviceAdmin.getComponent(), + new RemoteCallback(mHandler) { + @Override + protected void onResult(Bundle bundle) { + CharSequence msg = bundle != null + ? bundle.getCharSequence(DeviceAdmin.EXTRA_DISABLE_WARNING) + : null; + if (msg == null) { + mDPM.removeActiveAdmin(mDeviceAdmin.getComponent()); + finish(); + } else { + Bundle args = new Bundle(); + args.putCharSequence(DeviceAdmin.EXTRA_DISABLE_WARNING, msg); + showDialog(DIALOG_WARNING, args); + } } - } - }); + }); + } } }); } |