Rename AccountSettingsXL -> AccountSettings

This activity already supports phone and tablet mode.
Only renames in this change - no other change.

Change-Id: Ieca17137af45e3860812091f69cd4d9b55ddf3ec
This commit is contained in:
Ben Komalo 2011-05-12 17:27:56 -07:00
parent 82b136bba2
commit 2866284a6d
9 changed files with 45 additions and 42 deletions

View File

@ -154,7 +154,7 @@
>
</activity>
<activity
android:name=".activity.setup.AccountSettingsXL"
android:name=".activity.setup.AccountSettings"
android:label="@string/account_settings_action"
>
<intent-filter>

View File

@ -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));
}

View File

@ -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;
}

View File

@ -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);
}
}

View File

@ -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);

View File

@ -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)

View File

@ -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;
}

View File

@ -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();
}

View File

@ -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<AccountSettingsXL> {
public class AccountSettingsTests extends ActivityInstrumentationTestCase2<AccountSettings> {
private long mAccountId;
private Account mAccount;
@ -52,8 +51,8 @@ public class AccountSettingsXLTests extends ActivityInstrumentationTestCase2<Acc
private static final String PREFERENCE_FREQUENCY = "account_check_frequency";
public AccountSettingsXLTests() {
super(AccountSettingsXL.class);
public AccountSettingsTests() {
super(AccountSettings.class);
}
/**
@ -63,7 +62,7 @@ public class AccountSettingsXLTests extends ActivityInstrumentationTestCase2<Acc
protected void setUp() throws Exception {
super.setUp();
mContext = this.getInstrumentation().getTargetContext();
mContext = getInstrumentation().getTargetContext();
}
/**
@ -86,7 +85,7 @@ public class AccountSettingsXLTests extends ActivityInstrumentationTestCase2<Acc
public void disable_testPushOptionPOP() throws Throwable {
Intent i = getTestIntent("Name", "pop3://user:password@server.com",
"smtp://user:password@server.com");
this.setActivityIntent(i);
setActivityIntent(i);
getActivityAndFields();
@ -100,7 +99,7 @@ public class AccountSettingsXLTests extends ActivityInstrumentationTestCase2<Acc
public void disable_testPushOptionIMAP() throws Throwable {
Intent i = getTestIntent("Name", "imap://user:password@server.com",
"smtp://user:password@server.com");
this.setActivityIntent(i);
setActivityIntent(i);
getActivityAndFields();
@ -113,14 +112,14 @@ public class AccountSettingsXLTests extends ActivityInstrumentationTestCase2<Acc
*/
public void disable_testPushOptionEAS() throws Throwable {
// This test should only be run if EAS is supported
if (Store.StoreInfo.getStoreInfo("eas", this.getInstrumentation().getTargetContext())
if (Store.StoreInfo.getStoreInfo("eas", getInstrumentation().getTargetContext())
== null) {
return;
}
Intent i = getTestIntent("Name", "eas://user:password@server.com",
"eas://user:password@server.com");
this.setActivityIntent(i);
setActivityIntent(i);
getActivityAndFields();
@ -132,12 +131,12 @@ public class AccountSettingsXLTests extends ActivityInstrumentationTestCase2<Acc
* Get the activity (which causes it to be started, using our intent) and get the UI fields
*/
private void getActivityAndFields() throws Throwable {
final AccountSettingsXL theActivity = getActivity();
final AccountSettings theActivity = getActivity();
runTestOnUiThread(new Runnable() {
public void run() {
PreferenceFragment f = (PreferenceFragment) theActivity.mCurrentFragment;
AccountSettingsXLTests.this.mCheckFrequency =
mCheckFrequency =
(ListPreference) f.findPreference(PREFERENCE_FREQUENCY);
}
});
@ -170,7 +169,7 @@ public class AccountSettingsXLTests extends ActivityInstrumentationTestCase2<Acc
mAccount.save(mContext);
mAccountId = mAccount.mId;
return AccountSettingsXL.createAccountSettingsIntent(mContext, mAccountId, null);
return AccountSettings.createAccountSettingsIntent(mContext, mAccountId, null);
}
}