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

Commit 705f1df8 authored by SongFerngWang's avatar SongFerngWang
Browse files

The wifi list is not null at no signal room

- check the wifi list's size for error message.
- fix the carrier's summary display "connect" at no signal room

Bug: 177390298
Test: atest ProviderModelSliceHelperTest
atest ProviderModelSliceTest

Change-Id: I692aadd01a290cce2438b0d3c084bef8d8d3fa24
parent 0b1f5144
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -131,8 +131,9 @@ public class ProviderModelSlice extends WifiSlice {
        }

        // Third section:  Add the Wi-Fi items which are not connected.
        if (wifiList != null) {
            log("get Wi-Fi items which are not connected");
        if (wifiList != null && wifiList.size() > 0) {
            log("get Wi-Fi items which are not connected. Wi-Fi items : " + wifiList.size());

            final List<WifiSliceItem> disconnectedWifiList = wifiList.stream()
                    .filter(wifiSliceItem -> wifiSliceItem.getConnectedState()
                            != WifiEntry.CONNECTED_STATE_CONNECTED)
@@ -149,8 +150,8 @@ public class ProviderModelSlice extends WifiSlice {
        // 2) show all_network_unavailable:
        //    - while no wifi item + no carrier
        //    - while no wifi item + no data capability
        if (worker == null || wifiList == null) {
            log("wifiList is null");
        if (worker == null || wifiList == null || wifiList.size() == 0) {
            log("no wifi item");
            int resId = R.string.non_carrier_network_unavailable;
            if (!hasCarrier || !mHelper.isDataSimActive()) {
                log("No carrier item or no carrier data.");
+1 −1
Original line number Diff line number Diff line
@@ -175,7 +175,7 @@ public class ProviderModelSliceHelper {
    }

    protected boolean isDataSimActive() {
        return MobileNetworkUtils.activeNetworkIsCellular(mContext);
        return isNoCarrierData() ? false : MobileNetworkUtils.activeNetworkIsCellular(mContext);
    }

    protected boolean isNoCarrierData() {