diff options
| author | Martin Hibdon <mhibdon@google.com> | 2014-06-12 10:59:57 -0700 |
|---|---|---|
| committer | Martin Hibdon <mhibdon@google.com> | 2014-06-18 14:19:34 -0700 |
| commit | fb2a3a2f77f954265beaa92b87774006e2d7c185 (patch) | |
| tree | 653ac327b17ef6952484cf1b3035fa91b77e0d8c /src | |
| parent | b71fe22a93a3b2e0ddae0e18bb3986671657fe08 (diff) | |
| download | android_packages_apps_Email-fb2a3a2f77f954265beaa92b87774006e2d7c185.tar.gz android_packages_apps_Email-fb2a3a2f77f954265beaa92b87774006e2d7c185.tar.bz2 android_packages_apps_Email-fb2a3a2f77f954265beaa92b87774006e2d7c185.zip | |
Update IEmailService
This is not yet finalized, but it's needed to fix push syncs
on exchange.
Change-Id: Iaff20aa0bdea9685ef6603de1f861d58fbab6ff1
Diffstat (limited to 'src')
| -rw-r--r-- | src/com/android/email/service/EmailServiceStub.java | 42 | ||||
| -rw-r--r-- | src/com/android/email/service/EmailServiceUtils.java | 15 |
2 files changed, 31 insertions, 26 deletions
diff --git a/src/com/android/email/service/EmailServiceStub.java b/src/com/android/email/service/EmailServiceStub.java index c0c668ea0..2e20a93d6 100644 --- a/src/com/android/email/service/EmailServiceStub.java +++ b/src/com/android/email/service/EmailServiceStub.java @@ -281,9 +281,12 @@ public abstract class EmailServiceStub extends IEmailService.Stub implements IEm } @Override - public void updateFolderList(long accountId) throws RemoteException { + public void updateFolderList(final long accountId) throws RemoteException { final Account account = Account.restoreAccountWithId(mContext, accountId); - if (account == null) return; + if (account == null) { + LogUtils.e(LogUtils.TAG, "Account %d not found in updateFolderList", accountId); + return; + }; long inboxId = -1; TrafficStats.setThreadStatsTag(TrafficFlags.getSyncFlags(mContext, account)); Cursor localFolderCursor = null; @@ -350,6 +353,9 @@ public abstract class EmailServiceStub extends IEmailService.Stub implements IEm } catch (MessagingException me) { LogUtils.i(Logging.LOG_TAG, me, "Error in updateFolderList"); // We'll hope this is temporary + // TODO: Figure out what type of messaging exception it was and return an appropriate + // result. If we start doing this from sync, it's important to let the sync manager + // know if the failure was due to IO error or authentication errors. } finally { if (localFolderCursor != null) { localFolderCursor.close(); @@ -365,18 +371,20 @@ public abstract class EmailServiceStub extends IEmailService.Stub implements IEm } @Override - public void setLogging(int on) throws RemoteException { + public void setLogging(final int flags) throws RemoteException { // Not required } @Override - public Bundle autoDiscover(String userName, String password) throws RemoteException { + public Bundle autoDiscover(final String userName, final String password) + throws RemoteException { // Not required return null; } @Override - public void sendMeetingResponse(long messageId, int response) throws RemoteException { + public void sendMeetingResponse(final long messageId, final int response) + throws RemoteException { // Not required } @@ -386,32 +394,35 @@ public abstract class EmailServiceStub extends IEmailService.Stub implements IEm } @Override - public int searchMessages(long accountId, SearchParams params, long destMailboxId) + public int searchMessages(final long accountId, final SearchParams params, + final long destMailboxId) throws RemoteException { // Not required - return 0; + return EmailServiceStatus.SUCCESS; } @Override - public void pushModify(long accountId) throws RemoteException { + public void pushModify(final long accountId) throws RemoteException { LogUtils.e(Logging.LOG_TAG, "pushModify invalid for account type for %d", accountId); } @Override - public void syncFolders(final long accountId, final boolean updateFolderList, - final long[] folders) {} + public int sync(final long accountId, final Bundle syncExtras) { + return EmailServiceStatus.SUCCESS; - @Override - public void syncMailboxType(final long accountId, final boolean updateFolderList, - final int mailboxType) {} + } @Override - public void sendMail(long accountId) throws RemoteException { + public void sendMail(final long accountId) throws RemoteException { sendMailImpl(mContext, accountId); } - public static void sendMailImpl(Context context, long accountId) { + public static void sendMailImpl(final Context context, final long accountId) { final Account account = Account.restoreAccountWithId(context, accountId); + if (account == null) { + LogUtils.e(LogUtils.TAG, "account %d not found in sendMailImpl", accountId); + return; + } TrafficStats.setThreadStatsTag(TrafficFlags.getSmtpFlags(context, account)); final NotificationController nc = NotificationController.getInstance(context); // 1. Loop through all messages in the account's outbox @@ -503,6 +514,5 @@ public abstract class EmailServiceStub extends IEmailService.Stub implements IEm } finally { c.close(); } - } } diff --git a/src/com/android/email/service/EmailServiceUtils.java b/src/com/android/email/service/EmailServiceUtils.java index 00914b72c..6218937bf 100644 --- a/src/com/android/email/service/EmailServiceUtils.java +++ b/src/com/android/email/service/EmailServiceUtils.java @@ -53,6 +53,7 @@ import com.android.emailcommon.provider.EmailContent.AccountColumns; import com.android.emailcommon.provider.EmailContent.HostAuthColumns; import com.android.emailcommon.provider.HostAuth; import com.android.emailcommon.service.EmailServiceProxy; +import com.android.emailcommon.service.EmailServiceStatus; import com.android.emailcommon.service.IEmailService; import com.android.emailcommon.service.IEmailServiceCallback; import com.android.emailcommon.service.SearchParams; @@ -663,11 +664,10 @@ public class EmailServiceUtils { } @Override - public void updateFolderList(long accountId) throws RemoteException { - } + public void updateFolderList(long accountId) throws RemoteException {} @Override - public void setLogging(int on) throws RemoteException { + public void setLogging(int flags) throws RemoteException { } @Override @@ -698,13 +698,8 @@ public class EmailServiceUtils { } @Override - public void syncFolders(final long accountId, final boolean updateFolderList, - final long[] folders) { - } - - @Override - public void syncMailboxType(final long accountId, final boolean updateFolderList, - final int mailboxType) { + public int sync(final long accountId, final Bundle syncExtras) { + return EmailServiceStatus.SUCCESS; } } |
