Delete unused functions from IEmailService.aidl.

Change-Id: I32f13594f1639841b7d3f648f7e90d1bbc2cc67c
(cherry picked from commit 9b65e33c47be5170272eea4075aaa4f393539cdc)
diff --git a/src/com/android/exchange/ExchangeService.java b/src/com/android/exchange/ExchangeService.java
index f6ba28c..f6d97e5 100644
--- a/src/com/android/exchange/ExchangeService.java
+++ b/src/com/android/exchange/ExchangeService.java
@@ -33,12 +33,10 @@
 import android.provider.CalendarContract.Calendars;
 import android.provider.CalendarContract.Events;
 
-import com.android.emailcommon.Api;
 import com.android.emailcommon.provider.Account;
 import com.android.emailcommon.provider.EmailContent.Attachment;
 import com.android.emailcommon.provider.EmailContent.MailboxColumns;
 import com.android.emailcommon.provider.EmailContent.Message;
-import com.android.emailcommon.provider.EmailContent.SyncColumns;
 import com.android.emailcommon.provider.HostAuth;
 import com.android.emailcommon.provider.Mailbox;
 import com.android.emailcommon.provider.MailboxUtilities;
@@ -118,11 +116,6 @@
     private final IEmailService.Stub mBinder = new IEmailService.Stub() {
 
         @Override
-        public int getApiLevel() {
-            return Api.LEVEL;
-        }
-
-        @Override
         public Bundle validate(HostAuth hostAuth) throws RemoteException {
             return AbstractSyncService.validate(EasSyncService.class,
                     hostAuth, ExchangeService.this);
@@ -138,61 +131,6 @@
             return new EasSyncService().tryAutodiscover(ExchangeService.this, hostAuth);
         }
 
-        /**
-         * This is the remote call from the Email app, currently unused.
-         * TODO: remove this when it's been deleted from IEmailService.aidl.
-         */
-        @Deprecated
-        @Override
-        public void startSync(long mailboxId, boolean userRequest, int deltaMessageCount)
-                throws RemoteException {
-            SyncManager exchangeService = INSTANCE;
-            if (exchangeService == null) return;
-            checkExchangeServiceServiceRunning();
-            Mailbox m = Mailbox.restoreMailboxWithId(exchangeService, mailboxId);
-            if (m == null) return;
-            Account acct = Account.restoreAccountWithId(exchangeService, m.mAccountKey);
-            if (acct == null) return;
-            // If this is a user request and we're being held, release the hold; this allows us to
-            // try again (the hold might have been specific to this account and released already)
-            if (userRequest) {
-                if (onSyncDisabledHold(acct)) {
-                    releaseSyncHolds(exchangeService, AbstractSyncService.EXIT_ACCESS_DENIED, acct);
-                    log("User requested sync of account in sync disabled hold; releasing");
-                } else if (onSecurityHold(acct)) {
-                    releaseSyncHolds(exchangeService, AbstractSyncService.EXIT_SECURITY_FAILURE,
-                            acct);
-                    log("User requested sync of account in security hold; releasing");
-                }
-                if (sConnectivityHold) {
-                    return;
-                }
-            }
-            if (m.mType == Mailbox.TYPE_OUTBOX) {
-                // We're using SERVER_ID to indicate an error condition (it has no other use for
-                // sent mail)  Upon request to sync the Outbox, we clear this so that all messages
-                // are candidates for sending.
-                ContentValues cv = new ContentValues();
-                cv.put(SyncColumns.SERVER_ID, 0);
-                exchangeService.getContentResolver().update(Message.CONTENT_URI,
-                    cv, WHERE_MAILBOX_KEY, new String[] {Long.toString(mailboxId)});
-                // Clear the error state; the Outbox sync will be started from checkMailboxes
-                exchangeService.mSyncErrorMap.remove(mailboxId);
-                kick("start outbox");
-                // Outbox can't be synced in EAS
-                return;
-            } else if (!isSyncable(m)) {
-                return;
-            }
-            startManualSync(mailboxId, userRequest ? ExchangeService.SYNC_UI_REQUEST :
-                ExchangeService.SYNC_SERVICE_START_SYNC, null);
-        }
-
-        @Override
-        public void stopSync(long mailboxId) throws RemoteException {
-            stopManualSync(mailboxId);
-        }
-
         @Override
         public void loadAttachment(final IEmailServiceCallback callback, final long attachmentId,
                 final boolean background) throws RemoteException {
@@ -207,31 +145,6 @@
         }
 
         @Override
-        public void hostChanged(long accountId) throws RemoteException {
-            SyncManager exchangeService = INSTANCE;
-            if (exchangeService == null) return;
-            ConcurrentHashMap<Long, SyncError> syncErrorMap = exchangeService.mSyncErrorMap;
-            // Go through the various error mailboxes
-            for (long mailboxId: syncErrorMap.keySet()) {
-                SyncError error = syncErrorMap.get(mailboxId);
-                // If it's a login failure, look a little harder
-                Mailbox m = Mailbox.restoreMailboxWithId(exchangeService, mailboxId);
-                // If it's for the account whose host has changed, clear the error
-                // If the mailbox is no longer around, remove the entry in the map
-                if (m == null) {
-                    syncErrorMap.remove(mailboxId);
-                } else if (error != null && m.mAccountKey == accountId) {
-                    error.fatal = false;
-                    error.holdEndTime = 0;
-                }
-            }
-            // Stop any running syncs
-            exchangeService.stopAccountSyncs(accountId, true);
-            // Kick ExchangeService
-            kick("host changed");
-        }
-
-        @Override
         public void setLogging(int flags) throws RemoteException {
             // Protocol logging
             Eas.setUserDebug(flags);
@@ -244,27 +157,6 @@
             sendMessageRequest(new MeetingResponseRequest(messageId, response));
         }
 
-        @Override
-        public void loadMore(long messageId) throws RemoteException {
-        }
-
-        // The following three methods are not implemented in this version
-        @Override
-        public boolean createFolder(long accountId, String name) throws RemoteException {
-            return false;
-        }
-
-        @Override
-        public boolean deleteFolder(long accountId, String name) throws RemoteException {
-            return false;
-        }
-
-        @Override
-        public boolean renameFolder(long accountId, String oldName, String newName)
-                throws RemoteException {
-            return false;
-        }
-
         /**
          * Delete PIM (calendar, contacts) data for the specified account
          *
@@ -287,29 +179,6 @@
         @Override
         public void sendMail(long accountId) throws RemoteException {
         }
-
-        @Override
-        public int getCapabilities(Account acct) throws RemoteException {
-            String easVersion = acct.mProtocolVersion;
-            Double easVersionDouble = 2.5D;
-            if (easVersion != null) {
-                try {
-                    easVersionDouble = Double.parseDouble(easVersion);
-                } catch (NumberFormatException e) {
-                    // Stick with 2.5
-                }
-            }
-            if (easVersionDouble >= 12.0D) {
-                return EAS_12_CAPABILITIES;
-            } else {
-                return EAS_2_CAPABILITIES;
-            }
-        }
-
-        @Override
-        public void serviceUpdated(String emailAddress) throws RemoteException {
-            // Not required for EAS
-        }
     };
 
     /**
diff --git a/src/com/android/exchange/service/EmailSyncAdapterService.java b/src/com/android/exchange/service/EmailSyncAdapterService.java
index c7e9bf5..e7eae82 100644
--- a/src/com/android/exchange/service/EmailSyncAdapterService.java
+++ b/src/com/android/exchange/service/EmailSyncAdapterService.java
@@ -40,7 +40,6 @@
 import android.text.format.DateUtils;
 import android.util.Log;
 
-import com.android.emailcommon.Api;
 import com.android.emailcommon.TempDirectory;
 import com.android.emailcommon.provider.Account;
 import com.android.emailcommon.provider.EmailContent;
@@ -65,7 +64,6 @@
 import com.android.exchange.eas.EasPing;
 import com.android.exchange.eas.EasSync;
 import com.android.mail.providers.UIProvider;
-import com.android.mail.providers.UIProvider.AccountCapabilities;
 import com.android.mail.utils.LogUtils;
 
 import java.util.HashMap;
@@ -439,79 +437,6 @@
 
         @Override
         public void sendMail(final long accountId) {}
-
-        @Override
-        public int getCapabilities(final Account acct) {
-            String easVersion = acct.mProtocolVersion;
-            Double easVersionDouble = 2.5D;
-            if (easVersion != null) {
-                try {
-                    easVersionDouble = Double.parseDouble(easVersion);
-                } catch (NumberFormatException e) {
-                    // Stick with 2.5
-                }
-            }
-            if (easVersionDouble >= 12.0D) {
-                return AccountCapabilities.SYNCABLE_FOLDERS |
-                        AccountCapabilities.SERVER_SEARCH |
-                        AccountCapabilities.FOLDER_SERVER_SEARCH |
-                        AccountCapabilities.SMART_REPLY |
-                        AccountCapabilities.UNDO |
-                        AccountCapabilities.DISCARD_CONVERSATION_DRAFTS;
-            } else {
-                return AccountCapabilities.SYNCABLE_FOLDERS |
-                        AccountCapabilities.SMART_REPLY |
-                        AccountCapabilities.UNDO |
-                        AccountCapabilities.DISCARD_CONVERSATION_DRAFTS;
-            }
-        }
-
-        @Override
-        public void serviceUpdated(final String emailAddress) {
-            // Not required for EAS
-        }
-
-        // All IEmailService messages below are UNCALLED in Email.
-        // TODO: Remove.
-        @Deprecated
-        @Override
-        public int getApiLevel() {
-            return Api.LEVEL;
-        }
-
-        @Deprecated
-        @Override
-        public void startSync(long mailboxId, boolean userRequest, int deltaMessageCount) {}
-
-        @Deprecated
-        @Override
-        public void stopSync(long mailboxId) {}
-
-        @Deprecated
-        @Override
-        public void loadMore(long messageId) {}
-
-        @Deprecated
-        @Override
-        public boolean createFolder(long accountId, String name) {
-            return false;
-        }
-
-        @Deprecated
-        @Override
-        public boolean deleteFolder(long accountId, String name) {
-            return false;
-        }
-
-        @Deprecated
-        @Override
-        public boolean renameFolder(long accountId, String oldName, String newName) {
-            return false;
-        }
-
-        @Deprecated
-        @Override
-        public void hostChanged(long accountId) {}
     };
 
     public EmailSyncAdapterService() {