Modify dialog message for partial connectivity

In some networks, network validation may only get success
result for http probe but fail result for https probe.
For this kind of network, it may still work at some websites
or apps, but user didn't know about that. In order to fix this
issue, we will check if network has partial connectivity and
notify user to make a choice if they want to use this partial
connectivity or not.

Bug: 113450764
Bug: 128489091
Test: 1. Build pass.
      2. make -j44 RunSettingsRoboTests
      ROBOTEST_FILTER=WifiDetailPreferenceControllerTest
      3. Change captive_portal_https_url to https://invalid.com
      to simulate partial connectivity.

Change-Id: I0e87f6f2ede173f45a7b6fcf842b4f9a83d8efa1
This commit is contained in:
lucaslin
2019-03-20 11:41:21 +08:00
parent e230d19810
commit 7335c594be
5 changed files with 40 additions and 9 deletions

View File

@@ -649,6 +649,19 @@ public class WifiDetailPreferenceControllerTest {
nc.removeCapability(NetworkCapabilities.NET_CAPABILITY_VALIDATED);
updateNetworkCapabilities(nc);
inOrder.verify(mockHeaderController).setSummary(summary);
// UI will be refreshed when device connects to a partial connectivity network.
summary = "Limited connection";
when(mockAccessPoint.getSettingsSummary()).thenReturn(summary);
nc.addCapability(NetworkCapabilities.NET_CAPABILITY_PARTIAL_CONNECTIVITY);
updateNetworkCapabilities(nc);
inOrder.verify(mockHeaderController).setSummary(summary);
// Although UI will be refreshed when network become validated. The Settings should
// continue to display "Limited connection" if network still provides partial connectivity.
nc.addCapability(NetworkCapabilities.NET_CAPABILITY_VALIDATED);
updateNetworkCapabilities(nc);
inOrder.verify(mockHeaderController).setSummary(summary);
}
@Test