diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 08d40b0b4..53ba9d252 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -154,7 +154,7 @@ > diff --git a/src/com/android/email/NotificationController.java b/src/com/android/email/NotificationController.java index 7c6dad272..5d6a8bc4e 100644 --- a/src/com/android/email/NotificationController.java +++ b/src/com/android/email/NotificationController.java @@ -19,7 +19,7 @@ package com.android.email; import com.android.email.activity.ContactStatusLoader; import com.android.email.activity.Welcome; import com.android.email.activity.setup.AccountSecurity; -import com.android.email.activity.setup.AccountSettingsXL; +import com.android.email.activity.setup.AccountSettings; import com.android.emailcommon.Logging; import com.android.emailcommon.mail.Address; import com.android.emailcommon.provider.EmailContent; @@ -490,7 +490,7 @@ public class NotificationController { mContext.getString(R.string.login_failed_ticker, account.mDisplayName), mContext.getString(R.string.login_failed_title), account.getDisplayName(), - AccountSettingsXL.createAccountSettingsIntent(mContext, accountId, + AccountSettings.createAccountSettingsIntent(mContext, accountId, account.mDisplayName), getLoginFailedNotificationId(accountId)); } diff --git a/src/com/android/email/activity/UIControllerBase.java b/src/com/android/email/activity/UIControllerBase.java index 2d6f4aae8..3e9cd2bec 100644 --- a/src/com/android/email/activity/UIControllerBase.java +++ b/src/com/android/email/activity/UIControllerBase.java @@ -19,7 +19,7 @@ package com.android.email.activity; import com.android.email.Email; import com.android.email.R; import com.android.email.RefreshManager; -import com.android.email.activity.setup.AccountSettingsXL; +import com.android.email.activity.setup.AccountSettings; import com.android.emailcommon.Logging; import com.android.emailcommon.provider.EmailContent.Account; import com.android.emailcommon.utility.EmailAsyncTask; @@ -367,7 +367,7 @@ abstract class UIControllerBase { * Handles the "Settings" option item. Opens the settings activity. */ private boolean onAccountSettings() { - AccountSettingsXL.actionSettings(mActivity, getActualAccountId()); + AccountSettings.actionSettings(mActivity, getActualAccountId()); return true; } diff --git a/src/com/android/email/activity/setup/AccountServerBaseFragment.java b/src/com/android/email/activity/setup/AccountServerBaseFragment.java index 0c389ec27..c763902e0 100644 --- a/src/com/android/email/activity/setup/AccountServerBaseFragment.java +++ b/src/com/android/email/activity/setup/AccountServerBaseFragment.java @@ -163,8 +163,8 @@ public abstract class AccountServerBaseFragment extends Fragment mContext = activity; // Notify the activity that we're here. - if (activity instanceof AccountSettingsXL) { - ((AccountSettingsXL)activity).onAttach(this); + if (activity instanceof AccountSettings) { + ((AccountSettings)activity).onAttach(this); } } diff --git a/src/com/android/email/activity/setup/AccountSettingsXL.java b/src/com/android/email/activity/setup/AccountSettings.java similarity index 96% rename from src/com/android/email/activity/setup/AccountSettingsXL.java rename to src/com/android/email/activity/setup/AccountSettings.java index 8ba0467fb..83c34e3e8 100644 --- a/src/com/android/email/activity/setup/AccountSettingsXL.java +++ b/src/com/android/email/activity/setup/AccountSettings.java @@ -17,7 +17,6 @@ package com.android.email.activity.setup; import com.android.email.Controller; -import com.android.email.NotificationController; import com.android.email.R; import com.android.email.activity.ActivityHelper; import com.android.email.activity.IntentUtilities; @@ -61,13 +60,13 @@ import java.util.List; * GeneralPreferences * DebugFragment * - * TODO: In Account settings in Phone UI, change title + * TODO: In Account settings in Phone UI, change action bar title depending on active fragment * TODO: Delete account - on single-pane view (phone UX) the account list doesn't update properly * TODO: Handle dynamic changes to the account list (exit if necessary). It probably makes * sense to use a loader for the accounts list, because it would provide better support for * dealing with accounts being added/deleted and triggering the header reload. */ -public class AccountSettingsXL extends PreferenceActivity { +public class AccountSettings extends PreferenceActivity { /* * Intent to open account settings for account=1 adb shell am start -a android.intent.action.EDIT \ @@ -146,7 +145,7 @@ public class AccountSettingsXL extends PreferenceActivity { * Launch generic settings and pre-enable the debug preferences */ public static void actionSettingsWithDebug(Context fromContext) { - Intent i = new Intent(fromContext, AccountSettingsXL.class); + Intent i = new Intent(fromContext, AccountSettings.class); i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); i.putExtra(EXTRA_ENABLE_DEBUG, true); fromContext.startActivity(i); @@ -449,13 +448,13 @@ public class AccountSettingsXL extends PreferenceActivity { @Override protected void onPostExecute(Object[] result) { - if (this.isCancelled() || result == null) return; + if (isCancelled() || result == null) return; // Extract the results Header[] headers = (Header[]) result[0]; boolean deletingAccountFound = (Boolean) result[1]; // report the settings mAccountListHeaders = headers; - AccountSettingsXL.this.invalidateHeaders(); + invalidateHeaders(); if (!deletingAccountFound) { mDeletingAccountId = -1; } @@ -542,20 +541,25 @@ public class AccountSettingsXL extends PreferenceActivity { * Callbacks for AccountSettingsFragment */ private class AccountSettingsFragmentCallback implements AccountSettingsFragment.Callback { + @Override public void onSettingsChanged(Account account, String preference, Object value) { - AccountSettingsXL.this.onSettingsChanged(account, preference, value); + AccountSettings.this.onSettingsChanged(account, preference, value); } + @Override public void onIncomingSettings(Account account) { - AccountSettingsXL.this.onIncomingSettings(account); + AccountSettings.this.onIncomingSettings(account); } + @Override public void onOutgoingSettings(Account account) { - AccountSettingsXL.this.onOutgoingSettings(account); + AccountSettings.this.onOutgoingSettings(account); } + @Override public void abandonEdit() { finish(); } + @Override public void deleteAccount(Account account) { - AccountSettingsXL.this.deleteAccount(account); + AccountSettings.this.deleteAccount(account); } } @@ -692,16 +696,16 @@ public class AccountSettingsXL extends PreferenceActivity { Intent intent = params[0]; android.accounts.Account acct = (android.accounts.Account) intent.getParcelableExtra(EXTRA_ACCOUNT_MANAGER_ACCOUNT); - return Utility.getFirstRowLong(AccountSettingsXL.this, Account.CONTENT_URI, - Account.ID_PROJECTION, SELECTION_ACCOUNT_EMAIL_ADDRESS, new String[] {acct.name}, - null, Account.ID_PROJECTION_COLUMN, -1L); + return Utility.getFirstRowLong(AccountSettings.this, Account.CONTENT_URI, + Account.ID_PROJECTION, SELECTION_ACCOUNT_EMAIL_ADDRESS, + new String[] {acct.name}, null, Account.ID_PROJECTION_COLUMN, -1L); } @Override protected void onPostExecute(Long accountId) { if (accountId != -1 && !isCancelled()) { mRequestedAccountId = accountId; - AccountSettingsXL.this.invalidateHeaders(); + invalidateHeaders(); } } } @@ -731,7 +735,7 @@ public class AccountSettingsXL extends PreferenceActivity { /** * Creates a save changes dialog when the user navigates "back". - * {@link AccountSettingsXL#onBackPressed()} defines in which case this may be triggered. + * {@link #onBackPressed()} defines in which case this may be triggered. */ public static UnsavedChangesDialogFragment newInstanceForBack() { UnsavedChangesDialogFragment f = new UnsavedChangesDialogFragment(); @@ -747,7 +751,7 @@ public class AccountSettingsXL extends PreferenceActivity { @Override public Dialog onCreateDialog(Bundle savedInstanceState) { - final AccountSettingsXL activity = (AccountSettingsXL) getActivity(); + final AccountSettings activity = (AccountSettings) getActivity(); final int position = getArguments().getInt(BUNDLE_KEY_HEADER); final boolean isBack = getArguments().getBoolean(BUNDLE_KEY_BACK); diff --git a/src/com/android/email/activity/setup/AccountSettingsFragment.java b/src/com/android/email/activity/setup/AccountSettingsFragment.java index 2bd98b3b2..a0f67fc8f 100644 --- a/src/com/android/email/activity/setup/AccountSettingsFragment.java +++ b/src/com/android/email/activity/setup/AccountSettingsFragment.java @@ -159,8 +159,8 @@ public class AccountSettingsFragment extends PreferenceFragment { mContext = activity; // Notify the activity that we're here. - if (activity instanceof AccountSettingsXL) { - ((AccountSettingsXL)activity).onAttach(this); + if (activity instanceof AccountSettings) { + ((AccountSettings) activity).onAttach(this); } } @@ -586,7 +586,7 @@ public class AccountSettingsFragment extends PreferenceFragment { * Generic onPreferenceChanged listener for the preferences (above) that just need * to be written, without extra tweaks */ - private Preference.OnPreferenceChangeListener mPreferenceChangeListener = + private final Preference.OnPreferenceChangeListener mPreferenceChangeListener = new Preference.OnPreferenceChangeListener() { public boolean onPreferenceChange(Preference preference, Object newValue) { onPreferenceChanged(preference.getKey(), newValue); @@ -613,7 +613,7 @@ public class AccountSettingsFragment extends PreferenceFragment { Account.FLAGS_VIBRATE_ALWAYS | Account.FLAGS_VIBRATE_WHEN_SILENT | Account.FLAGS_BACKGROUND_ATTACHMENTS); - newFlags |= mAccountBackgroundAttachments.isChecked() ? + newFlags |= mAccountBackgroundAttachments.isChecked() ? Account.FLAGS_BACKGROUND_ATTACHMENTS : 0; mAccount.setDefaultAccount(mAccountDefault.isChecked()); // If the display name has been cleared, we'll reset it to the default value (email addr) diff --git a/src/com/android/email/activity/setup/AccountSetupBasics.java b/src/com/android/email/activity/setup/AccountSetupBasics.java index cbaf00a76..325d49919 100644 --- a/src/com/android/email/activity/setup/AccountSetupBasics.java +++ b/src/com/android/email/activity/setup/AccountSetupBasics.java @@ -542,7 +542,7 @@ public class AccountSetupBasics extends AccountSetupActivity if (ENTER_DEBUG_SCREEN && "d@d.d".equals(email) && "debug".equals(password)) { mEmailView.setText(""); mPasswordView.setText(""); - AccountSettingsXL.actionSettingsWithDebug(this); + AccountSettings.actionSettingsWithDebug(this); return; } diff --git a/src/com/android/email/service/EmailBroadcastProcessorService.java b/src/com/android/email/service/EmailBroadcastProcessorService.java index 12a20175d..ec477d3dc 100644 --- a/src/com/android/email/service/EmailBroadcastProcessorService.java +++ b/src/com/android/email/service/EmailBroadcastProcessorService.java @@ -21,7 +21,7 @@ import com.android.email.ExchangeUtils; import com.android.email.Preferences; import com.android.email.SecurityPolicy; import com.android.email.VendorPolicyLoader; -import com.android.email.activity.setup.AccountSettingsXL; +import com.android.email.activity.setup.AccountSettings; import com.android.email.mail.Store; import com.android.email.widget.WidgetManager; import com.android.emailcommon.Logging; @@ -119,7 +119,7 @@ public class EmailBroadcastProcessorService extends IntentService { enableComponentsIfNecessary(); } else if (ACTION_SECRET_CODE.equals(broadcastAction) && SECRET_CODE_HOST_DEBUG_SCREEN.equals(broadcastIntent.getData().getHost())) { - AccountSettingsXL.actionSettingsWithDebug(this); + AccountSettings.actionSettingsWithDebug(this); } else if (AccountManager.LOGIN_ACCOUNTS_CHANGED_ACTION.equals(broadcastAction)) { onSystemAccountChanged(); } diff --git a/tests/src/com/android/email/activity/setup/AccountSettingsXLTests.java b/tests/src/com/android/email/activity/setup/AccountSettingsTests.java similarity index 88% rename from tests/src/com/android/email/activity/setup/AccountSettingsXLTests.java rename to tests/src/com/android/email/activity/setup/AccountSettingsTests.java index 446e93b63..1567160c1 100644 --- a/tests/src/com/android/email/activity/setup/AccountSettingsXLTests.java +++ b/tests/src/com/android/email/activity/setup/AccountSettingsTests.java @@ -16,7 +16,6 @@ package com.android.email.activity.setup; -import com.android.email.activity.IntentUtilities; import com.android.email.mail.Store; import com.android.emailcommon.provider.EmailContent.Account; import com.android.emailcommon.utility.Utility; @@ -42,7 +41,7 @@ import java.net.URISyntaxException; * To execute: runtest -c com.android.email.activity.setup.AccountSettingsXLTests email */ @MediumTest -public class AccountSettingsXLTests extends ActivityInstrumentationTestCase2 { +public class AccountSettingsTests extends ActivityInstrumentationTestCase2 { private long mAccountId; private Account mAccount; @@ -52,8 +51,8 @@ public class AccountSettingsXLTests extends ActivityInstrumentationTestCase2