Merge "Remove popup indicator for dialog style preferences." 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 & 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 & 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/Settings.java b/src/com/android/settings/Settings.java
index 280f295..22fc4bf 100644
--- a/src/com/android/settings/Settings.java
+++ b/src/com/android/settings/Settings.java
@@ -23,10 +23,10 @@
import android.content.pm.PackageManager.NameNotFoundException;
import android.os.Bundle;
import android.preference.PreferenceActivity;
-import android.preference.PreferenceActivity.Header;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
+import android.widget.Button;
import java.util.HashMap;
import java.util.List;
@@ -290,6 +290,16 @@
}
}
+ @Override
+ public boolean hasNextButton() {
+ return super.hasNextButton();
+ }
+
+ @Override
+ public Button getNextButton() {
+ return super.getNextButton();
+ }
+
/*
* Settings subclasses for launching independently.
*/
diff --git a/src/com/android/settings/SettingsPreferenceFragment.java b/src/com/android/settings/SettingsPreferenceFragment.java
index 6f0c91f..0db4f8b 100644
--- a/src/com/android/settings/SettingsPreferenceFragment.java
+++ b/src/com/android/settings/SettingsPreferenceFragment.java
@@ -40,20 +40,11 @@
private static final String TAG = "SettingsPreferenceFragment";
- // Originally from PreferenceActivity.
- private static final String EXTRA_PREFS_SHOW_BUTTON_BAR = "extra_prefs_show_button_bar";
- private static final String EXTRA_PREFS_SHOW_SKIP = "extra_prefs_show_skip";
- private static final String EXTRA_PREFS_SET_NEXT_TEXT = "extra_prefs_set_next_text";
- private static final String EXTRA_PREFS_SET_BACK_TEXT = "extra_prefs_set_back_text";
-
private SettingsDialogFragment mDialogFragment;
- private Button mNextButton;
-
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
- setupButtonBar();
}
/*
@@ -167,11 +158,11 @@
}
protected boolean hasNextButton() {
- return mNextButton != null;
+ return ((Settings)getActivity()).hasNextButton();
}
protected Button getNextButton() {
- return mNextButton;
+ return ((Settings)getActivity()).getNextButton();
}
public void finish() {
@@ -193,92 +184,4 @@
}
}
- /**
- * Sets up Button Bar possibly required in the Fragment. Probably available only in
- * phones.
- *
- * Previously {@link PreferenceActivity} had the capability as hidden functionality.
- */
- private void setupButtonBar() {
- // Originally from PreferenceActivity, which has had button bar inside its layout.
- final Activity activity = getActivity();
- final Intent intent = activity.getIntent();
- final View buttonBar = activity.findViewById(com.android.internal.R.id.button_bar);
- if (!intent.getBooleanExtra(EXTRA_PREFS_SHOW_BUTTON_BAR, false) || buttonBar == null) {
- return;
- }
-
- buttonBar.setVisibility(View.VISIBLE);
- View tmpView = activity.findViewById(com.android.internal.R.id.back_button);
- if (tmpView != null) {
- // TODO: Assume this is pressed only in single pane, finishing current Activity.
- try {
- final Button backButton = (Button)tmpView;
- backButton.setOnClickListener(new OnClickListener() {
- public void onClick(View v) {
- activity.setResult(Activity.RESULT_CANCELED);
- activity.finish();
- }
- });
- if (intent.hasExtra(EXTRA_PREFS_SET_BACK_TEXT)) {
- String buttonText = intent.getStringExtra(EXTRA_PREFS_SET_BACK_TEXT);
- if (TextUtils.isEmpty(buttonText)) {
- backButton.setVisibility(View.GONE);
- }
- else {
- backButton.setText(buttonText);
- }
- }
- } catch (ClassCastException e) {
- Log.w(TAG, "The view originally for back_button is used not as Button. " +
- "Ignored.");
- }
- }
-
- tmpView = activity.findViewById(com.android.internal.R.id.skip_button);
- if (tmpView != null) {
- try {
- final Button skipButton = (Button)tmpView;
- skipButton.setOnClickListener(new OnClickListener() {
- public void onClick(View v) {
- activity.setResult(Activity.RESULT_OK);
- activity.finish();
- }
- });
- if (intent.getBooleanExtra(EXTRA_PREFS_SHOW_SKIP, false)) {
- skipButton.setVisibility(View.VISIBLE);
- }
- } catch (ClassCastException e) {
- Log.w(TAG, "The view originally for skip_button is used not as Button. " +
- "Ignored.");
- }
- }
-
- tmpView = activity.findViewById(com.android.internal.R.id.next_button);
- if (tmpView != null) {
- try {
- mNextButton = (Button)tmpView;
- mNextButton.setOnClickListener(new OnClickListener() {
- public void onClick(View v) {
- activity.setResult(Activity.RESULT_OK);
- activity.finish();
- }
- });
- // set our various button parameters
- if (intent.hasExtra(EXTRA_PREFS_SET_NEXT_TEXT)) {
- String buttonText = intent.getStringExtra(EXTRA_PREFS_SET_NEXT_TEXT);
- if (TextUtils.isEmpty(buttonText)) {
- mNextButton.setVisibility(View.GONE);
- }
- else {
- mNextButton.setText(buttonText);
- }
- }
- } catch (ClassCastException e) {
- Log.w(TAG, "The view originally for next_button is used not as Button. " +
- "Ignored.");
- mNextButton = null;
- }
- }
- }
}
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);
diff --git a/src/com/android/settings/wifi/WifiConfigUiForSetupWizardXL.java b/src/com/android/settings/wifi/WifiConfigUiForSetupWizardXL.java
index 4de7ef5..bbd8f80 100644
--- a/src/com/android/settings/wifi/WifiConfigUiForSetupWizardXL.java
+++ b/src/com/android/settings/wifi/WifiConfigUiForSetupWizardXL.java
@@ -75,21 +75,28 @@
// R.id.security_fields is the only parent for possible EditTexts. Possibly we need to
// check parentand detect visibility manually.
if (mView.findViewById(R.id.security_fields).getVisibility() == View.VISIBLE) {
- // Set Focus to password View.
- final View viewToBeFocused = mView.findViewById(R.id.password);
- if (viewToBeFocused == null) {
- Log.w(TAG, "password field to be focused not found.");
- } else if (!(viewToBeFocused instanceof EditText)) {
- Log.w(TAG, "password field is not EditText");
- } else {
- // After acquiring the focus, we show software keyboard.
- viewToBeFocused.setOnFocusChangeListener(this);
- final boolean requestFocusResult = viewToBeFocused.requestFocus();
- Log.i(TAG, String.format("Focus request %s.",
- (requestFocusResult ? "successful" : "failed")));
- if (!requestFocusResult) {
- viewToBeFocused.setOnFocusChangeListener(null);
- }
+ requestFocusAndShowKeyboard(R.id.password);
+ }
+ }
+
+ /**
+ * @param editViewId must be EditView
+ */
+ public void requestFocusAndShowKeyboard(int editViewId) {
+ // Set Focus to password View.
+ final View viewToBeFocused = mView.findViewById(editViewId);
+ if (viewToBeFocused == null) {
+ Log.w(TAG, "password field to be focused not found.");
+ } else if (!(viewToBeFocused instanceof EditText)) {
+ Log.w(TAG, "password field is not EditText");
+ } else {
+ // After acquiring the focus, we show software keyboard.
+ viewToBeFocused.setOnFocusChangeListener(this);
+ final boolean requestFocusResult = viewToBeFocused.requestFocus();
+ Log.i(TAG, String.format("Focus request %s.",
+ (requestFocusResult ? "successful" : "failed")));
+ if (!requestFocusResult) {
+ viewToBeFocused.setOnFocusChangeListener(null);
}
}
}
diff --git a/src/com/android/settings/wifi/WifiSettings.java b/src/com/android/settings/wifi/WifiSettings.java
index b81be6d..857e153 100644
--- a/src/com/android/settings/wifi/WifiSettings.java
+++ b/src/com/android/settings/wifi/WifiSettings.java
@@ -35,28 +35,29 @@
import android.net.wifi.ScanResult;
import android.net.wifi.SupplicantState;
import android.net.wifi.WifiConfiguration;
-import android.net.wifi.WifiConfiguration.KeyMgmt;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
+import android.net.wifi.WifiConfiguration.KeyMgmt;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.preference.CheckBoxPreference;
import android.preference.Preference;
+import android.preference.PreferenceActivity;
import android.preference.PreferenceScreen;
import android.provider.Settings.Secure;
import android.security.Credentials;
import android.security.KeyStore;
import android.view.ContextMenu;
-import android.view.ContextMenu.ContextMenuInfo;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
-import android.widget.AdapterView.AdapterContextMenuInfo;
+import android.view.ContextMenu.ContextMenuInfo;
import android.widget.Toast;
+import android.widget.AdapterView.AdapterContextMenuInfo;
import java.util.ArrayList;
import java.util.Collection;
@@ -171,7 +172,7 @@
// Avoid re-adding on returning from an overlapping activity/fragment.
if (getPreferenceScreen() == null || getPreferenceScreen().getPreferenceCount() < 2) {
if (mEnableNextOnConnection) {
- if (mEnableNextOnConnection && hasNextButton()) {
+ if (hasNextButton()) {
final ConnectivityManager connectivity = (ConnectivityManager)
getActivity().getSystemService(Context.CONNECTIVITY_SERVICE);
if (connectivity != null) {
@@ -445,6 +446,10 @@
updateConnectionState(WifiInfo.getDetailedStateOf((SupplicantState)
intent.getParcelableExtra(WifiManager.EXTRA_NEW_STATE)));
}
+
+ if (mInXlSetupWizard) {
+ ((WifiSettingsForSetupWizardXL)getActivity()).onSupplicantStateChanged(intent);
+ }
} else if (WifiManager.NETWORK_STATE_CHANGED_ACTION.equals(action)) {
NetworkInfo info = (NetworkInfo) intent.getParcelableExtra(
WifiManager.EXTRA_NETWORK_INFO);
@@ -588,11 +593,11 @@
}
} else if (config.networkId != INVALID_NETWORK_ID) {
if (mSelectedAccessPoint != null) {
- mWifiManager.saveNetwork(config);
+ saveNetwork(config);
}
} else {
if (configController.isEdit() || requireKeyStore(config)) {
- mWifiManager.saveNetwork(config);
+ saveNetwork(config);
} else {
mWifiManager.connectNetwork(config);
}
@@ -606,6 +611,14 @@
updateAccessPoints();
}
+ private void saveNetwork(WifiConfiguration config) {
+ if (mInXlSetupWizard) {
+ ((WifiSettingsForSetupWizardXL)getActivity()).onSaveNetwork(config);
+ } else {
+ mWifiManager.saveNetwork(config);
+ }
+ }
+
/* package */ void forget() {
mWifiManager.forgetNetwork(mSelectedAccessPoint.networkId);
diff --git a/src/com/android/settings/wifi/WifiSettingsForSetupWizardXL.java b/src/com/android/settings/wifi/WifiSettingsForSetupWizardXL.java
index d55cbe4..f420f34 100644
--- a/src/com/android/settings/wifi/WifiSettingsForSetupWizardXL.java
+++ b/src/com/android/settings/wifi/WifiSettingsForSetupWizardXL.java
@@ -20,7 +20,9 @@
import android.app.Activity;
import android.content.Context;
+import android.content.Intent;
import android.net.NetworkInfo.DetailedState;
+import android.net.wifi.WifiConfiguration;
import android.net.wifi.WifiManager;
import android.os.Bundle;
import android.os.Handler;
@@ -87,6 +89,10 @@
private final Handler mHandler = new Handler();
+ private int mPreviousWpsFieldsVisibility = View.GONE;
+ private int mPreviousSecurityFieldsVisibility = View.GONE;
+ private int mPreviousTypeVisibility = View.GONE;
+
// At first, we set "Skip" button disabled so that users won't press it soon after the screen
// migration. The button is enabled after the wifi module returns some result
// (a list of available network, etc.) One possible problem is that the notification from the
@@ -233,9 +239,9 @@
mProgressBar.setIndeterminate(false);
mProgressBar.setProgress(2);
mProgressText.setText(Summary.get(this, state));
- mStatusText.setVisibility(View.VISIBLE);
mStatusText.setText(R.string.wifi_setup_status_proceed_to_next);
+ mConnectButton.setVisibility(View.GONE);
mAddNetworkButton.setVisibility(View.GONE);
mRefreshButton.setVisibility(View.GONE);
mBackButton.setVisibility(View.VISIBLE);
@@ -260,13 +266,11 @@
mAddNetworkButton.setEnabled(true);
mRefreshButton.setEnabled(true);
- mSkipOrNextButton.setEnabled(true);
}
private void showConnectingStatus() {
mProgressBar.setIndeterminate(false);
mProgressBar.setProgress(1);
- mStatusText.setVisibility(View.VISIBLE);
mStatusText.setText(R.string.wifi_setup_status_connecting);
mProgressText.setText(Summary.get(this, DetailedState.CONNECTING));
}
@@ -276,7 +280,6 @@
((Button)findViewById(R.id.wifi_setup_add_network)).setEnabled(false);
((Button)findViewById(R.id.wifi_setup_refresh_list)).setEnabled(false);
mProgressText.setText(Summary.get(this, DetailedState.SCANNING));
- mStatusText.setVisibility(View.VISIBLE);
mStatusText.setText(R.string.wifi_setup_status_scanning);
}
@@ -294,6 +297,15 @@
* "Add network" button, meaning there's no selected access point.
*/
/* package */ void showConfigUi(AccessPoint selectedAccessPoint, boolean edit) {
+ if (selectedAccessPoint != null &&
+ (selectedAccessPoint.security == AccessPoint.SECURITY_WEP ||
+ selectedAccessPoint.security == AccessPoint.SECURITY_PSK)) {
+ // We forcibly set edit as true so that users can modify every field if they want,
+ // while config UI doesn't allow them to edit some of them when edit is false
+ // (e.g. password field is hiden when edit==false).
+ edit = true;
+ }
+
// We don't want to keep scanning Wi-Fi networks during users' configuring one network.
mWifiSettings.pauseWifiScan();
@@ -310,7 +322,6 @@
} else {
view.findViewById(R.id.wifi_general_info).setVisibility(View.GONE);
}
- // parent.addView(view);
if (selectedAccessPoint != null &&
selectedAccessPoint.security == AccessPoint.SECURITY_NONE) {
@@ -320,10 +331,15 @@
mStatusText.setText(R.string.wifi_setup_status_eap_not_supported);
mConnectButton.setVisibility(View.GONE);
} else {
- // mStatusText.setText(R.string.wifi_setup_status_edit_network);
- mStatusText.setVisibility(View.GONE);
+ mStatusText.setText(R.string.wifi_setup_status_edit_network);
mConnectButton.setVisibility(View.VISIBLE);
}
+
+ // WifiConfigController shows Connect button as "Save" when edit==true and a user
+ // tried to connect the network.
+ // In SetupWizard, we just show the button as "Connect" instead.
+ mConnectButton.setText(R.string.wifi_connect);
+
mAddNetworkButton.setVisibility(View.GONE);
mRefreshButton.setVisibility(View.GONE);
mSkipOrNextButton.setVisibility(View.GONE);
@@ -345,10 +361,24 @@
// Might be better to delay showing this button.
mBackButton.setVisibility(View.VISIBLE);
- findViewById(R.id.wps_fields).setVisibility(View.GONE);
- findViewById(R.id.security_fields).setVisibility(View.GONE);
- findViewById(R.id.type).setVisibility(View.GONE);
+ // We need to restore visibility status when the device failed to connect the network.
+ final View wpsFieldView = findViewById(R.id.wps_fields);
+ if (wpsFieldView != null) {
+ mPreviousWpsFieldsVisibility = wpsFieldView.getVisibility();
+ wpsFieldView.setVisibility(View.GONE);
+ }
+ final View securityFieldsView = findViewById(R.id.security_fields);
+ if (securityFieldsView != null) {
+ mPreviousSecurityFieldsVisibility = securityFieldsView.getVisibility();
+ securityFieldsView.setVisibility(View.GONE);
+ }
+ final View typeView = findViewById(R.id.type);
+ if (typeView != null) {
+ mPreviousTypeVisibility = typeView.getVisibility();
+ typeView.setVisibility(View.GONE);
+ }
+ mHandler.removeCallbacks(mSkipButtonEnabler);
mSkipOrNextButton.setVisibility(View.VISIBLE);
mSkipOrNextButton.setEnabled(false);
mConnectButton.setVisibility(View.GONE);
@@ -389,7 +419,6 @@
} else { // During user's Wifi configuration.
mWifiSettings.resumeWifiScan();
- mStatusText.setVisibility(View.VISIBLE);
mStatusText.setText(R.string.wifi_setup_status_select_network);
restoreFirstButtonVisibilityState();
@@ -437,4 +466,62 @@
mWifiSettings.refreshAccessPoints();
}
+
+ /**
+ * Called when {@link WifiSettings} received {@link WifiManager#SUPPLICANT_CHANGED_ACTION}.
+ */
+ /* package */ void onSupplicantStateChanged(Intent intent) {
+ final int errorCode = intent.getIntExtra(WifiManager.EXTRA_SUPPLICANT_ERROR, -1);
+ if (errorCode == WifiManager.ERROR_AUTHENTICATING) {
+ Log.i(TAG, "Received authentication error event.");
+ onAuthenticationFailure();
+ }
+ }
+
+ /**
+ * Called once when Authentication failed.
+ */
+ private void onAuthenticationFailure() {
+ mAfterConnectAction = false;
+ mStatusText.setText(R.string.wifi_setup_status_edit_network);
+ mSkipOrNextButton.setVisibility(View.GONE);
+ mConnectButton.setVisibility(View.VISIBLE);
+ mConnectButton.setEnabled(true);
+
+ // Restore View status which was tweaked on connection.
+ final View wpsFieldView = findViewById(R.id.wps_fields);
+ if (wpsFieldView != null) {
+ wpsFieldView.setVisibility(mPreviousWpsFieldsVisibility);
+ }
+ final View securityFieldsView = findViewById(R.id.security_fields);
+ if (securityFieldsView != null) {
+ securityFieldsView.setVisibility(mPreviousSecurityFieldsVisibility);
+ if (mPreviousSecurityFieldsVisibility == View.VISIBLE && mWifiConfig != null) {
+ final View passwordView = findViewById(R.id.password);
+ if (passwordView != null) {
+ if (passwordView.isFocused()) {
+ final InputMethodManager inputMethodManager = (InputMethodManager)
+ getSystemService(Context.INPUT_METHOD_SERVICE);
+ inputMethodManager.showSoftInput(passwordView, 0);
+ } else {
+ mWifiConfig.requestFocusAndShowKeyboard(R.id.password);
+ }
+ }
+ }
+ }
+ final View typeView = findViewById(R.id.type);
+ if (typeView != null) {
+ typeView.setVisibility(mPreviousTypeVisibility);
+ }
+ }
+
+ /**
+ * Called when WifiManager is requested to save a network. This method sholud include
+ * WifiManager#saveNetwork() call.
+ *
+ * Currently this method calls {@link WifiManager#connectNetwork(int)}.
+ */
+ /* package */ void onSaveNetwork(WifiConfiguration config) {
+ mWifiManager.connectNetwork(config);
+ }
}