Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3fa336b6 authored by Nikhil Nayunigari's avatar Nikhil Nayunigari Committed by Android (Google) Code Review
Browse files

Merge "Add defaults for shared and edit config switches in Add network dialog" into main

parents 8544174e ef151a1b
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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>
+12 −1
Original line number Diff line number Diff line
@@ -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
+0 −1
Original line number Diff line number Diff line
@@ -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();