From 4994e7ca505717800d6e0bc6f7a293d4b5291452 Mon Sep 17 00:00:00 2001 From: Scott Kennedy Date: Fri, 3 May 2013 18:49:51 -0700 Subject: [PATCH] Reply-all migration Bug: 8546815 Change-Id: I6b41aee84f0e1dfdbed4b7b2e843b6268659ee20 --- src/com/android/email/Preferences.java | 14 ++++++++++++++ .../mail/preferences/PreferenceMigrator.java | 9 +++++++++ 2 files changed, 23 insertions(+) diff --git a/src/com/android/email/Preferences.java b/src/com/android/email/Preferences.java index a9712882d..5bfbddacd 100644 --- a/src/com/android/email/Preferences.java +++ b/src/com/android/email/Preferences.java @@ -57,6 +57,8 @@ public class Preferences { @Deprecated private static final String SWIPE_DELETE = "swipe_delete"; private static final String CONV_LIST_ICON = "conversation_list_icons"; + @Deprecated + private static final String REPLY_ALL = "reply_all"; public static final int AUTO_ADVANCE_NEWER = 0; public static final int AUTO_ADVANCE_OLDER = 1; @@ -233,6 +235,18 @@ public class Preferences { return mSharedPreferences.getBoolean(SWIPE_DELETE, false); } + /** @deprecated Only used for migration */ + @Deprecated + public boolean hasReplyAll() { + return mSharedPreferences.contains(REPLY_ALL); + } + + /** @deprecated Only used for migration */ + @Deprecated + public boolean getReplyAll() { + return mSharedPreferences.getBoolean(REPLY_ALL, false); + } + public int getTextZoom() { return mSharedPreferences.getInt(TEXT_ZOOM, TEXT_ZOOM_DEFAULT); } diff --git a/src/com/android/mail/preferences/PreferenceMigrator.java b/src/com/android/mail/preferences/PreferenceMigrator.java index fcb27e852..9b84a89ca 100644 --- a/src/com/android/mail/preferences/PreferenceMigrator.java +++ b/src/com/android/mail/preferences/PreferenceMigrator.java @@ -78,6 +78,15 @@ public class PreferenceMigrator extends BasePreferenceMigrator { mailPrefs.setConversationListSwipeEnabled(swipeDelete); } + // Move reply-all setting + @SuppressWarnings("deprecation") + final boolean isReplyAllSet = preferences.hasReplyAll(); + if (isReplyAllSet) { + @SuppressWarnings("deprecation") + final boolean replyAll = preferences.getReplyAll(); + mailPrefs.setDefaultReplyAll(replyAll); + } + // Move folder notification settings for (final Account account : accounts) { // The only setting in AccountPreferences so far is a global notification toggle,