Relax device admin policies when accounts deleted

If an account is deleted, immediately recompute the aggregate
security policy, and apply it immediately.

When applying policies, handle "no policy" case by releasing device admin
status entirely.
diff --git a/src/com/android/exchange/SyncManager.java b/src/com/android/exchange/SyncManager.java
index 9631dfc..1737a2b 100644
--- a/src/com/android/exchange/SyncManager.java
+++ b/src/com/android/exchange/SyncManager.java
@@ -19,6 +19,7 @@
 
 import com.android.email.AccountBackupRestore;
 import com.android.email.Email;
+import com.android.email.SecurityPolicy;
 import com.android.email.mail.MessagingException;
 import com.android.email.mail.store.TrustManagerFactory;
 import com.android.email.provider.EmailContent;
@@ -1283,9 +1284,10 @@
                 accountsDeleted = true;
             }
         }
-        // If we changed the list of accounts, refresh the backup
+        // If we changed the list of accounts, refresh the backup & security settings
         if (accountsDeleted) {
             AccountBackupRestore.backupAccounts(getContext());
+            SecurityPolicy.getInstance(context).reducePolicies();
         }
     }