From 1e034fe79a164a12385b077e2aad9ebfaab5e389 Mon Sep 17 00:00:00 2001 From: Pavel Zhamaitsiak Date: Thu, 12 Mar 2015 12:36:17 -0700 Subject: [PATCH 1/5] Remove WFC Roaming setting Bug 19682545 Change-Id: I0adc7a20c411dd1fea3e2b79bcd5e159537a65c0 --- res/values/strings.xml | 4 --- res/xml/wifi_calling_settings.xml | 5 --- .../android/settings/WifiCallingSettings.java | 35 +------------------ 3 files changed, 1 insertion(+), 43 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 8e29e5ddc64..25d0cc6c2c9 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -1908,10 +1908,6 @@ Cellular preferred (Uses Wi-Fi only if cell network isn\'t available) Wi-Fi only (Never uses cell network. Can\'t make or receive calls if Wi-Fi isn\'t available) - - WFC handoff while roaming - - Allow Wi-Fi voice calls handoff to cell network when roaming diff --git a/res/xml/wifi_calling_settings.xml b/res/xml/wifi_calling_settings.xml index 37a2d285ba6..ca4e560e422 100644 --- a/res/xml/wifi_calling_settings.xml +++ b/res/xml/wifi_calling_settings.xml @@ -26,9 +26,4 @@ android:entryValues="@array/wifi_calling_mode_values" android:dialogTitle="@string/wifi_calling_mode_dialog_title" /> - - diff --git a/src/com/android/settings/WifiCallingSettings.java b/src/com/android/settings/WifiCallingSettings.java index dacdc7b0a95..25f1e58aacb 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)); } } }; @@ -154,9 +141,6 @@ 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); } @@ -183,10 +167,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 +203,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 +216,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; } From e8616913b43d9356b5556dd0f2cab72d8ab4e875 Mon Sep 17 00:00:00 2001 From: Pavel Zhamaitsiak Date: Thu, 12 Mar 2015 15:29:11 -0700 Subject: [PATCH 2/5] Disable Wi-Fi Calling when getting "registration error" intent. Bug: 19698057 Change-Id: I403417e08f84014fb9bd9f213fd2b8644e2a6541 --- src/com/android/settings/WifiCallingSettings.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/com/android/settings/WifiCallingSettings.java b/src/com/android/settings/WifiCallingSettings.java index 25f1e58aacb..8e2c7ed9fbc 100644 --- a/src/com/android/settings/WifiCallingSettings.java +++ b/src/com/android/settings/WifiCallingSettings.java @@ -118,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. @@ -127,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); } } @@ -142,7 +145,7 @@ public class WifiCallingSettings extends SettingsPreferenceFragment mButtonWfcMode.setOnPreferenceChangeListener(this); mIntentFilter = new IntentFilter(); - mIntentFilter.addAction(ImsPhone.REGISTRATION_ERROR); + mIntentFilter.addAction(ImsManager.ACTION_IMS_REGISTRATION_ERROR); } @Override From 8fc9341b38c45f71733636cd398afbe7238dcf6e Mon Sep 17 00:00:00 2001 From: Lorenzo Colitti Date: Mon, 16 Mar 2015 23:45:55 +0900 Subject: [PATCH 3/5] Add a developer settings checkbox to use the legacy DHCP client. Change-Id: I18471bdf137fbb128d7e4ae6b9b1a4675f5e7fbc --- res/values/strings.xml | 42 ++++++++++++------- res/xml/development_prefs.xml | 22 +++++++--- .../android/settings/DevelopmentSettings.java | 26 ++++++++++-- 3 files changed, 65 insertions(+), 25 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index c956e7bd656..e22e5f2df15 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -3452,22 +3452,6 @@ WARNING: Device protection features will not work on this device while this setting is turned on. - - Wireless display certification - - Enable Wi\u2011Fi Verbose Logging - - Aggressive Wi\u2011Fi to Cellular handover - - Always allow Wi\u2011Fi Roam Scans - - Show options for wireless display certification - - Increase Wi\u2011Fi logging level, show per SSID RSSI in Wi\u2011Fi Picker - - When enabled, Wi\u2011Fi will be more aggressive in handing over the data connection to Cellular, when Wi\u2011Fi signal is low - - Allow/Disallow Wi\u2011Fi Roam Scans based on the amount of data traffic present at the interface Logger buffer sizes @@ -3479,6 +3463,32 @@ Enable view attribute inspection + + + Networking + + + Wireless display certification + + Enable Wi\u2011Fi Verbose Logging + + Aggressive Wi\u2011Fi to Cellular handover + + Always allow Wi\u2011Fi Roam Scans + + Use legacy DHCP client + + + Show options for wireless display certification + + Increase Wi\u2011Fi logging level, show per SSID RSSI in Wi\u2011Fi Picker + + When enabled, Wi\u2011Fi will be more aggressive in handing over the data connection to Cellular, when Wi\u2011Fi signal is low + + Allow/Disallow Wi\u2011Fi Roam Scans based on the amount of data traffic present at the interface + + Use the DHCP client from Lollipop instead of the new Android DHCP client. + Allow USB debugging? USB debugging is intended for development purposes only. Use it to copy data between your computer and your device, install apps on your device without notification, and read log data. diff --git a/res/xml/development_prefs.xml b/res/xml/development_prefs.xml index f31d5569ca4..1a03c2c835c 100644 --- a/res/xml/development_prefs.xml +++ b/res/xml/development_prefs.xml @@ -103,6 +103,18 @@ android:title="@string/verify_apps_over_usb_title" android:summary="@string/verify_apps_over_usb_summary"/> + + + + + + android:summary="@string/wifi_allow_scan_with_traffic_summary"/> - + + android:summary="@string/legacy_dhcp_client_summary"/> diff --git a/src/com/android/settings/DevelopmentSettings.java b/src/com/android/settings/DevelopmentSettings.java index a001fd78687..51177e1743f 100644 --- a/src/com/android/settings/DevelopmentSettings.java +++ b/src/com/android/settings/DevelopmentSettings.java @@ -135,13 +135,16 @@ public class DevelopmentSettings extends SettingsPreferenceFragment private static final String OVERLAY_DISPLAY_DEVICES_KEY = "overlay_display_devices"; 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 WIFI_LEGACY_DHCP_CLIENT_KEY = "legacy_dhcp_client"; private static final String OPENGL_TRACES_KEY = "enable_opengl_traces"; @@ -197,6 +200,7 @@ public class DevelopmentSettings extends SettingsPreferenceFragment private SwitchPreference mWifiDisplayCertification; private SwitchPreference mWifiVerboseLogging; private SwitchPreference mWifiAggressiveHandover; + private SwitchPreference mLegacyDhcpClient; private SwitchPreference mWifiAllowScansWithTraffic; private SwitchPreference mStrictMode; @@ -336,6 +340,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); mWindowAnimationScale = addListPreference(WINDOW_ANIMATION_SCALE_KEY); @@ -543,6 +548,7 @@ public class DevelopmentSettings extends SettingsPreferenceFragment updateWifiVerboseLoggingOptions(); updateWifiAggressiveHandoverOptions(); updateWifiAllowScansWithTrafficOptions(); + updateLegacyDhcpClientOptions(); updateSimulateColorSpace(); updateUseNuplayerOptions(); updateUSBAudioOptions(); @@ -1073,6 +1079,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); @@ -1450,6 +1468,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) { From 71a692225efed6ac3b318441bc31e637204561f6 Mon Sep 17 00:00:00 2001 From: Pavel Zhamaitsiak Date: Wed, 18 Mar 2015 12:49:59 -0700 Subject: [PATCH 4/5] Remove WFC roaming from search keywords Bug: 19682545 Change-Id: I8606d75a70d2ad3fb646472f8baddbe12e5bac21 --- res/values/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 25d0cc6c2c9..1dafbeb8e63 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -5633,7 +5633,7 @@ wifi wi-fi network connection text message texting messages messaging cellular cell carrier wireless data 4g 3g 2g lte - wifi wi-fi call calling roaming handoff + wifi wi-fi call calling launcher screen touchscreen dim screen touchscreen battery From 3eb3b104d7f05ae330e2d91b346d4ecf765845f2 Mon Sep 17 00:00:00 2001 From: Sanket Padawe Date: Fri, 20 Mar 2015 10:07:50 -0700 Subject: [PATCH 5/5] Restore password visibility on screen rotation in Hotspot/Wifi setup. Bug: 16237425 Change-Id: I2bf0aaaa657d60f007858c6635d2a17326562c66 --- src/com/android/settings/wifi/WifiApDialog.java | 9 +++++++++ .../settings/wifi/WifiConfigController.java | 16 +++++++--------- src/com/android/settings/wifi/WifiDialog.java | 5 +++++ 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/com/android/settings/wifi/WifiApDialog.java b/src/com/android/settings/wifi/WifiApDialog.java index eee3db9706d..3c4d912d31c 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 5462d262e28..c0dbaa471d2 100644 --- a/src/com/android/settings/wifi/WifiConfigController.java +++ b/src/com/android/settings/wifi/WifiConfigController.java @@ -999,14 +999,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 942c5dd871c..ce554bca9c6 100644 --- a/src/com/android/settings/wifi/WifiDialog.java +++ b/src/com/android/settings/wifi/WifiDialog.java @@ -74,6 +74,11 @@ class WifiDialog extends AlertDialog implements WifiConfigUiBase { } } + public void onRestoreInstanceState(Bundle savedInstanceState) { + super.onRestoreInstanceState(savedInstanceState); + mController.updatePassword(); + } + @Override public boolean isEdit() { return mEdit;