Merge "Fix device administrator "add" logic"
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 @@
                     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);
+                            }
                         }
-                    }
-                });
+                    });
+                }
             }
         });
     }