wear proxy behind portal
Do not avoid captive portal on wear proxy network; keep network agent after detecting portal. Bug: 291112432 Test: atest FrameworksNetTests:android.net.connectivity.com.android.server.ConnectivityServiceTest Change-Id: I8f6669da62ebd76b6a46d2aec9b3ea563a08cb5e
This commit is contained in:
@@ -128,6 +128,7 @@ import static android.net.NetworkCapabilities.REDACT_FOR_ACCESS_FINE_LOCATION;
|
||||
import static android.net.NetworkCapabilities.REDACT_FOR_LOCAL_MAC_ADDRESS;
|
||||
import static android.net.NetworkCapabilities.REDACT_FOR_NETWORK_SETTINGS;
|
||||
import static android.net.NetworkCapabilities.REDACT_NONE;
|
||||
import static android.net.NetworkCapabilities.TRANSPORT_BLUETOOTH;
|
||||
import static android.net.NetworkCapabilities.TRANSPORT_CELLULAR;
|
||||
import static android.net.NetworkCapabilities.TRANSPORT_ETHERNET;
|
||||
import static android.net.NetworkCapabilities.TRANSPORT_TEST;
|
||||
@@ -4870,6 +4871,34 @@ public class ConnectivityServiceTest {
|
||||
assertNoCallbacks(captivePortalCallback, validatedCallback);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNoAvoidCaptivePortalOnWearProxy() throws Exception {
|
||||
// Bring up a BLUETOOTH network which is companion proxy on wear
|
||||
// then set captive portal.
|
||||
mockHasSystemFeature(PackageManager.FEATURE_WATCH, true);
|
||||
setCaptivePortalMode(ConnectivitySettingsManager.CAPTIVE_PORTAL_MODE_AVOID);
|
||||
TestNetworkAgentWrapper btAgent = new TestNetworkAgentWrapper(TRANSPORT_BLUETOOTH);
|
||||
final String firstRedirectUrl = "http://example.com/firstPath";
|
||||
|
||||
btAgent.connectWithCaptivePortal(firstRedirectUrl, false /* privateDnsProbeSent */);
|
||||
btAgent.assertNotDisconnected(TIMEOUT_MS);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAvoidCaptivePortalOnBluetooth() throws Exception {
|
||||
// When not on Wear, BLUETOOTH is just regular network,
|
||||
// then set captive portal.
|
||||
mockHasSystemFeature(PackageManager.FEATURE_WATCH, false);
|
||||
setCaptivePortalMode(ConnectivitySettingsManager.CAPTIVE_PORTAL_MODE_AVOID);
|
||||
TestNetworkAgentWrapper btAgent = new TestNetworkAgentWrapper(TRANSPORT_BLUETOOTH);
|
||||
final String firstRedirectUrl = "http://example.com/firstPath";
|
||||
|
||||
btAgent.connectWithCaptivePortal(firstRedirectUrl, false /* privateDnsProbeSent */);
|
||||
|
||||
btAgent.expectDisconnected();
|
||||
btAgent.expectPreventReconnectReceived();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCaptivePortalApi() throws Exception {
|
||||
mServiceContext.setPermission(NETWORK_SETTINGS, PERMISSION_GRANTED);
|
||||
|
||||
Reference in New Issue
Block a user