Remove ExchangeBroadcastReceiver.

Moving account reconciliation code to Email.

Change-Id: I0ec5f1b3c245ac035c1ff7bd09e30b9edd961d29
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index a739b31..89f28c1 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -76,22 +76,6 @@
         <receiver
             android:name="com.android.emailsync.MailboxAlarmReceiver"/>
 
-        <receiver
-            android:name=".service.ExchangeBroadcastReceiver"
-            android:enabled="true">
-            <intent-filter>
-                <action
-                    android:name="android.intent.action.DEVICE_STORAGE_LOW" />
-                <action
-                    android:name="android.intent.action.DEVICE_STORAGE_OK" />
-                <action
-                    android:name="android.accounts.LOGIN_ACCOUNTS_CHANGED" />
-            </intent-filter>
-        </receiver>
-
-        <service
-            android:name=".service.ExchangeBroadcastProcessorService" />
-
         <!--Required stanza to register the EAS EmailSyncAdapterService with SyncManager -->
         <service
             android:name="com.android.exchange.service.EmailSyncAdapterService"
diff --git a/src/com/android/exchange/service/ExchangeBroadcastProcessorService.java b/src/com/android/exchange/service/ExchangeBroadcastProcessorService.java
deleted file mode 100644
index 5361270..0000000
--- a/src/com/android/exchange/service/ExchangeBroadcastProcessorService.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.exchange.service;
-
-import android.accounts.AccountManager;
-import android.app.IntentService;
-import android.content.Context;
-import android.content.Intent;
-
-import com.android.emailcommon.Logging;
-import com.android.emailcommon.service.AccountServiceProxy;
-import com.android.exchange.Eas;
-import com.android.mail.utils.LogUtils;
-
-/**
- * The service that really handles broadcast intents on a worker thread.
- *
- * We make it a service, because:
- * <ul>
- *   <li>So that it's less likely for the process to get killed.
- *   <li>Even if it does, the Intent that have started it will be re-delivered by the system,
- *   and we can start the process again.  (Using {@link #setIntentRedelivery}).
- * </ul>
- */
-public class ExchangeBroadcastProcessorService extends IntentService {
-    // Action used for BroadcastReceiver entry point
-    private static final String ACTION_BROADCAST = "broadcast_receiver";
-
-    public ExchangeBroadcastProcessorService() {
-        // Class name will be the thread name.
-        super(ExchangeBroadcastProcessorService.class.getName());
-        // Intent should be redelivered if the process gets killed before completing the job.
-        setIntentRedelivery(true);
-    }
-
-    /**
-     * Entry point for {@link ExchangeBroadcastReceiver}.
-     */
-    public static void processBroadcastIntent(Context context, Intent broadcastIntent) {
-        Intent i = new Intent(context, ExchangeBroadcastProcessorService.class);
-        i.setAction(ACTION_BROADCAST);
-        i.putExtra(Intent.EXTRA_INTENT, broadcastIntent);
-        context.startService(i);
-    }
-
-    @Override
-    protected void onHandleIntent(Intent intent) {
-        // Dispatch from entry point
-        final String action = intent.getAction();
-        if (ACTION_BROADCAST.equals(action)) {
-            final Intent broadcastIntent = intent.getParcelableExtra(Intent.EXTRA_INTENT);
-            final String broadcastAction = broadcastIntent.getAction();
-
-            if (AccountManager.LOGIN_ACCOUNTS_CHANGED_ACTION.equals(broadcastAction)) {
-                if (Eas.USER_LOG) {
-                    LogUtils.d(Logging.LOG_TAG, "Login accounts changed; reconciling...");
-                }
-                new AccountServiceProxy(this).reconcileAccounts(Eas.PROTOCOL,
-                        Eas.EXCHANGE_ACCOUNT_MANAGER_TYPE);
-            }
-       }
-    }
-}
diff --git a/src/com/android/exchange/service/ExchangeBroadcastReceiver.java b/src/com/android/exchange/service/ExchangeBroadcastReceiver.java
deleted file mode 100644
index e79eec0..0000000
--- a/src/com/android/exchange/service/ExchangeBroadcastReceiver.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.exchange.service;
-
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.Intent;
-
-/**
- * The broadcast receiver.  The actual job is done in EmailBroadcastProcessor on a worker thread.
- */
-public class ExchangeBroadcastReceiver extends BroadcastReceiver {
-    @Override
-    public void onReceive(Context context, Intent intent) {
-        ExchangeBroadcastProcessorService.processBroadcastIntent(context, intent);
-    }
-}