summaryrefslogtreecommitdiffstats
path: root/emailcommon
diff options
context:
space:
mode:
authorMartin Hibdon <mhibdon@google.com>2014-07-10 15:08:29 -0700
committerMartin Hibdon <mhibdon@google.com>2014-07-11 15:49:45 -0700
commit7afbeee47e1a82680c815f2fb8cfdba32d6b0b84 (patch)
tree9c537f94ed6d78cb746914f1c563b4c432f43ecf /emailcommon
parentf79ed0f54fb0cf8ec081d72ccaffdaf18fd7e0dd (diff)
downloadandroid_packages_apps_Email-7afbeee47e1a82680c815f2fb8cfdba32d6b0b84.tar.gz
android_packages_apps_Email-7afbeee47e1a82680c815f2fb8cfdba32d6b0b84.tar.bz2
android_packages_apps_Email-7afbeee47e1a82680c815f2fb8cfdba32d6b0b84.zip
Update IEmailService
Add version support Change deleteAccountPIMData to deleteExternalAccountPIMData. Data kept inside the EmailProvider can be deleted from within the Email app. Only external data (e.g. contacts and calendar) need to be deleted by the service which has protocol specific knowlege. Change-Id: I875d3051d0cfdbaf52775ec20eb114a345894a93
Diffstat (limited to 'emailcommon')
-rw-r--r--emailcommon/src/com/android/emailcommon/service/EmailServiceProxy.java23
-rw-r--r--emailcommon/src/com/android/emailcommon/service/EmailServiceVersion.java10
-rw-r--r--emailcommon/src/com/android/emailcommon/service/IEmailService.aidl5
3 files changed, 33 insertions, 5 deletions
diff --git a/emailcommon/src/com/android/emailcommon/service/EmailServiceProxy.java b/emailcommon/src/com/android/emailcommon/service/EmailServiceProxy.java
index eefa5743d..1c1f0ebc9 100644
--- a/emailcommon/src/com/android/emailcommon/service/EmailServiceProxy.java
+++ b/emailcommon/src/com/android/emailcommon/service/EmailServiceProxy.java
@@ -33,7 +33,7 @@ import java.io.IOException;
/**
* The EmailServiceProxy class provides a simple interface for the UI to call into the various
- * EmailService classes (e.g. ExchangeService for EAS). It wraps the service connect/disconnect
+ * EmailService classes (e.g. EasService for EAS). It wraps the service connect/disconnect
* process so that the caller need not be concerned with it.
*
* Use the class like this:
@@ -256,11 +256,11 @@ public class EmailServiceProxy extends ServiceProxy implements IEmailService {
* @param emailAddress the email address for the account whose data should be deleted
*/
@Override
- public void deleteAccountPIMData(final String emailAddress) throws RemoteException {
+ public void deleteExternalAccountPIMData(final String emailAddress) throws RemoteException {
setTask(new ProxyTask() {
@Override
public void run() throws RemoteException {
- mService.deleteAccountPIMData(emailAddress);
+ mService.deleteExternalAccountPIMData(emailAddress);
}
}, "deleteAccountPIMData");
// This can be called when deleting accounts. After making this call, the caller will
@@ -352,4 +352,21 @@ public class EmailServiceProxy extends ServiceProxy implements IEmailService {
public IBinder asBinder() {
return null;
}
+
+ public int getApiVersion() {
+ setTask(new ProxyTask() {
+ @Override
+ public void run() throws RemoteException{
+ mReturn = mService.getApiVersion();
+ }
+ }, "getApiVersion");
+ waitForCompletion();
+ if (mReturn == null) {
+ // This occurs if there is a timeout or remote exception. Is not expected to happen.
+ LogUtils.wtf(TAG, "failed to get api version");
+ return -1;
+ } else {
+ return (Integer) mReturn;
+ }
+ }
}
diff --git a/emailcommon/src/com/android/emailcommon/service/EmailServiceVersion.java b/emailcommon/src/com/android/emailcommon/service/EmailServiceVersion.java
new file mode 100644
index 000000000..8a959a1ce
--- /dev/null
+++ b/emailcommon/src/com/android/emailcommon/service/EmailServiceVersion.java
@@ -0,0 +1,10 @@
+package com.android.emailcommon.service;
+
+public class EmailServiceVersion {
+ // Initial version
+ public static final int L_PLATFORM = 1;
+
+ public static final int CURRENT = L_PLATFORM;
+
+ // For each following version, add a comment explaining what apis where added or removed.
+}
diff --git a/emailcommon/src/com/android/emailcommon/service/IEmailService.aidl b/emailcommon/src/com/android/emailcommon/service/IEmailService.aidl
index f2212bbde..a6f49dc6c 100644
--- a/emailcommon/src/com/android/emailcommon/service/IEmailService.aidl
+++ b/emailcommon/src/com/android/emailcommon/service/IEmailService.aidl
@@ -60,6 +60,7 @@ interface IEmailService {
// trigger the service to reload the flags.
oneway void setLogging(int flags);
- // Needs to get moved into Email since this is NOT a client-server command.
- void deleteAccountPIMData(String emailAddress);
+ void deleteExternalAccountPIMData(String emailAddress);
+
+ int getApiVersion();
}