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

Commit 50a9e605 authored by Ying Xu's avatar Ying Xu Committed by Automerger Merge Worker
Browse files

Merge "Show the icons in QS/SB as long as the default is default" into sc-dev am: c09eeb3a

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15053408

Change-Id: I2cc56d20455d6d3a231aa6b55680ca69b532485c
parents 6f80503a c09eeb3a
Loading
Loading
Loading
Loading
+2 −9
Original line number Diff line number Diff line
@@ -387,15 +387,8 @@ public class MobileSignalController extends SignalController<MobileState, Mobile
            int qsTypeIcon = 0;
            IconState qsIcon = null;
            CharSequence description = null;
            // Mobile icon will only be shown in the statusbar in 2 scenarios
            // 1. Mobile is the default network, and it is validated
            // 2. Mobile is the default network, it is not validated and there is no other
            // non-Carrier WiFi networks available.
            boolean maybeShowIcons = (mCurrentState.inetCondition == 1)
                    || (mCurrentState.inetCondition == 0
                            && !mNetworkController.isNonCarrierWifiNetworkAvailable());
            // Only send data sim callbacks to QS.
            if (mCurrentState.dataSim && mCurrentState.isDefault && maybeShowIcons) {
            if (mCurrentState.dataSim && mCurrentState.isDefault) {
                qsTypeIcon =
                        (showDataIcon || mConfig.alwaysShowDataRatIcon) ? icons.qsDataType : 0;
                qsIcon = new IconState(mCurrentState.enabled
@@ -408,7 +401,7 @@ public class MobileSignalController extends SignalController<MobileState, Mobile
            boolean activityOut = mCurrentState.dataConnected
                    && !mCurrentState.carrierNetworkChangeMode
                    && mCurrentState.activityOut;
            showDataIcon &= mCurrentState.dataSim && mCurrentState.isDefault && maybeShowIcons;
            showDataIcon &= mCurrentState.dataSim && mCurrentState.isDefault;
            boolean showTriangle = showDataIcon && !mCurrentState.airplaneMode;
            int typeIcon = (showDataIcon || mConfig.alwaysShowDataRatIcon) ? icons.dataType : 0;
            showDataIcon |= mCurrentState.roaming;
+3 −17
Original line number Diff line number Diff line
@@ -109,17 +109,10 @@ public class WifiSignalController extends
            contentDescription += ("," + mContext.getString(R.string.data_connection_no_internet));
        }
        if (mProviderModel) {
            // WiFi icon will only be shown in the statusbar in 2 scenarios
            // 1. WiFi is the default network, and it is validated
            // 2. WiFi is the default network, it is not validated and there is no other
            // non-Carrier WiFi networks available.
            boolean maybeShowIcons = (mCurrentState.inetCondition == 1)
                    || (mCurrentState.inetCondition == 0
                            && !mNetworkController.isNonCarrierWifiNetworkAvailable());
            IconState statusIcon = new IconState(
                    wifiVisible && maybeShowIcons, getCurrentIconId(), contentDescription);
                    wifiVisible, getCurrentIconId(), contentDescription);
            IconState qsIcon = null;
            if ((mCurrentState.isDefault && maybeShowIcons) || (!mNetworkController.isRadioOn()
            if (mCurrentState.isDefault || (!mNetworkController.isRadioOn()
                    && !mNetworkController.isEthernetDefault())) {
                qsIcon = new IconState(mCurrentState.connected,
                        mWifiTracker.isCaptivePortal ? R.drawable.ic_qs_wifi_disconnected
@@ -158,15 +151,8 @@ public class WifiSignalController extends
        if (mCurrentState.inetCondition == 0) {
            dataContentDescription = mContext.getString(R.string.data_connection_no_internet);
        }
        // Mobile icon will only be shown in the statusbar in 2 scenarios
        // 1. Mobile is the default network, and it is validated
        // 2. Mobile is the default network, it is not validated and there is no other
        // non-Carrier WiFi networks available.
        boolean maybeShowIcons = (mCurrentState.inetCondition == 1)
                || (mCurrentState.inetCondition == 0
                        && !mNetworkController.isNonCarrierWifiNetworkAvailable());
        boolean sbVisible = mCurrentState.enabled && mCurrentState.connected
                && maybeShowIcons && mCurrentState.isDefault;
                && mCurrentState.isDefault;
        IconState statusIcon =
                new IconState(sbVisible, getCurrentIconIdForCarrierWifi(), contentDescription);
        int typeIcon = sbVisible ? icons.dataType : 0;
+1 −3
Original line number Diff line number Diff line
@@ -238,9 +238,7 @@ public class NetworkControllerWifiTest extends NetworkControllerBaseTest {
        mNetworkController.setNoNetworksAvailable(false);
        setWifiStateForVcn(true, testSsid);
        setWifiLevelForVcn(0);
        // Connected, but still not validated - does not show
        //verifyLastWifiIcon(false, WifiIcons.WIFI_SIGNAL_STRENGTH[0][0]);
        verifyLastMobileDataIndicatorsForVcn(false, 0, 0, false);
        verifyLastMobileDataIndicatorsForVcn(true, 0, TelephonyIcons.ICON_CWF, false);

        mNetworkController.setNoNetworksAvailable(true);
        for (int testLevel = 0; testLevel < WifiIcons.WIFI_LEVEL_COUNT; testLevel++) {