From f16a3f2f6a952640b07acfe669ac626c45cbd8cb Mon Sep 17 00:00:00 2001 From: Andrew Stadler Date: Thu, 1 Oct 2009 01:45:10 -0700 Subject: [PATCH] Cleanup delete handling issues in POP3 * Removed obsolete "delete after 7 days" option from pop-up prefs * Mark deleted message sentinels as "read" so they don't contribute to unread counts. Bug # 2157487 and Bug # 2159278 Change-Id: Ic3cbc51d6f5ede2eb923e2d0e5c0dfee377764f5 --- res/values/strings.xml | 4 ++-- src/com/android/email/MessagingController.java | 1 + .../android/email/activity/setup/AccountSetupIncoming.java | 7 +++---- src/com/android/email/provider/EmailContent.java | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index bf09f7c0c..fc811b901 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -33,6 +33,8 @@ + + @@ -380,8 +382,6 @@ Never - After 7 days - When I delete from Inbox diff --git a/src/com/android/email/MessagingController.java b/src/com/android/email/MessagingController.java index 7f5384088..879026ba0 100644 --- a/src/com/android/email/MessagingController.java +++ b/src/com/android/email/MessagingController.java @@ -1485,6 +1485,7 @@ public class MessagingController implements Runnable { sentinel.mAccountKey = oldMessage.mAccountKey; sentinel.mMailboxKey = oldMessage.mMailboxKey; sentinel.mFlagLoaded = EmailContent.Message.FLAG_LOADED_DELETED; + sentinel.mFlagRead = true; sentinel.mServerId = oldMessage.mServerId; sentinel.save(mContext); diff --git a/src/com/android/email/activity/setup/AccountSetupIncoming.java b/src/com/android/email/activity/setup/AccountSetupIncoming.java index 82eb2f37c..f8625e15e 100644 --- a/src/com/android/email/activity/setup/AccountSetupIncoming.java +++ b/src/com/android/email/activity/setup/AccountSetupIncoming.java @@ -16,6 +16,7 @@ package com.android.email.activity.setup; +import com.android.email.Account; import com.android.email.R; import com.android.email.Utility; import com.android.email.provider.EmailContent; @@ -119,11 +120,9 @@ public class AccountSetupIncoming extends Activity implements OnClickListener { }; SpinnerOption deletePolicies[] = { - new SpinnerOption(0, + new SpinnerOption(Account.DELETE_POLICY_NEVER, getString(R.string.account_setup_incoming_delete_policy_never_label)), - new SpinnerOption(1, - getString(R.string.account_setup_incoming_delete_policy_7days_label)), - new SpinnerOption(2, + new SpinnerOption(Account.DELETE_POLICY_ON_DELETE, getString(R.string.account_setup_incoming_delete_policy_delete_label)), }; diff --git a/src/com/android/email/provider/EmailContent.java b/src/com/android/email/provider/EmailContent.java index 430854468..65f677586 100644 --- a/src/com/android/email/provider/EmailContent.java +++ b/src/com/android/email/provider/EmailContent.java @@ -778,7 +778,7 @@ public abstract class EmailContent { public static final int FLAGS_DELETE_POLICY_SHIFT = 2; public static final int DELETE_POLICY_NEVER = 0; - public static final int DELETE_POLICY_7DAYS = 1; + public static final int DELETE_POLICY_7DAYS = 1; // not supported public static final int DELETE_POLICY_ON_DELETE = 2; // Sentinel values for the mSyncInterval field of both Account records