Merge "Remove extra button bar." into honeycomb
diff --git a/res/values-es-rUS-xlarge/strings.xml b/res/values-es-rUS-xlarge/strings.xml
index 2c0eadf..6bee12a 100644
--- a/res/values-es-rUS-xlarge/strings.xml
+++ b/res/values-es-rUS-xlarge/strings.xml
@@ -62,6 +62,8 @@
     <!-- XL -->
     <string name="date_time_date_format" msgid="7461449249664299378">"Seleccionar formato de fecha"</string>
     <!-- XL -->
+    <!-- outdated translation 8167667824619597923 -->     <string name="lock_after_timeout" msgid="7600891513842005">"Bloquear el dispositivo después del tiempo de espera"</string>
+    <!-- XL -->
     <string name="owner_info_settings_title" msgid="5868468517033834142">"Datos de propietario"</string>
     <!-- XL -->
     <string name="owner_info_settings_edit_text_hint" msgid="8714689633531483174">"Introduce el texto para la pantalla de bloqueo."</string>
@@ -70,7 +72,21 @@
     <!-- XL -->
     <string name="location_security_settings_title" msgid="2760622897087864574">"Configuración de ubicación &amp; seguridad"</string>
     <!-- XL -->
-    <string name="unlock_set_unlock_pattern_summary" msgid="2255207039632944974">"Establece el patrón para desbloquear la pantalla."</string>
+    <!-- outdated translation 7222261825322058694 -->     <string name="lock_settings_picker_title" msgid="2690788880781812819">"Seguridad de desbloqueo de la pantalla"</string>
+    <!-- XL -->
+    <!-- outdated translation 347866107250190753 -->     <string name="unlock_set_unlock_launch_picker_title" msgid="3679744779726501637">"Configurar bloqueo de pantalla"</string>
+    <!-- XL -->
+    <!-- outdated translation 7839021413264124726 -->     <string name="unlock_set_unlock_off_summary" msgid="7637549453338831016">"No mostrar el bloqueo de pantalla"</string>
+    <!-- XL -->
+    <!-- outdated translation 6897899776351307938 -->     <string name="unlock_set_unlock_none_title" msgid="8302920869082326280">"Ninguno"</string>
+    <!-- XL -->
+    <!-- outdated translation 8885805726462075726 -->     <string name="unlock_set_unlock_none_summary" msgid="8836395154986917752">"Inhabilitar seguridad de desbloqueo de la pantalla"</string>
+    <!-- XL -->
+    <!-- outdated translation 2255207039632944974 -->     <string name="unlock_set_unlock_pattern_summary" msgid="7704094261502377451">"Establece el patrón para desbloquear la pantalla."</string>
+    <!-- XL -->
+    <!-- outdated translation 7340012856731870485 -->     <string name="unlock_set_unlock_pin_summary" msgid="8765565920176739681">"Ingresa un PIN numérico para desbloquear la pantalla."</string>
+    <!-- XL -->
+    <!-- outdated translation 2303105580723976714 -->     <string name="unlock_set_unlock_password_summary" msgid="5551818803088356462">"Ingresa una contraseña para desbloquear la pantalla."</string>
     <!-- XL -->
     <string name="unlock_set_unlock_disabled_summary" msgid="5962903914511361952">"Inhabilitado por el administrador remoto de la tableta"</string>
     <!-- XL -->
@@ -126,6 +142,8 @@
     <!-- XL -->
     <string name="wifi_tether_settings_title" msgid="1163442397537759931">"Configuración de la zona activa Wi-Fi portátil"</string>
     <!-- XL -->
+    <!-- outdated translation 221091308884159495 -->     <string name="display_settings_title" msgid="891288246221134525">"Pantalla"</string>
+    <!-- XL -->
     <string name="silent_mode_title" msgid="1261478570389701519">"Modo silencio"</string>
     <!-- XL -->
     <string name="silent_mode_summary" msgid="5222199351217769201">"Silenciar todos los sonidos excepto los medios &amp; las alarmas."</string>
@@ -166,7 +184,7 @@
     <string name="accelerometer_summary_off" product="tablet" msgid="4678290739639397018">"Cambiar la orientación automáticamente al girar la tableta"</string>
     <string name="accelerometer_summary_off" product="default" msgid="5382045890112616097">"Cambiar la orientación automáticamente al girar el teléfono"</string>
     <!-- XL -->
-    <string name="screen_timeout" msgid="4642702020751106195">"Tiempo de espera de la pantalla"</string>
+    <!-- outdated translation 4642702020751106195 -->     <string name="screen_timeout" msgid="6722687152321894360">"Tiempo de espera de la pantalla"</string>
     <!-- XL -->
     <string name="sim_lock_settings_category" msgid="3725835714557961131">"Configurar bloqueo de tarjeta SIM"</string>
     <!-- XL -->
@@ -183,6 +201,9 @@
     <!-- XL -->
     <string name="build_number" msgid="5240350635232938488">"Crear número"</string>
     <!-- XL -->
+    <!-- outdated translation 899895687115294054 -->     <string name="device_status_summary" product="tablet" msgid="1593450654160814122">"Número de teléfono, señal, etc."</string>
+    <string name="device_status_summary" product="default" msgid="899895687115294054">"Número de teléfono, señal, etc."</string>
+    <!-- XL -->
     <string name="storage_settings" msgid="5625705972110860801">"Almacenamiento"</string>
     <!-- XL -->
     <string name="sd_eject" product="nosdcard" msgid="2291329760090260835">"Desactivar alm. comp."</string>
@@ -237,6 +258,12 @@
     <!-- XL -->
     <string name="location_gps_disabled" msgid="368445950600796860">"Localizar a nivel de calle (necesita más batería además de la vista del cielo)"</string>
     <!-- XL -->
+    <!-- outdated translation 6158635740500076705 -->     <string name="use_location_title" msgid="6603235165943700077">"Utilizar la ubicación para buscar con Google"</string>
+    <!-- XL -->
+    <!-- outdated translation 5137275253035183227 -->     <string name="use_location_summary_disabled" msgid="555010365449402016">"Utilizar la ubicación para buscar con Google y otros servicios de Google"</string>
+    <!-- XL -->
+    <!-- outdated translation 7252704818478660952 -->     <string name="use_location_summary_enabled" msgid="5155029913791084058">"Ubicación utilizada para mejorar los resultados de la búsqueda y otros servicios de Google"</string>
+    <!-- XL -->
     <string name="about_settings" product="tablet" msgid="4492242295431251939">"Acerca de la tableta"</string>
     <string name="about_settings" product="default" msgid="5642163368100089859">"Acerca del teléfono"</string>
     <!-- XL -->
@@ -245,6 +272,8 @@
     <string name="system_tutorial_list_item_summary" product="tablet" msgid="176391697191022240">"Aprende cómo utilizar tu tableta"</string>
     <string name="system_tutorial_list_item_summary" product="default" msgid="696702567266318374">"Aprende cómo utilizar tu teléfono"</string>
     <!-- XL -->
+    <!-- outdated translation 1032594113258846963 -->     <string name="lock_settings_title" msgid="9000564553472290676">"Desbloqueo de pantalla"</string>
+    <!-- XL -->
     <string name="lockpattern_change_lock_pattern_label" msgid="4234350892820550249">"Cambiar gráfico de desbloqueo"</string>
     <!-- XL -->
     <string name="lockpattern_recording_intro_header" msgid="9142059965773629252">"Establecer un gráfico de desbloqueo"</string>
@@ -266,6 +295,7 @@
     <string name="lock_title" product="tablet" msgid="9166767874243041429">"Protección de tu tableta"</string>
     <string name="lock_title" product="default" msgid="1092944886413119561">"Asegurando tu teléfono"</string>
     <!-- XL -->
+    <string name="lock_intro_message" product="tablet" msgid="4721776268392533907">"Protege tu tableta del uso no autorizado creando un gráfico de desbloqueo de pantalla personal. Usa el dedo para unir los puntos en cualquier orden en la pantalla. Debes unir al menos cuatro puntos. "\n\n"¿Listo para comenzar? Toca “Siguiente”."</string>
     <string name="lock_intro_message" product="default" msgid="907038783986041076"><font size="17">"Protege a tu teléfono de usos no autorizados al crear un gráfico de desbloqueo en la pantalla personal. "\n<font height="17">\n</font><b>"1"</b>"  En la pantalla siguiente, observa cómo se establece un gráfico de ejemplo. "\n<font height="17">\n</font><b>"2"</b>"  Cuando estés listo, establece tu propio gráfico de desbloqueo personal. Experimenta con diferentes gráficos pero conecta al menos cuatro puntos. "\n<font height="17">\n</font><b>"3"</b>"  Revisa tu gráfico para confirmar. "\n<font height="17">\n</font><b>"¿Estás listo para comenzar? Toca \"Siguiente\""</b>". "\n<font height="3">\n</font>"Si deseas dejar sin protección a tu teléfono, toca \"Cancelar\"."</font></string>
     <!-- XL -->
     <string name="applications_settings_header" msgid="7998404736890425408">"Configuración de aplicación"</string>
@@ -398,6 +428,16 @@
     <!-- XL -->
     <string name="bluetooth_notif_message" msgid="2611095882015030198">"Seleccionar para vincular con <xliff:g id="DEVICE_NAME">%1$s</xliff:g>"</string>
     <!-- XL -->
+    <string name="bluetooth_auto_connect" msgid="5635834571497957651">"Conectar automáticamente"</string>
+    <!-- XL -->
+    <string name="date_picker_title" msgid="6146612274280931937">"Fecha"</string>
+    <!-- XL -->
+    <string name="time_picker_title" msgid="4696843998853074855">"Hora"</string>
+    <!-- XL -->
+    <string name="lockpattern_tutorial_cancel_label" msgid="8891383231976441554">"Cancelar"</string>
+    <!-- XL -->
+    <string name="lockpattern_tutorial_continue_label" msgid="607092788342282292">"Siguiente"</string>
+    <!-- XL -->
     <string name="bluetooth_enter_pin_msg" msgid="4795866589006598648">\n"Ingresa el PIN para vincularse con \"<xliff:g id="DEVICE_NAME">%1$s</xliff:g>\". (Intenta con 0000 ó 1234). Es posible que debas ingresar el mismo PIN en el dispositivo Bluetooth."</string>
     <!-- XL -->
     <string name="bluetooth_enter_passkey_msg" msgid="5281098098369174842">\n"Ingresa la llave maestra para vincular con \"<xliff:g id="DEVICE_NAME">%1$s</xliff:g>\"."</string>
@@ -410,8 +450,16 @@
     <!-- XL -->
     <string name="bluetooth_disconnect_pan_profile" msgid="7327390610936860378">"<xliff:g id="DEVICE_NAME">%1$s</xliff:g> se desconectará del anclaje."</string>
     <!-- XL -->
+    <string name="bluetooth_pan_profile_summary_use_for" msgid="7152329494274254683">"Utilizar para acceso a Internet"</string>
+    <!-- XL -->
     <string name="memory_calculating_size" msgid="4994844259856032553">"Calculando…"</string>
     <!-- XL -->
+    <string name="lockpassword_choose_your_pattern_header" msgid="1478083096563754867">"Escoge tu patrón"</string>
+    <!-- XL -->
+    <string name="lockpassword_confirm_your_pattern_header" msgid="4173481161015502997">"Confirma tu patrón"</string>
+    <!-- XL -->
+    <string name="lockpassword_choose_lock_generic_header" msgid="205113288645586976">"Desbloquear selección"</string>
+    <!-- XL -->
     <string name="current_input_method" msgid="1106006204280275670">"Método de entrada actual"</string>
     <!-- XL -->
     <string name="input_method_selector" msgid="4603564747071938112">"Selector de método de entrada"</string>
@@ -428,6 +476,8 @@
     <!-- XL -->
     <string name="active_input_method_subtypes" msgid="5725808834287911653">"Métodos de entrada activos"</string>
     <!-- XL -->
+    <string name="use_system_language_to_select_input_method_subtypes" msgid="6563524811468810194">"Usar el idioma del sistema"</string>
+    <!-- XL -->
     <string name="input_methods_and_subtype_enabler_title" msgid="2847364292968799808">"Seleccionar métodos de entrada activos"</string>
     <!-- XL -->
     <string name="history_details_title" msgid="8910742461149938017">"Detalles del historial"</string>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 669e928..7012440 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -2945,7 +2945,7 @@
 
     <!-- Wifi Setup For Setup Wizard with XL screen -->
     <!-- Title shown in Wifi Setup For Setup Wizard with XL screen -->
-    <string name="wifi_setup_title">WiFi setup</string>
+    <string name="wifi_setup_title">Wi-Fi setup</string>
     <!-- Text message shown when Wifi is not connected.
          Used in Wifi Setup For Setup Wizard with XL screen. -->
     <string name="wifi_setup_not_connected">Not connected</string>
diff --git a/src/com/android/settings/bluetooth/CachedBluetoothDevice.java b/src/com/android/settings/bluetooth/CachedBluetoothDevice.java
index 46391d3..88964e0 100644
--- a/src/com/android/settings/bluetooth/CachedBluetoothDevice.java
+++ b/src/com/android/settings/bluetooth/CachedBluetoothDevice.java
@@ -279,7 +279,7 @@
     }
 
     private void connectWithoutResettingTimer(boolean connectAllProfiles) {
-        // Try to initialize the profiles if there were not.
+        // Try to initialize the profiles if they were not.
         if (mProfiles.size() == 0) {
             if (!updateProfiles()) {
                 // If UUIDs are not available yet, connect will be happen
@@ -299,7 +299,6 @@
                         .getProfileManager(mLocalManager, profile);
                 if (profileManager.isPreferred(mDevice)) {
                     ++preferredProfiles;
-                    disconnectConnected(this, profile);
                     connectInt(this, profile);
                 }
             }
@@ -322,7 +321,6 @@
                 LocalBluetoothProfileManager profileManager = LocalBluetoothProfileManager
                         .getProfileManager(mLocalManager, profile);
                 profileManager.setPreferred(mDevice, true);
-                disconnectConnected(this, profile);
                 connectInt(this, profile);
             }
         }
@@ -332,25 +330,9 @@
         mConnectAttempted = SystemClock.elapsedRealtime();
         // Reset the only-show-one-error-dialog tracking variable
         mIsConnectingErrorPossible = true;
-        disconnectConnected(this, profile);
         connectInt(this, profile);
     }
 
-    private void disconnectConnected(CachedBluetoothDevice device, Profile profile) {
-        LocalBluetoothProfileManager profileManager =
-            LocalBluetoothProfileManager.getProfileManager(mLocalManager, profile);
-        CachedBluetoothDeviceManager cachedDeviceManager = mLocalManager.getCachedDeviceManager();
-        List<BluetoothDevice> devices = profileManager.getConnectedDevices();
-        if (devices == null) return;
-        for (BluetoothDevice btDevice : devices) {
-            CachedBluetoothDevice cachedDevice = cachedDeviceManager.findDevice(btDevice);
-
-            if (cachedDevice != null && !cachedDevice.equals(device)) {
-                cachedDevice.disconnect(profile);
-            }
-        }
-    }
-
     private boolean connectInt(CachedBluetoothDevice cachedDevice, Profile profile) {
         if (!cachedDevice.ensurePaired()) return false;
 
diff --git a/src/com/android/settings/bluetooth/DeviceProfilesSettings.java b/src/com/android/settings/bluetooth/DeviceProfilesSettings.java
index 7961281..479cbe0 100644
--- a/src/com/android/settings/bluetooth/DeviceProfilesSettings.java
+++ b/src/com/android/settings/bluetooth/DeviceProfilesSettings.java
@@ -20,8 +20,11 @@
 import com.android.settings.SettingsPreferenceFragment;
 import com.android.settings.bluetooth.LocalBluetoothProfileManager.Profile;
 
+import android.bluetooth.BluetoothClass;
 import android.bluetooth.BluetoothDevice;
+import android.bluetooth.BluetoothUuid;
 import android.os.Bundle;
+import android.os.ParcelUuid;
 import android.preference.CheckBoxPreference;
 import android.preference.EditTextPreference;
 import android.preference.Preference;
@@ -75,6 +78,7 @@
         if (device == null) {
             Log.w(TAG, "Activity started without a remote Bluetooth device");
             finish();
+            return;
         }
 
         mManager = LocalBluetoothManager.getInstance(getActivity());
@@ -82,6 +86,7 @@
         if (mCachedDevice == null) {
             Log.w(TAG, "Device not found, cannot connect to it");
             finish();
+            return;
         }
 
         addPreferencesFromResource(R.xml.bluetooth_device_advanced);
@@ -89,8 +94,16 @@
 
         mProfileContainer = (PreferenceGroup) findPreference(KEY_PROFILE_CONTAINER);
         mAllowIncomingPref = (CheckBoxPreference) findPreference(KEY_ALLOW_INCOMING);
-        mAllowIncomingPref.setChecked(isIncomingFileTransfersAllowed());
-        mAllowIncomingPref.setOnPreferenceChangeListener(this);
+
+        // Configure incoming file transfer preference if device supports OPP
+        // or else remove the preference item
+        if (isObjectPushSupported(device)) {
+            mAllowIncomingPref.setChecked(isIncomingFileTransfersAllowed());
+            mAllowIncomingPref.setOnPreferenceChangeListener(this);
+        } else {
+            getPreferenceScreen().removePreference(mAllowIncomingPref);
+            mAllowIncomingPref = null;
+        }
 
         mDeviceNamePref = (EditTextPreference) findPreference(KEY_RENAME_DEVICE);
         mDeviceNamePref.setSummary(mCachedDevice.getName());
@@ -105,6 +118,15 @@
         addPreferencesForProfiles();
     }
 
+    private boolean isObjectPushSupported(BluetoothDevice device) {
+        ParcelUuid[] uuids = device.getUuids();
+        BluetoothClass bluetoothClass = device.getBluetoothClass();
+        return (uuids != null && BluetoothUuid.containsAnyUuid(uuids,
+                LocalBluetoothProfileManager.OPP_PROFILE_UUIDS)) ||
+                (bluetoothClass != null && bluetoothClass.doesClassMatch(
+                        BluetoothClass.PROFILE_OPP));
+    }
+
     @Override
     public void onSaveInstanceState(Bundle outState) {
         super.onSaveInstanceState(outState);
diff --git a/src/com/android/settings/bluetooth/LocalBluetoothProfileManager.java b/src/com/android/settings/bluetooth/LocalBluetoothProfileManager.java
index 5c8d868..a2ac743 100644
--- a/src/com/android/settings/bluetooth/LocalBluetoothProfileManager.java
+++ b/src/com/android/settings/bluetooth/LocalBluetoothProfileManager.java
@@ -471,6 +471,12 @@
 
         @Override
         public boolean connect(BluetoothDevice device) {
+            List<BluetoothDevice> sinks = getConnectedDevices();
+            if (sinks != null) {
+                for (BluetoothDevice sink : sinks) {
+                    mService.disconnect(sink);
+                }
+            }
             return mService.connect(device);
         }
 
@@ -727,6 +733,12 @@
 
         @Override
         public boolean connect(BluetoothDevice device) {
+            List<BluetoothDevice> sinks = getConnectedDevices();
+            if (sinks != null) {
+                for (BluetoothDevice sink : sinks) {
+                    mService.disconnect(sink);
+                }
+            }
             return mService.connect(device);
         }
 
diff --git a/src/com/android/settings/inputmethod/InputMethodAndSubtypeEnabler.java b/src/com/android/settings/inputmethod/InputMethodAndSubtypeEnabler.java
index 1575e13..ab4180a 100644
--- a/src/com/android/settings/inputmethod/InputMethodAndSubtypeEnabler.java
+++ b/src/com/android/settings/inputmethod/InputMethodAndSubtypeEnabler.java
@@ -152,6 +152,7 @@
             } else {
                 InputMethodAndSubtypeUtil.setSubtypesPreferenceEnabled(
                         this, mInputMethodProperties, id, false);
+                updateAutoSelectionCB();
             }
         }
         return super.onPreferenceTreeClick(preferenceScreen, preference);
@@ -247,7 +248,9 @@
     }
 
     private void setSubtypeAutoSelectionEnabled(String imiId, boolean autoSelectionEnabled) {
-        mSubtypeAutoSelectionCBMap.get(imiId).setChecked(autoSelectionEnabled);
+        CheckBoxPreference autoSelectionCB = mSubtypeAutoSelectionCBMap.get(imiId);
+        if (autoSelectionCB == null) return;
+        autoSelectionCB.setChecked(autoSelectionEnabled);
         final List<Preference> subtypePrefs = mInputMethodAndSubtypePrefsMap.get(imiId);
         for (Preference subtypePref: subtypePrefs) {
             if (subtypePref instanceof CheckBoxPreference) {
diff --git a/src/com/android/settings/wifi/AdvancedSettings.java b/src/com/android/settings/wifi/AdvancedSettings.java
index 1968eb0..74948f0 100644
--- a/src/com/android/settings/wifi/AdvancedSettings.java
+++ b/src/com/android/settings/wifi/AdvancedSettings.java
@@ -66,7 +66,8 @@
         ListPreference pref = (ListPreference) findPreference(KEY_SLEEP_POLICY);
         pref.setOnPreferenceChangeListener(this);
         int value = Settings.System.getInt(getContentResolver(),
-                Settings.System.WIFI_SLEEP_POLICY, Settings.System.WIFI_SLEEP_POLICY_DEFAULT);
+                Settings.System.WIFI_SLEEP_POLICY,
+                Settings.System.WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED);
         pref.setValue(String.valueOf(value));
 
         pref = (ListPreference) findPreference(KEY_FREQUENCY_BAND);