Delete a message from the outbox once it's sent
b/13347399
This functionality got lost when I made sending
an EasOperation.
Change-Id: I0de4aa06b9c575baa6414cdd48e9b86f88593e18
(cherry picked from commit 3f72ccad244824f81c327d39af026aee1f22f171)
diff --git a/src/com/android/exchange/eas/EasOutboxSync.java b/src/com/android/exchange/eas/EasOutboxSync.java
index dcc9d44..e20a0de 100644
--- a/src/com/android/exchange/eas/EasOutboxSync.java
+++ b/src/com/android/exchange/eas/EasOutboxSync.java
@@ -1,5 +1,6 @@
package com.android.exchange.eas;
+import android.content.ContentUris;
import android.content.Context;
import android.net.Uri;
import android.text.format.DateUtils;
@@ -139,12 +140,12 @@
@Override
protected void onRequestMade() {
- try {
- mFileStream.close();
- } catch (IOException e) {
- LogUtils.w(LOG_TAG, "IOException closing fileStream %s", e);
- }
- if (mTmpFile != null && mTmpFile.exists()) {
+ try {
+ mFileStream.close();
+ } catch (IOException e) {
+ LogUtils.w(LOG_TAG, "IOException closing fileStream %s", e);
+ }
+ if (mTmpFile != null && mTmpFile.exists()) {
mTmpFile.delete();
}
}
@@ -184,6 +185,8 @@
} else {
// FLAG: Do we need to parse results for earlier versions?
}
+ mContext.getContentResolver().delete(
+ ContentUris.withAppendedId(Message.CONTENT_URI, mMessage.mId), null, null);
return RESULT_OK;
}