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:
parent
82b136bba2
commit
2866284a6d
@ -154,7 +154,7 @@
|
|||||||
>
|
>
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name=".activity.setup.AccountSettingsXL"
|
android:name=".activity.setup.AccountSettings"
|
||||||
android:label="@string/account_settings_action"
|
android:label="@string/account_settings_action"
|
||||||
>
|
>
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
|
@ -19,7 +19,7 @@ package com.android.email;
|
|||||||
import com.android.email.activity.ContactStatusLoader;
|
import com.android.email.activity.ContactStatusLoader;
|
||||||
import com.android.email.activity.Welcome;
|
import com.android.email.activity.Welcome;
|
||||||
import com.android.email.activity.setup.AccountSecurity;
|
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.Logging;
|
||||||
import com.android.emailcommon.mail.Address;
|
import com.android.emailcommon.mail.Address;
|
||||||
import com.android.emailcommon.provider.EmailContent;
|
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_ticker, account.mDisplayName),
|
||||||
mContext.getString(R.string.login_failed_title),
|
mContext.getString(R.string.login_failed_title),
|
||||||
account.getDisplayName(),
|
account.getDisplayName(),
|
||||||
AccountSettingsXL.createAccountSettingsIntent(mContext, accountId,
|
AccountSettings.createAccountSettingsIntent(mContext, accountId,
|
||||||
account.mDisplayName),
|
account.mDisplayName),
|
||||||
getLoginFailedNotificationId(accountId));
|
getLoginFailedNotificationId(accountId));
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ package com.android.email.activity;
|
|||||||
import com.android.email.Email;
|
import com.android.email.Email;
|
||||||
import com.android.email.R;
|
import com.android.email.R;
|
||||||
import com.android.email.RefreshManager;
|
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.Logging;
|
||||||
import com.android.emailcommon.provider.EmailContent.Account;
|
import com.android.emailcommon.provider.EmailContent.Account;
|
||||||
import com.android.emailcommon.utility.EmailAsyncTask;
|
import com.android.emailcommon.utility.EmailAsyncTask;
|
||||||
@ -367,7 +367,7 @@ abstract class UIControllerBase {
|
|||||||
* Handles the "Settings" option item. Opens the settings activity.
|
* Handles the "Settings" option item. Opens the settings activity.
|
||||||
*/
|
*/
|
||||||
private boolean onAccountSettings() {
|
private boolean onAccountSettings() {
|
||||||
AccountSettingsXL.actionSettings(mActivity, getActualAccountId());
|
AccountSettings.actionSettings(mActivity, getActualAccountId());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,8 +163,8 @@ public abstract class AccountServerBaseFragment extends Fragment
|
|||||||
mContext = activity;
|
mContext = activity;
|
||||||
|
|
||||||
// Notify the activity that we're here.
|
// Notify the activity that we're here.
|
||||||
if (activity instanceof AccountSettingsXL) {
|
if (activity instanceof AccountSettings) {
|
||||||
((AccountSettingsXL)activity).onAttach(this);
|
((AccountSettings)activity).onAttach(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
package com.android.email.activity.setup;
|
package com.android.email.activity.setup;
|
||||||
|
|
||||||
import com.android.email.Controller;
|
import com.android.email.Controller;
|
||||||
import com.android.email.NotificationController;
|
|
||||||
import com.android.email.R;
|
import com.android.email.R;
|
||||||
import com.android.email.activity.ActivityHelper;
|
import com.android.email.activity.ActivityHelper;
|
||||||
import com.android.email.activity.IntentUtilities;
|
import com.android.email.activity.IntentUtilities;
|
||||||
@ -61,13 +60,13 @@ import java.util.List;
|
|||||||
* GeneralPreferences
|
* GeneralPreferences
|
||||||
* DebugFragment
|
* 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: 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
|
* 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
|
* 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.
|
* 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
|
* Intent to open account settings for account=1
|
||||||
adb shell am start -a android.intent.action.EDIT \
|
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
|
* Launch generic settings and pre-enable the debug preferences
|
||||||
*/
|
*/
|
||||||
public static void actionSettingsWithDebug(Context fromContext) {
|
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.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
i.putExtra(EXTRA_ENABLE_DEBUG, true);
|
i.putExtra(EXTRA_ENABLE_DEBUG, true);
|
||||||
fromContext.startActivity(i);
|
fromContext.startActivity(i);
|
||||||
@ -449,13 +448,13 @@ public class AccountSettingsXL extends PreferenceActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPostExecute(Object[] result) {
|
protected void onPostExecute(Object[] result) {
|
||||||
if (this.isCancelled() || result == null) return;
|
if (isCancelled() || result == null) return;
|
||||||
// Extract the results
|
// Extract the results
|
||||||
Header[] headers = (Header[]) result[0];
|
Header[] headers = (Header[]) result[0];
|
||||||
boolean deletingAccountFound = (Boolean) result[1];
|
boolean deletingAccountFound = (Boolean) result[1];
|
||||||
// report the settings
|
// report the settings
|
||||||
mAccountListHeaders = headers;
|
mAccountListHeaders = headers;
|
||||||
AccountSettingsXL.this.invalidateHeaders();
|
invalidateHeaders();
|
||||||
if (!deletingAccountFound) {
|
if (!deletingAccountFound) {
|
||||||
mDeletingAccountId = -1;
|
mDeletingAccountId = -1;
|
||||||
}
|
}
|
||||||
@ -542,20 +541,25 @@ public class AccountSettingsXL extends PreferenceActivity {
|
|||||||
* Callbacks for AccountSettingsFragment
|
* Callbacks for AccountSettingsFragment
|
||||||
*/
|
*/
|
||||||
private class AccountSettingsFragmentCallback implements AccountSettingsFragment.Callback {
|
private class AccountSettingsFragmentCallback implements AccountSettingsFragment.Callback {
|
||||||
|
@Override
|
||||||
public void onSettingsChanged(Account account, String preference, Object value) {
|
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) {
|
public void onIncomingSettings(Account account) {
|
||||||
AccountSettingsXL.this.onIncomingSettings(account);
|
AccountSettings.this.onIncomingSettings(account);
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public void onOutgoingSettings(Account account) {
|
public void onOutgoingSettings(Account account) {
|
||||||
AccountSettingsXL.this.onOutgoingSettings(account);
|
AccountSettings.this.onOutgoingSettings(account);
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public void abandonEdit() {
|
public void abandonEdit() {
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public void deleteAccount(Account account) {
|
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];
|
Intent intent = params[0];
|
||||||
android.accounts.Account acct =
|
android.accounts.Account acct =
|
||||||
(android.accounts.Account) intent.getParcelableExtra(EXTRA_ACCOUNT_MANAGER_ACCOUNT);
|
(android.accounts.Account) intent.getParcelableExtra(EXTRA_ACCOUNT_MANAGER_ACCOUNT);
|
||||||
return Utility.getFirstRowLong(AccountSettingsXL.this, Account.CONTENT_URI,
|
return Utility.getFirstRowLong(AccountSettings.this, Account.CONTENT_URI,
|
||||||
Account.ID_PROJECTION, SELECTION_ACCOUNT_EMAIL_ADDRESS, new String[] {acct.name},
|
Account.ID_PROJECTION, SELECTION_ACCOUNT_EMAIL_ADDRESS,
|
||||||
null, Account.ID_PROJECTION_COLUMN, -1L);
|
new String[] {acct.name}, null, Account.ID_PROJECTION_COLUMN, -1L);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPostExecute(Long accountId) {
|
protected void onPostExecute(Long accountId) {
|
||||||
if (accountId != -1 && !isCancelled()) {
|
if (accountId != -1 && !isCancelled()) {
|
||||||
mRequestedAccountId = accountId;
|
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".
|
* 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() {
|
public static UnsavedChangesDialogFragment newInstanceForBack() {
|
||||||
UnsavedChangesDialogFragment f = new UnsavedChangesDialogFragment();
|
UnsavedChangesDialogFragment f = new UnsavedChangesDialogFragment();
|
||||||
@ -747,7 +751,7 @@ public class AccountSettingsXL extends PreferenceActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||||
final AccountSettingsXL activity = (AccountSettingsXL) getActivity();
|
final AccountSettings activity = (AccountSettings) getActivity();
|
||||||
final int position = getArguments().getInt(BUNDLE_KEY_HEADER);
|
final int position = getArguments().getInt(BUNDLE_KEY_HEADER);
|
||||||
final boolean isBack = getArguments().getBoolean(BUNDLE_KEY_BACK);
|
final boolean isBack = getArguments().getBoolean(BUNDLE_KEY_BACK);
|
||||||
|
|
@ -159,8 +159,8 @@ public class AccountSettingsFragment extends PreferenceFragment {
|
|||||||
mContext = activity;
|
mContext = activity;
|
||||||
|
|
||||||
// Notify the activity that we're here.
|
// Notify the activity that we're here.
|
||||||
if (activity instanceof AccountSettingsXL) {
|
if (activity instanceof AccountSettings) {
|
||||||
((AccountSettingsXL)activity).onAttach(this);
|
((AccountSettings) activity).onAttach(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -586,7 +586,7 @@ public class AccountSettingsFragment extends PreferenceFragment {
|
|||||||
* Generic onPreferenceChanged listener for the preferences (above) that just need
|
* Generic onPreferenceChanged listener for the preferences (above) that just need
|
||||||
* to be written, without extra tweaks
|
* to be written, without extra tweaks
|
||||||
*/
|
*/
|
||||||
private Preference.OnPreferenceChangeListener mPreferenceChangeListener =
|
private final Preference.OnPreferenceChangeListener mPreferenceChangeListener =
|
||||||
new Preference.OnPreferenceChangeListener() {
|
new Preference.OnPreferenceChangeListener() {
|
||||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||||
onPreferenceChanged(preference.getKey(), newValue);
|
onPreferenceChanged(preference.getKey(), newValue);
|
||||||
|
@ -542,7 +542,7 @@ public class AccountSetupBasics extends AccountSetupActivity
|
|||||||
if (ENTER_DEBUG_SCREEN && "d@d.d".equals(email) && "debug".equals(password)) {
|
if (ENTER_DEBUG_SCREEN && "d@d.d".equals(email) && "debug".equals(password)) {
|
||||||
mEmailView.setText("");
|
mEmailView.setText("");
|
||||||
mPasswordView.setText("");
|
mPasswordView.setText("");
|
||||||
AccountSettingsXL.actionSettingsWithDebug(this);
|
AccountSettings.actionSettingsWithDebug(this);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ import com.android.email.ExchangeUtils;
|
|||||||
import com.android.email.Preferences;
|
import com.android.email.Preferences;
|
||||||
import com.android.email.SecurityPolicy;
|
import com.android.email.SecurityPolicy;
|
||||||
import com.android.email.VendorPolicyLoader;
|
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.mail.Store;
|
||||||
import com.android.email.widget.WidgetManager;
|
import com.android.email.widget.WidgetManager;
|
||||||
import com.android.emailcommon.Logging;
|
import com.android.emailcommon.Logging;
|
||||||
@ -119,7 +119,7 @@ public class EmailBroadcastProcessorService extends IntentService {
|
|||||||
enableComponentsIfNecessary();
|
enableComponentsIfNecessary();
|
||||||
} else if (ACTION_SECRET_CODE.equals(broadcastAction)
|
} else if (ACTION_SECRET_CODE.equals(broadcastAction)
|
||||||
&& SECRET_CODE_HOST_DEBUG_SCREEN.equals(broadcastIntent.getData().getHost())) {
|
&& SECRET_CODE_HOST_DEBUG_SCREEN.equals(broadcastIntent.getData().getHost())) {
|
||||||
AccountSettingsXL.actionSettingsWithDebug(this);
|
AccountSettings.actionSettingsWithDebug(this);
|
||||||
} else if (AccountManager.LOGIN_ACCOUNTS_CHANGED_ACTION.equals(broadcastAction)) {
|
} else if (AccountManager.LOGIN_ACCOUNTS_CHANGED_ACTION.equals(broadcastAction)) {
|
||||||
onSystemAccountChanged();
|
onSystemAccountChanged();
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
package com.android.email.activity.setup;
|
package com.android.email.activity.setup;
|
||||||
|
|
||||||
import com.android.email.activity.IntentUtilities;
|
|
||||||
import com.android.email.mail.Store;
|
import com.android.email.mail.Store;
|
||||||
import com.android.emailcommon.provider.EmailContent.Account;
|
import com.android.emailcommon.provider.EmailContent.Account;
|
||||||
import com.android.emailcommon.utility.Utility;
|
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
|
* To execute: runtest -c com.android.email.activity.setup.AccountSettingsXLTests email
|
||||||
*/
|
*/
|
||||||
@MediumTest
|
@MediumTest
|
||||||
public class AccountSettingsXLTests extends ActivityInstrumentationTestCase2<AccountSettingsXL> {
|
public class AccountSettingsTests extends ActivityInstrumentationTestCase2<AccountSettings> {
|
||||||
|
|
||||||
private long mAccountId;
|
private long mAccountId;
|
||||||
private Account mAccount;
|
private Account mAccount;
|
||||||
@ -52,8 +51,8 @@ public class AccountSettingsXLTests extends ActivityInstrumentationTestCase2<Acc
|
|||||||
|
|
||||||
private static final String PREFERENCE_FREQUENCY = "account_check_frequency";
|
private static final String PREFERENCE_FREQUENCY = "account_check_frequency";
|
||||||
|
|
||||||
public AccountSettingsXLTests() {
|
public AccountSettingsTests() {
|
||||||
super(AccountSettingsXL.class);
|
super(AccountSettings.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -63,7 +62,7 @@ public class AccountSettingsXLTests extends ActivityInstrumentationTestCase2<Acc
|
|||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
super.setUp();
|
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 {
|
public void disable_testPushOptionPOP() throws Throwable {
|
||||||
Intent i = getTestIntent("Name", "pop3://user:password@server.com",
|
Intent i = getTestIntent("Name", "pop3://user:password@server.com",
|
||||||
"smtp://user:password@server.com");
|
"smtp://user:password@server.com");
|
||||||
this.setActivityIntent(i);
|
setActivityIntent(i);
|
||||||
|
|
||||||
getActivityAndFields();
|
getActivityAndFields();
|
||||||
|
|
||||||
@ -100,7 +99,7 @@ public class AccountSettingsXLTests extends ActivityInstrumentationTestCase2<Acc
|
|||||||
public void disable_testPushOptionIMAP() throws Throwable {
|
public void disable_testPushOptionIMAP() throws Throwable {
|
||||||
Intent i = getTestIntent("Name", "imap://user:password@server.com",
|
Intent i = getTestIntent("Name", "imap://user:password@server.com",
|
||||||
"smtp://user:password@server.com");
|
"smtp://user:password@server.com");
|
||||||
this.setActivityIntent(i);
|
setActivityIntent(i);
|
||||||
|
|
||||||
getActivityAndFields();
|
getActivityAndFields();
|
||||||
|
|
||||||
@ -113,14 +112,14 @@ public class AccountSettingsXLTests extends ActivityInstrumentationTestCase2<Acc
|
|||||||
*/
|
*/
|
||||||
public void disable_testPushOptionEAS() throws Throwable {
|
public void disable_testPushOptionEAS() throws Throwable {
|
||||||
// This test should only be run if EAS is supported
|
// 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) {
|
== null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Intent i = getTestIntent("Name", "eas://user:password@server.com",
|
Intent i = getTestIntent("Name", "eas://user:password@server.com",
|
||||||
"eas://user:password@server.com");
|
"eas://user:password@server.com");
|
||||||
this.setActivityIntent(i);
|
setActivityIntent(i);
|
||||||
|
|
||||||
getActivityAndFields();
|
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
|
* Get the activity (which causes it to be started, using our intent) and get the UI fields
|
||||||
*/
|
*/
|
||||||
private void getActivityAndFields() throws Throwable {
|
private void getActivityAndFields() throws Throwable {
|
||||||
final AccountSettingsXL theActivity = getActivity();
|
final AccountSettings theActivity = getActivity();
|
||||||
|
|
||||||
runTestOnUiThread(new Runnable() {
|
runTestOnUiThread(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
PreferenceFragment f = (PreferenceFragment) theActivity.mCurrentFragment;
|
PreferenceFragment f = (PreferenceFragment) theActivity.mCurrentFragment;
|
||||||
AccountSettingsXLTests.this.mCheckFrequency =
|
mCheckFrequency =
|
||||||
(ListPreference) f.findPreference(PREFERENCE_FREQUENCY);
|
(ListPreference) f.findPreference(PREFERENCE_FREQUENCY);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -170,7 +169,7 @@ public class AccountSettingsXLTests extends ActivityInstrumentationTestCase2<Acc
|
|||||||
mAccount.save(mContext);
|
mAccount.save(mContext);
|
||||||
mAccountId = mAccount.mId;
|
mAccountId = mAccount.mId;
|
||||||
|
|
||||||
return AccountSettingsXL.createAccountSettingsIntent(mContext, mAccountId, null);
|
return AccountSettings.createAccountSettingsIntent(mContext, mAccountId, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user