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

Commit 6ee89475 authored by govenliu's avatar govenliu
Browse files

[Wi-Fi HotSpot] Improve Wi-Fi hotspot settings entries visibility problem

When the security type of hotspot changed, the hidden item will showed because of the Expanded child list is set as constant.

To improve it, dynamicall adjust the Expanded child count according to the security type.

Bug: 138594907
Test: Manually
      1. Enter Settings APP -> Network & internet -> Hotspot & tethering
      ->Wi-Fi hotspot
      2. Check if there are only two expanded items if the
      Security type is None, or three expaned items if the Security type
      is WPA2-personal
      3. Change the Security type and back to check item 2 match or not.

Change-Id: I84d1c5dca94d6a218cfc7ecd57e201e1cffdd878
parent 0ec21f8a
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -20,8 +20,7 @@
    xmlns:settings="http://schemas.android.com/apk/res-auto"
    android:key="wifi_tether_settings_screen"
    android:title="@string/wifi_hotspot_checkbox_text"
    settings:searchable="false"
    settings:initialExpandedChildrenCount="3">
    settings:searchable="false">

    <com.android.settings.wifi.tether.WifiTetherSsidPreference
        android:key="wifi_tether_network_name"
+1 −1
Original line number Diff line number Diff line
@@ -90,7 +90,7 @@ public class WifiTetherApBandPreferenceController extends WifiTetherBasePreferen
        mBandIndex = validateSelection(Integer.parseInt((String) newValue));
        Log.d(TAG, "Band preference changed, updating band index to " + mBandIndex);
        preference.setSummary(getConfigSummary());
        mListener.onTetherConfigUpdated();
        mListener.onTetherConfigUpdated(this);
        return true;
    }

+1 −1
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ public abstract class WifiTetherBasePreferenceController extends AbstractPrefere
        implements PreferenceControllerMixin, Preference.OnPreferenceChangeListener {

    public interface OnTetherConfigUpdateListener {
        void onTetherConfigUpdated();
        void onTetherConfigUpdated(AbstractPreferenceController context);
    }

    protected final WifiManager mWifiManager;
+1 −1
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@ public class WifiTetherPasswordPreferenceController extends WifiTetherBasePrefer
    public boolean onPreferenceChange(Preference preference, Object newValue) {
        mPassword = (String) newValue;
        updatePasswordDisplay((EditTextPreference) mPreference);
        mListener.onTetherConfigUpdated();
        mListener.onTetherConfigUpdated(this);
        return true;
    }

+1 −1
Original line number Diff line number Diff line
@@ -93,7 +93,7 @@ public class WifiTetherSSIDPreferenceController extends WifiTetherBasePreference
    public boolean onPreferenceChange(Preference preference, Object newValue) {
        mSSID = (String) newValue;
        updateSsidDisplay((EditTextPreference) preference);
        mListener.onTetherConfigUpdated();
        mListener.onTetherConfigUpdated(this);
        return true;
    }

Loading