From 3e8ff1a647854eb818faf3a7140da3a98c2c196b Mon Sep 17 00:00:00 2001 From: Yu Ping Hu Date: Mon, 24 Feb 2014 17:34:37 -0800 Subject: [PATCH] Add pushModify to IEmailService. This call lets the service know that the push settings for an account have changed. Change-Id: I7ed41853df6af6762c80283a2a3510ce41551657 (cherry picked from commit 446136a2278652c627068ecddff534de1ad431ab) --- .../emailcommon/service/EmailServiceProxy.java | 15 +++++++++++++++ .../emailcommon/service/IEmailService.aidl | 7 +++++++ .../android/email/service/EmailServiceStub.java | 5 +++++ .../android/email/service/EmailServiceUtils.java | 4 ++++ 4 files changed, 31 insertions(+) diff --git a/emailcommon/src/com/android/emailcommon/service/EmailServiceProxy.java b/emailcommon/src/com/android/emailcommon/service/EmailServiceProxy.java index 706e459d1..c5442947d 100644 --- a/emailcommon/src/com/android/emailcommon/service/EmailServiceProxy.java +++ b/emailcommon/src/com/android/emailcommon/service/EmailServiceProxy.java @@ -310,6 +310,21 @@ public class EmailServiceProxy extends ServiceProxy implements IEmailService { }, "sendMail"); } + /** + * Request the service to refresh its push notification status (e.g. to start or stop receiving + * them, or to change which folders we want notifications for). + * @param accountId The account whose push settings to modify. + */ + @Override + public void pushModify(final long accountId) throws RemoteException { + setTask(new ProxyTask() { + @Override + public void run() throws RemoteException{ + mService.pushModify(accountId); + } + }, "sendMail"); + } + @Override public IBinder asBinder() { return null; diff --git a/emailcommon/src/com/android/emailcommon/service/IEmailService.aidl b/emailcommon/src/com/android/emailcommon/service/IEmailService.aidl index d8f550bd3..2e2ea46de 100644 --- a/emailcommon/src/com/android/emailcommon/service/IEmailService.aidl +++ b/emailcommon/src/com/android/emailcommon/service/IEmailService.aidl @@ -30,7 +30,14 @@ interface IEmailService { oneway void loadAttachment(IEmailServiceCallback cb, long attachmentId, boolean background); oneway void updateFolderList(long accountId); + // Push-related functionality. + + // Notify the service that the push configuration has changed for an account. + void pushModify(long accountId); + // Other email operations. + // TODO: Decouple this call from HostAuth (i.e. use a dedicated data structure, or just pass + // the necessary strings directly). Bundle validate(in HostAuth hostauth); int searchMessages(long accountId, in SearchParams params, long destMailboxId); diff --git a/src/com/android/email/service/EmailServiceStub.java b/src/com/android/email/service/EmailServiceStub.java index 215d553a0..d5b29355d 100644 --- a/src/com/android/email/service/EmailServiceStub.java +++ b/src/com/android/email/service/EmailServiceStub.java @@ -385,6 +385,11 @@ public abstract class EmailServiceStub extends IEmailService.Stub implements IEm return 0; } + @Override + public void pushModify(long accountId) throws RemoteException { + LogUtils.e(Logging.LOG_TAG, "pushModify invalid for account type for %d", accountId); + } + @Override public void sendMail(long accountId) throws RemoteException { sendMailImpl(mContext, accountId); diff --git a/src/com/android/email/service/EmailServiceUtils.java b/src/com/android/email/service/EmailServiceUtils.java index 03c83e06f..0996c9ebc 100644 --- a/src/com/android/email/service/EmailServiceUtils.java +++ b/src/com/android/email/service/EmailServiceUtils.java @@ -668,5 +668,9 @@ public class EmailServiceUtils { @Override public void sendMail(long accountId) throws RemoteException { } + + @Override + public void pushModify(long accountId) throws RemoteException { + } } }