diff options
Diffstat (limited to 'src/com/android/settings')
-rw-r--r-- | src/com/android/settings/DevelopmentSettings.java | 27 | ||||
-rw-r--r-- | src/com/android/settings/WifiCallingSettings.java | 42 | ||||
-rw-r--r-- | src/com/android/settings/wifi/WifiApDialog.java | 9 | ||||
-rw-r--r-- | src/com/android/settings/wifi/WifiConfigController.java | 16 | ||||
-rw-r--r-- | src/com/android/settings/wifi/WifiDialog.java | 5 |
5 files changed, 51 insertions, 48 deletions
diff --git a/src/com/android/settings/DevelopmentSettings.java b/src/com/android/settings/DevelopmentSettings.java index b5b33f4..192bd5c 100644 --- a/src/com/android/settings/DevelopmentSettings.java +++ b/src/com/android/settings/DevelopmentSettings.java @@ -140,15 +140,19 @@ public class DevelopmentSettings extends SettingsPreferenceFragment private static final String OVERLAY_DISPLAY_DEVICES_KEY = "overlay_display_devices"; private static final String ENABLE_MULTI_WINDOW_KEY = "enable_multi_window"; private static final String DEBUG_DEBUGGING_CATEGORY_KEY = "debug_debugging_category"; + private static final String DEBUG_APPLICATIONS_CATEGORY_KEY = "debug_applications_category"; + private static final String SELECT_LOGD_SIZE_KEY = "select_logd_size"; + private static final String SELECT_LOGD_SIZE_PROPERTY = "persist.logd.size"; + private static final String SELECT_LOGD_DEFAULT_SIZE_PROPERTY = "ro.logd.size"; + + private static final String DEBUG_NETWORKING_CATEGORY_KEY = "debug_networking_category"; private static final String WIFI_DISPLAY_CERTIFICATION_KEY = "wifi_display_certification"; private static final String WIFI_VERBOSE_LOGGING_KEY = "wifi_verbose_logging"; private static final String WIFI_AGGRESSIVE_HANDOVER_KEY = "wifi_aggressive_handover"; private static final String WIFI_ALLOW_SCAN_WITH_TRAFFIC_KEY = "wifi_allow_scan_with_traffic"; - private static final String SELECT_LOGD_SIZE_KEY = "select_logd_size"; - private static final String SELECT_LOGD_SIZE_PROPERTY = "persist.logd.size"; - private static final String SELECT_LOGD_DEFAULT_SIZE_PROPERTY = "ro.logd.size"; private static final String USB_CONFIGURATION_KEY = "select_usb_configuration"; private static final String SELECT_USB_CONFIGURATION_PROPERTY = "sys.usb.config"; + private static final String WIFI_LEGACY_DHCP_CLIENT_KEY = "legacy_dhcp_client"; private static final String OPENGL_TRACES_KEY = "enable_opengl_traces"; @@ -203,6 +207,7 @@ public class DevelopmentSettings extends SettingsPreferenceFragment private SwitchPreference mWifiDisplayCertification; private SwitchPreference mWifiVerboseLogging; private SwitchPreference mWifiAggressiveHandover; + private SwitchPreference mLegacyDhcpClient; private SwitchPreference mWifiAllowScansWithTraffic; private SwitchPreference mStrictMode; @@ -343,6 +348,7 @@ public class DevelopmentSettings extends SettingsPreferenceFragment mWifiVerboseLogging = findAndInitSwitchPref(WIFI_VERBOSE_LOGGING_KEY); mWifiAggressiveHandover = findAndInitSwitchPref(WIFI_AGGRESSIVE_HANDOVER_KEY); mWifiAllowScansWithTraffic = findAndInitSwitchPref(WIFI_ALLOW_SCAN_WITH_TRAFFIC_KEY); + mLegacyDhcpClient = findAndInitSwitchPref(WIFI_LEGACY_DHCP_CLIENT_KEY); mLogdSize = addListPreference(SELECT_LOGD_SIZE_KEY); mUsbConfiguration = addListPreference(USB_CONFIGURATION_KEY); @@ -578,6 +584,7 @@ public class DevelopmentSettings extends SettingsPreferenceFragment updateWifiVerboseLoggingOptions(); updateWifiAggressiveHandoverOptions(); updateWifiAllowScansWithTrafficOptions(); + updateLegacyDhcpClientOptions(); updateSimulateColorSpace(); updateUseNuplayerOptions(); updateUSBAudioOptions(); @@ -1120,6 +1127,18 @@ public class DevelopmentSettings extends SettingsPreferenceFragment mWifiManager.setAllowScansWithTraffic(mWifiAllowScansWithTraffic.isChecked() ? 1 : 0); } + private void updateLegacyDhcpClientOptions() { + updateSwitchPreference(mLegacyDhcpClient, Settings.Global.getInt( + getActivity().getContentResolver(), + Settings.Global.LEGACY_DHCP_CLIENT, 0) != 0); + } + + private void writeLegacyDhcpClientOptions() { + Settings.Global.putInt(getActivity().getContentResolver(), + Settings.Global.LEGACY_DHCP_CLIENT, + mLegacyDhcpClient.isChecked() ? 1 : 0); + } + private void updateLogdSizeValues() { if (mLogdSize != null) { String currentValue = SystemProperties.get(SELECT_LOGD_SIZE_PROPERTY); @@ -1558,6 +1577,8 @@ public class DevelopmentSettings extends SettingsPreferenceFragment writeWifiAggressiveHandoverOptions(); } else if (preference == mWifiAllowScansWithTraffic) { writeWifiAllowScansWithTrafficOptions(); + } else if (preference == mLegacyDhcpClient) { + writeLegacyDhcpClientOptions(); } else if (preference == mUseAwesomePlayer) { writeUseAwesomePlayerOptions(); } else if (preference == mUSBAudio) { diff --git a/src/com/android/settings/WifiCallingSettings.java b/src/com/android/settings/WifiCallingSettings.java index dacdc7b..8e2c7ed 100644 --- a/src/com/android/settings/WifiCallingSettings.java +++ b/src/com/android/settings/WifiCallingSettings.java @@ -25,7 +25,6 @@ import android.content.IntentFilter; import android.os.Bundle; import android.preference.ListPreference; import android.preference.Preference; -import android.preference.SwitchPreference; import android.telephony.PhoneStateListener; import android.telephony.TelephonyManager; import android.util.Log; @@ -38,8 +37,7 @@ import com.android.settings.widget.SwitchBar; /** * "Wi-Fi Calling settings" screen. This preference screen lets you - * enable/disable Wi-Fi Calling, change mode, enable/disable - * handover while on roaming. + * enable/disable Wi-Fi Calling and change Wi-Fi Calling mode. */ public class WifiCallingSettings extends SettingsPreferenceFragment implements SwitchBar.OnSwitchChangeListener, @@ -49,13 +47,11 @@ public class WifiCallingSettings extends SettingsPreferenceFragment //String keys for preference lookup private static final String BUTTON_WFC_MODE = "wifi_calling_mode"; - private static final String BUTTON_WFC_ROAM = "wifi_calling_roam"; //UI objects private SwitchBar mSwitchBar; private Switch mSwitch; private ListPreference mButtonWfcMode; - private SwitchPreference mButtonWfcRoam; private final PhoneStateListener mPhoneStateListener = new PhoneStateListener() { /* @@ -77,18 +73,9 @@ public class WifiCallingSettings extends SettingsPreferenceFragment && isNonTtyOrTtyOnVolteEnabled); Preference pref = getPreferenceScreen().findPreference(BUTTON_WFC_MODE); - int wfcMode = ImsConfig.WfcModeFeatureValueConstants.WIFI_ONLY; if (pref != null) { pref.setEnabled(isWfcEnabled && (state == TelephonyManager.CALL_STATE_IDLE)); - ListPreference prefWfcMode = (ListPreference) pref; - wfcMode = Integer.valueOf(prefWfcMode.getValue()).intValue(); - } - pref = getPreferenceScreen().findPreference(BUTTON_WFC_ROAM); - if (pref != null) { - pref.setEnabled(isWfcEnabled - && (wfcMode != ImsConfig.WfcModeFeatureValueConstants.WIFI_ONLY) - && (state == TelephonyManager.CALL_STATE_IDLE)); } } }; @@ -131,7 +118,7 @@ public class WifiCallingSettings extends SettingsPreferenceFragment @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); - if (action.equals(ImsPhone.REGISTRATION_ERROR)) { + if (action.equals(ImsManager.ACTION_IMS_REGISTRATION_ERROR)) { // If this fragment is active then we are immediately // showing alert on screen. There is no need to add // notification in this case. @@ -140,6 +127,9 @@ public class WifiCallingSettings extends SettingsPreferenceFragment // not show notification, we are changing result code here. setResultCode(Activity.RESULT_CANCELED); + // UX requirement is to disable WFC in case of "permanent" registration failures. + mSwitch.setChecked(false); + showAlert(intent); } } @@ -154,11 +144,8 @@ public class WifiCallingSettings extends SettingsPreferenceFragment mButtonWfcMode = (ListPreference) findPreference(BUTTON_WFC_MODE); mButtonWfcMode.setOnPreferenceChangeListener(this); - mButtonWfcRoam = (SwitchPreference) findPreference(BUTTON_WFC_ROAM); - mButtonWfcRoam.setOnPreferenceChangeListener(this); - mIntentFilter = new IntentFilter(); - mIntentFilter.addAction(ImsPhone.REGISTRATION_ERROR); + mIntentFilter.addAction(ImsManager.ACTION_IMS_REGISTRATION_ERROR); } @Override @@ -183,10 +170,6 @@ public class WifiCallingSettings extends SettingsPreferenceFragment mButtonWfcMode.setValue(Integer.toString(wfcMode)); mButtonWfcMode.setSummary(getWfcModeSummary(context, wfcMode)); - mButtonWfcRoam.setChecked(wfcEnabled - && (wfcMode != ImsConfig.WfcModeFeatureValueConstants.WIFI_ONLY) - && ImsManager.isWfcRoamingEnabledByUser(context)); - context.registerReceiver(mIntentReceiver, mIntentFilter); Intent intent = getActivity().getIntent(); @@ -223,10 +206,6 @@ public class WifiCallingSettings extends SettingsPreferenceFragment int wfcMode = ImsManager.getWfcMode(context); mButtonWfcMode.setSummary(getWfcModeSummary(context, wfcMode)); mButtonWfcMode.setEnabled(isChecked); - boolean wfcHandoffEnabled = (wfcMode != ImsConfig.WfcModeFeatureValueConstants.WIFI_ONLY); - mButtonWfcRoam.setEnabled(isChecked && wfcHandoffEnabled); - mButtonWfcRoam.setChecked(isChecked && wfcHandoffEnabled - && ImsManager.isWfcRoamingEnabledByUser(context)); } @Override @@ -240,15 +219,6 @@ public class WifiCallingSettings extends SettingsPreferenceFragment ImsManager.setWfcMode(context, buttonMode); mButtonWfcMode.setSummary(getWfcModeSummary(context, buttonMode)); } - boolean wfcHandoffEnabled = - (buttonMode != ImsConfig.WfcModeFeatureValueConstants.WIFI_ONLY); - mButtonWfcRoam.setEnabled(wfcHandoffEnabled); - mButtonWfcRoam.setChecked(wfcHandoffEnabled && - ImsManager.isWfcRoamingEnabledByUser(context)); - } else if (preference == mButtonWfcRoam) { - SwitchPreference wfcRoamPref = (SwitchPreference) preference; - wfcRoamPref.setChecked(!wfcRoamPref.isChecked()); - ImsManager.setWfcRoamingSetting(context, wfcRoamPref.isChecked()); } return true; } diff --git a/src/com/android/settings/wifi/WifiApDialog.java b/src/com/android/settings/wifi/WifiApDialog.java index eee3db9..3c4d912 100644 --- a/src/com/android/settings/wifi/WifiApDialog.java +++ b/src/com/android/settings/wifi/WifiApDialog.java @@ -184,6 +184,15 @@ public class WifiApDialog extends AlertDialog implements View.OnClickListener, validate(); } + public void onRestoreInstanceState(Bundle savedInstanceState) { + super.onRestoreInstanceState(savedInstanceState); + mPassword.setInputType( + InputType.TYPE_CLASS_TEXT | + (((CheckBox) mView.findViewById(R.id.show_password)).isChecked() ? + InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD : + InputType.TYPE_TEXT_VARIATION_PASSWORD)); + } + private void validate() { if ((mSsid != null && mSsid.length() == 0) || ((mSecurityTypeIndex == WPA2_INDEX)&& diff --git a/src/com/android/settings/wifi/WifiConfigController.java b/src/com/android/settings/wifi/WifiConfigController.java index e244b7f..cc8481d 100644 --- a/src/com/android/settings/wifi/WifiConfigController.java +++ b/src/com/android/settings/wifi/WifiConfigController.java @@ -971,14 +971,12 @@ public class WifiConfigController implements TextWatcher, /** * Make the characters of the password visible if show_password is checked. */ - private void updatePasswordVisibility(boolean checked) { - int pos = mPasswordView.getSelectionEnd(); - mPasswordView.setInputType( - InputType.TYPE_CLASS_TEXT | (checked ? - InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD : - InputType.TYPE_TEXT_VARIATION_PASSWORD)); - if (pos >= 0) { - ((EditText)mPasswordView).setSelection(pos); - } + public void updatePassword() { + TextView passwdView = (TextView) mView.findViewById(R.id.password); + passwdView.setInputType( + InputType.TYPE_CLASS_TEXT | + (((CheckBox) mView.findViewById(R.id.show_password)).isChecked() ? + InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD : + InputType.TYPE_TEXT_VARIATION_PASSWORD)); } } diff --git a/src/com/android/settings/wifi/WifiDialog.java b/src/com/android/settings/wifi/WifiDialog.java index 1f03fe3..1e8a981 100644 --- a/src/com/android/settings/wifi/WifiDialog.java +++ b/src/com/android/settings/wifi/WifiDialog.java @@ -75,6 +75,11 @@ class WifiDialog extends AlertDialog implements WifiConfigUiBase { } } + public void onRestoreInstanceState(Bundle savedInstanceState) { + super.onRestoreInstanceState(savedInstanceState); + mController.updatePassword(); + } + @Override public boolean isEdit() { return mEdit; |