Merge "text changes requested by Legal"
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 6f7e4d6..ba02ee8 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -1548,10 +1548,8 @@
<!-- Sound settings screen, setting option summary text when check box is clear -->
<string name="dock_sounds_enable_summary_off" product="default">Don\'t play sound when inserting or removing phone from dock</string>
- <!-- Acounts & Sync settings screen setting option name to go into the screen for data sync settings-->
+ <!-- Acounts & Sync settings screen setting title. This screen will list the different accounts (mail, gmail...) used on that phone and their sync settings -->
<string name="sync_settings">Accounts & sync</string>
- <!-- Main Settings screen setting option summary text for the itme to go into the screen with data sync settings-->
- <string name="sync_settings_summary">Add or remove accounts and change account settings</string>
<!-- Main Settings screen, setting option name to go into search settings -->
<string name="search_settings">Search</string>
@@ -2784,12 +2782,8 @@
<!-- Warning message that the interaction model changes on enabling touch exploration. [CHAR LIMIT=NONE] -->
<string name="accessibility_touch_exploration_warning">This feature changes the
way your device responds to touch. Turn on?</string>
- <!-- Default description for an accessibility serivice if the latter doesn't provide one (tablet). [CHAR LIMIT=NONE] -->
- <string name="accessibility_service_default_description" product="tablet">This service has no
- description.\n\nServices provide feedback when you interact with the tablet.</string>
- <!-- Default description for an accessibility serivice if the latter doesn't provide one (phone). [CHAR LIMIT=NONE] -->
- <string name="accessibility_service_default_description" product="default">This service has no
- description.\n\nServices provide feedback when you interact with the phone.</string>
+ <!-- Default description for an accessibility serivice if the latter doesn't provide one. [CHAR LIMIT=NONE] -->
+ <string name="accessibility_service_default_description">No description provided.</string>
<!-- Accessibility settings: button for lauching settings for an accessibility service -->
<string name="settings_button">Settings</string>
@@ -3308,9 +3302,6 @@
<string name="sync_is_failing">Sync is currently experiencing problems. It will be back shortly.</string>
<!-- Button label to add an account [CHAR LIMIT=20] -->
<string name="add_account_label">Add account</string>
- <!-- Header title for those settings relating to general syncing.
- [CHAR LIMIT=30] -->
- <string name="header_general_sync_settings">General sync settings</string>
<!-- Data synchronization settings screen, title of setting that controls whether background data should be used [CHAR LIMIT=30] -->
<string name="background_data">Background data</string>
<!-- Data synchronization settings screen, summary of setting that controls whether background data should be used [CHAR LIMIT=60] -->
@@ -3319,13 +3310,8 @@
<string name="background_data_dialog_title">Attention</string>
<!-- Data synchronization settings screen, message of dialog that confirms the user's unchecking of background data [CHAR LIMIT=200] -->
<string name="background_data_dialog_message">Disabling background data extends battery life and lowers data use. Some applications may still use the background data connection.</string>
- <!-- Data synchronization settings screen, setting option name
- [CHAR LIMIT=30] -->
- <string name="sync_automatically">Auto-sync</string>
- <!-- Data synchronization settings screen, setting option summary text when check box is selected [CHAR LIMIT=60] -->
- <string name="sync_automatically_summary">Applications sync data automatically</string>
- <!-- Header title for list of accounts on Accounts & Synchronization settings [CHAR LIMIT=30] -->
- <string name="header_manage_accounts">Manage accounts</string>
+ <!-- Title for a checkbox that enables data synchronization in the account and sync screen [CHAR LIMIT=35] -->
+ <string name="sync_automatically">Auto-sync app data</string>
<!-- Sync status messages on Accounts & Synchronization settings --><skip />
<!-- Sync status shown when sync is enabled [CHAR LIMIT=20] -->
diff --git a/res/xml/manage_accounts_settings.xml b/res/xml/manage_accounts_settings.xml
index ebb702a..0ec46b7 100644
--- a/res/xml/manage_accounts_settings.xml
+++ b/res/xml/manage_accounts_settings.xml
@@ -16,15 +16,4 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
- <PreferenceCategory
- android:title="@string/header_general_sync_settings" />
-
- <CheckBoxPreference android:key="syncAutomaticallyCheckBox"
- android:persistent="false"
- android:title="@string/sync_automatically"
- android:summary="@string/sync_automatically_summary"/>
-
- <PreferenceCategory android:key="manageAccountsCategory"
- android:title="@string/header_manage_accounts" />
-
</PreferenceScreen>
diff --git a/src/com/android/settings/ChooseLockGeneric.java b/src/com/android/settings/ChooseLockGeneric.java
index 5e44df3..0f95cc0 100644
--- a/src/com/android/settings/ChooseLockGeneric.java
+++ b/src/com/android/settings/ChooseLockGeneric.java
@@ -67,6 +67,11 @@
mKeyStore = KeyStore.getInstance();
mChooseLockSettingsHelper = new ChooseLockSettingsHelper(this.getActivity());
+ // Defaults to needing to confirm credentials
+ final boolean confirmCredentials = getActivity().getIntent()
+ .getBooleanExtra(CONFIRM_CREDENTIALS, true);
+ mPasswordConfirmed = !confirmCredentials;
+
if (savedInstanceState != null) {
mPasswordConfirmed = savedInstanceState.getBoolean(PASSWORD_CONFIRMED);
}
diff --git a/src/com/android/settings/accounts/ManageAccountsSettings.java b/src/com/android/settings/accounts/ManageAccountsSettings.java
index 4902d8a..0f52fe5 100644
--- a/src/com/android/settings/accounts/ManageAccountsSettings.java
+++ b/src/com/android/settings/accounts/ManageAccountsSettings.java
@@ -18,7 +18,6 @@
import android.accounts.Account;
import android.accounts.AccountManager;
-import android.accounts.AuthenticatorDescription;
import android.accounts.OnAccountsUpdateListener;
import android.app.Activity;
import android.content.ContentResolver;
@@ -28,10 +27,8 @@
import android.content.SyncStatusInfo;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
-import android.preference.CheckBoxPreference;
import android.preference.Preference;
import android.preference.PreferenceActivity;
-import android.preference.PreferenceCategory;
import android.preference.PreferenceScreen;
import android.util.Log;
import android.view.LayoutInflater;
@@ -40,7 +37,6 @@
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
-import android.widget.Button;
import android.widget.TextView;
import com.android.settings.AccountPreference;
@@ -48,38 +44,22 @@
import com.android.settings.R;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.HashSet;
-import java.util.Map;
public class ManageAccountsSettings extends AccountPreferenceBase
implements OnAccountsUpdateListener, DialogCreatable {
- private static final String TAG = ManageAccountsSettings.class.getSimpleName();
-
- private static final String AUTHORITIES_FILTER_KEY = "authorities";
- private static final boolean LDEBUG = Log.isLoggable(TAG, Log.DEBUG);
-
- private static final String AUTO_SYNC_CHECKBOX_KEY = "syncAutomaticallyCheckBox";
- private static final String MANAGE_ACCOUNTS_CATEGORY_KEY = "manageAccountsCategory";
-
private static final int MENU_ADD_ACCOUNT = Menu.FIRST;
+ private static final int MENU_SYNC_APP = MENU_ADD_ACCOUNT + 1;
private static final int REQUEST_SHOW_SYNC_SETTINGS = 1;
- private PreferenceCategory mManageAccountsCategory;
private String[] mAuthorities;
private TextView mErrorInfoView;
- private Button mAddAccountButton;
- private CheckBoxPreference mAutoSyncCheckbox;
+ private MenuItem mSyncAppMenuItem;
private SettingsDialogFragment mDialogFragment;
- private AuthenticatorDescription[] mAuthDescs;
- private Map<String, AuthenticatorDescription> mTypeToAuthDescription
- = new HashMap<String, AuthenticatorDescription>();
- private HashMap<String, ArrayList<String>> mAccountTypeToAuthorities = null;
-
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
@@ -111,9 +91,6 @@
mErrorInfoView = (TextView)view.findViewById(R.id.sync_settings_error_info);
mErrorInfoView.setVisibility(View.GONE);
- mAutoSyncCheckbox = (CheckBoxPreference) findPreference(AUTO_SYNC_CHECKBOX_KEY);
-
- mManageAccountsCategory = (PreferenceCategory)findPreference(MANAGE_ACCOUNTS_CATEGORY_KEY);
mAuthorities = activity.getIntent().getStringArrayExtra(AUTHORITIES_FILTER_KEY);
updateAuthDescriptions();
@@ -127,10 +104,7 @@
@Override
public boolean onPreferenceTreeClick(PreferenceScreen preferences, Preference preference) {
- if (preference == mAutoSyncCheckbox) {
- ContentResolver.setMasterSyncAutomatically(mAutoSyncCheckbox.isChecked());
- onSyncStateUpdated();
- } else if (preference instanceof AccountPreference) {
+ if (preference instanceof AccountPreference) {
startAccountSettings((AccountPreference) preference);
} else {
return false;
@@ -158,17 +132,25 @@
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
- MenuItem actionItem =
- menu.add(0, MENU_ADD_ACCOUNT, 0, R.string.add_account_label);
- actionItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM
+ MenuItem addAccountItem = menu.add(0, MENU_ADD_ACCOUNT, 0, R.string.add_account_label);
+ addAccountItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM
| MenuItem.SHOW_AS_ACTION_WITH_TEXT);
+ mSyncAppMenuItem = menu.add(0, MENU_SYNC_APP, 0, R.string.sync_automatically).
+ setCheckable(true).setChecked(ContentResolver.getMasterSyncAutomatically());
+ mSyncAppMenuItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
- if (item.getItemId() == MENU_ADD_ACCOUNT) {
+ final int itemId = item.getItemId();
+ if (itemId == MENU_ADD_ACCOUNT) {
onAddAccountClicked();
return true;
+ } else if (itemId == MENU_SYNC_APP) {
+ // Use the opposite, the checked state has not yet been changed
+ ContentResolver.setMasterSyncAutomatically(!item.isChecked());
+ onSyncStateUpdated();
+ return true;
} else {
return super.onOptionsItemSelected(item);
}
@@ -179,8 +161,9 @@
// Catch any delayed delivery of update messages
if (getActivity() == null) return;
// Set background connection state
- boolean masterSyncAutomatically = ContentResolver.getMasterSyncAutomatically();
- mAutoSyncCheckbox.setChecked(masterSyncAutomatically);
+ if (mSyncAppMenuItem != null) {
+ mSyncAppMenuItem.setChecked(ContentResolver.getMasterSyncAutomatically());
+ }
// iterate over all the preferences, setting the state properly for each
SyncInfo currentSync = ContentResolver.getCurrentSync();
@@ -196,8 +179,8 @@
userFacing.add(sa.authority);
}
}
- for (int i = 0, count = mManageAccountsCategory.getPreferenceCount(); i < count; i++) {
- Preference pref = mManageAccountsCategory.getPreference(i);
+ for (int i = 0, count = getPreferenceScreen().getPreferenceCount(); i < count; i++) {
+ Preference pref = getPreferenceScreen().getPreference(i);
if (! (pref instanceof AccountPreference)) {
continue;
}
@@ -211,7 +194,7 @@
for (String authority : authorities) {
SyncStatusInfo status = ContentResolver.getSyncStatus(account, authority);
boolean syncEnabled = ContentResolver.getSyncAutomatically(account, authority)
- && masterSyncAutomatically
+ && ContentResolver.getMasterSyncAutomatically()
&& (ContentResolver.getIsSyncable(account, authority) > 0);
boolean authorityIsPending = ContentResolver.isSyncPending(account, authority);
boolean activelySyncing = currentSync != null
@@ -251,7 +234,7 @@
@Override
public void onAccountsUpdated(Account[] accounts) {
if (getActivity() == null) return;
- mManageAccountsCategory.removeAll();
+ getPreferenceScreen().removeAll();
for (int i = 0, n = accounts.length; i < n; i++) {
final Account account = accounts[i];
final ArrayList<String> auths = getAuthoritiesForAccountType(account.type);
@@ -271,7 +254,7 @@
final Drawable icon = getDrawableForType(account.type);
final AccountPreference preference =
new AccountPreference(getActivity(), account, icon, auths);
- mManageAccountsCategory.addPreference(preference);
+ getPreferenceScreen().addPreference(preference);
}
}
onSyncStateUpdated();
@@ -280,8 +263,8 @@
@Override
protected void onAuthDescriptionsUpdated() {
// Update account icons for all account preference items
- for (int i = 0; i < mManageAccountsCategory.getPreferenceCount(); i++) {
- AccountPreference pref = (AccountPreference) mManageAccountsCategory.getPreference(i);
+ for (int i = 0; i < getPreferenceScreen().getPreferenceCount(); i++) {
+ AccountPreference pref = (AccountPreference) getPreferenceScreen().getPreference(i);
pref.setProviderIcon(getDrawableForType(pref.getAccount().type));
pref.setSummary(getLabelForType(pref.getAccount().type));
}