From 32614f3746f0fa8a09370672abaca68fa795fc33 Mon Sep 17 00:00:00 2001 From: Tony Mantler Date: Fri, 11 Oct 2013 16:44:57 -0700 Subject: [PATCH] Clean up usage of Account.name when accessing account/folder prefs b/11185963 Change-Id: Id928732bee5f67887252b1f949a8e4d396fffaa6 --- src/com/android/email/NotificationController.java | 2 +- .../android/email/activity/setup/AccountSettingsFragment.java | 4 ++-- src/com/android/email/activity/setup/AccountSetupOptions.java | 2 +- .../android/email/preferences/EmailPreferenceMigrator.java | 3 ++- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/com/android/email/NotificationController.java b/src/com/android/email/NotificationController.java index c0fb0e462..02dcf3505 100644 --- a/src/com/android/email/NotificationController.java +++ b/src/com/android/email/NotificationController.java @@ -321,7 +321,7 @@ public class NotificationController { if (folder != null) { final FolderPreferences folderPreferences = new FolderPreferences( - mContext, uiAccount.name, folder, true /* inbox */); + mContext, uiAccount.getEmailAddress(), folder, true /* inbox */); ringtoneUri = folderPreferences.getNotificationRingtoneUri(); vibrate = folderPreferences.isNotificationVibrateEnabled(); diff --git a/src/com/android/email/activity/setup/AccountSettingsFragment.java b/src/com/android/email/activity/setup/AccountSettingsFragment.java index bc2b3840f..212e007d6 100644 --- a/src/com/android/email/activity/setup/AccountSettingsFragment.java +++ b/src/com/android/email/activity/setup/AccountSettingsFragment.java @@ -581,9 +581,9 @@ public class AccountSettingsFragment extends PreferenceFragment } final AccountPreferences accountPreferences = - new AccountPreferences(mContext, mUiAccount.name); + new AccountPreferences(mContext, mUiAccount.getEmailAddress()); mInboxFolderPreferences = - new FolderPreferences(mContext, mUiAccount.name, folder, true); + new FolderPreferences(mContext, mUiAccount.getEmailAddress(), folder, true); NotificationUtils.moveNotificationSetting( accountPreferences, mInboxFolderPreferences); diff --git a/src/com/android/email/activity/setup/AccountSetupOptions.java b/src/com/android/email/activity/setup/AccountSetupOptions.java index 4134a9188..faf63ce04 100644 --- a/src/com/android/email/activity/setup/AccountSetupOptions.java +++ b/src/com/android/email/activity/setup/AccountSetupOptions.java @@ -254,7 +254,7 @@ public class AccountSetupOptions extends AccountSetupActivity implements OnClick // We can move the notification setting to the inbox FolderPreferences later, once // we know what the inbox is final AccountPreferences accountPreferences = - new AccountPreferences(context, account.mEmailAddress); + new AccountPreferences(context, account.getEmailAddress()); accountPreferences.setDefaultInboxNotificationsEnabled(mNotifyView.isChecked()); } }); diff --git a/src/com/android/email/preferences/EmailPreferenceMigrator.java b/src/com/android/email/preferences/EmailPreferenceMigrator.java index 1321a69a1..1562cc89f 100644 --- a/src/com/android/email/preferences/EmailPreferenceMigrator.java +++ b/src/com/android/email/preferences/EmailPreferenceMigrator.java @@ -144,7 +144,8 @@ public class EmailPreferenceMigrator extends BasePreferenceMigrator { } final FolderPreferences folderPreferences = - new FolderPreferences(context, account.name, folder, true /* inbox */); + new FolderPreferences(context, account.getEmailAddress(), folder, + true /* inbox */); @SuppressWarnings("deprecation") final boolean notify = (ecAccount.getFlags()