Loading res/values/config.xml +6 −0 Original line number Diff line number Diff line Loading @@ -869,4 +869,10 @@ <!-- Whether the Gaze is enabled --> <bool name="config_gazeEnabled">false</bool> <!-- Whether to share the WiFi network by default. --> <bool name="config_share_network_by_default">true</bool> <!-- Whether to allow other device users to edit network configuration of a shared network by default. --> <bool name="config_allow_edit_network_configuration_by_default">true</bool> </resources> src/com/android/settings/wifi/WifiConfigController2.java +12 −1 Original line number Diff line number Diff line Loading @@ -355,12 +355,23 @@ public class WifiConfigController2 implements TextWatcher, if (com.android.settings.connectivity.Flags.wifiMultiuser()) { int userCount = mUserManager.getUserCount(); mSharedSwitch.setOnCheckedChangeListener(this); mView.findViewById(R.id.sharing_toggle_fields) .setVisibility(userCount > 1 ? View.VISIBLE : View.GONE); mEditConfigurationSwitch.setEnabled(false); mView.findViewById(R.id.edit_wifi_network_configuration_fields) .setVisibility(userCount > 1 ? View.VISIBLE : View.GONE); boolean sharedDefault = mContext.getResources().getBoolean(R.bool.config_share_network_by_default); boolean editConfigDefault = mContext.getResources() .getBoolean(R.bool.config_allow_edit_network_configuration_by_default); mSharedSwitch.setChecked(sharedDefault); mEditConfigurationSwitch.setEnabled(sharedDefault); mEditConfigurationSwitch.setChecked(editConfigDefault); mSharedSwitch.setOnCheckedChangeListener(this); } if (mWifiEntry == null) { // new network Loading tests/robotests/src/com/android/settings/wifi/WifiConfigController2Test.java +0 −1 Original line number Diff line number Diff line Loading @@ -232,7 +232,6 @@ public class WifiConfigController2Test { final Switch sharedSwitch = mView.findViewById(R.id.share_wifi_network); assertThat(sharedSwitch).isNotNull(); assertThat(sharedSwitch.getVisibility()).isEqualTo(View.VISIBLE); sharedSwitch.setChecked(true); WifiConfiguration config = mController.getConfig(); Loading Loading
res/values/config.xml +6 −0 Original line number Diff line number Diff line Loading @@ -869,4 +869,10 @@ <!-- Whether the Gaze is enabled --> <bool name="config_gazeEnabled">false</bool> <!-- Whether to share the WiFi network by default. --> <bool name="config_share_network_by_default">true</bool> <!-- Whether to allow other device users to edit network configuration of a shared network by default. --> <bool name="config_allow_edit_network_configuration_by_default">true</bool> </resources>
src/com/android/settings/wifi/WifiConfigController2.java +12 −1 Original line number Diff line number Diff line Loading @@ -355,12 +355,23 @@ public class WifiConfigController2 implements TextWatcher, if (com.android.settings.connectivity.Flags.wifiMultiuser()) { int userCount = mUserManager.getUserCount(); mSharedSwitch.setOnCheckedChangeListener(this); mView.findViewById(R.id.sharing_toggle_fields) .setVisibility(userCount > 1 ? View.VISIBLE : View.GONE); mEditConfigurationSwitch.setEnabled(false); mView.findViewById(R.id.edit_wifi_network_configuration_fields) .setVisibility(userCount > 1 ? View.VISIBLE : View.GONE); boolean sharedDefault = mContext.getResources().getBoolean(R.bool.config_share_network_by_default); boolean editConfigDefault = mContext.getResources() .getBoolean(R.bool.config_allow_edit_network_configuration_by_default); mSharedSwitch.setChecked(sharedDefault); mEditConfigurationSwitch.setEnabled(sharedDefault); mEditConfigurationSwitch.setChecked(editConfigDefault); mSharedSwitch.setOnCheckedChangeListener(this); } if (mWifiEntry == null) { // new network Loading
tests/robotests/src/com/android/settings/wifi/WifiConfigController2Test.java +0 −1 Original line number Diff line number Diff line Loading @@ -232,7 +232,6 @@ public class WifiConfigController2Test { final Switch sharedSwitch = mView.findViewById(R.id.share_wifi_network); assertThat(sharedSwitch).isNotNull(); assertThat(sharedSwitch.getVisibility()).isEqualTo(View.VISIBLE); sharedSwitch.setChecked(true); WifiConfiguration config = mController.getConfig(); Loading