Keep the merged WiFi indicators when WiFi toggle changes.

The merged WiFi indicators are feteched from the WiFiInfo, so when WiFi
toggle changes we should not clear the indicators.

Bug: 208868291
Test: Unit test NetworkControllerWifiTest, manual test
Change-Id: I7d2724bdc92b92b52350d132bb673489818f261c
This commit is contained in:
Benedict Wong
2021-12-02 21:34:53 +00:00
committed by yinxu
parent 76ee1c461c
commit f65d224626
3 changed files with 16 additions and 3 deletions

View File

@@ -261,8 +261,6 @@ public class WifiStatusTracker {
private void updateWifiState() {
state = mWifiManager.getWifiState();
enabled = state == WifiManager.WIFI_STATE_ENABLED;
isCarrierMerged = false;
subId = 0;
}
private void updateRssi(int newRssi) {

View File

@@ -83,7 +83,7 @@ public class WifiSignalController extends SignalController<WifiState, IconGroup>
@Override
public void notifyListeners(SignalCallback callback) {
if (mCurrentState.isCarrierMerged) {
if (mCurrentState.isDefault) {
if (mCurrentState.isDefault || !mNetworkController.isRadioOn()) {
notifyListenersForCarrierWifi(callback);
}
} else {

View File

@@ -268,6 +268,21 @@ public class NetworkControllerWifiTest extends NetworkControllerBaseTest {
}
}
@Test
public void testDisableWiFiWithVcnWithUnderlyingWifi() {
String testSsid = "Test VCN SSID";
setWifiEnabled(true);
verifyLastWifiIcon(false, WifiIcons.WIFI_NO_NETWORK);
mNetworkController.setNoNetworksAvailable(false);
setWifiStateForVcn(true, testSsid);
setWifiLevelForVcn(1);
verifyLastMobileDataIndicatorsForVcn(true, 1, TelephonyIcons.ICON_CWF, false);
setWifiEnabled(false);
verifyLastMobileDataIndicatorsForVcn(false, 1, 0, false);
}
@Test
public void testCallStrengh() {
if (true) return;