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:
parent
d196fab898
commit
d032dd42ea
1 changed files with 45 additions and 3 deletions
|
|
@ -4405,7 +4405,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||
updateCapabilitiesForNetwork(nai);
|
||||
} else if (portalChanged) {
|
||||
if (portal && ConnectivitySettingsManager.CAPTIVE_PORTAL_MODE_AVOID
|
||||
== getCaptivePortalMode()) {
|
||||
== getCaptivePortalMode(nai)) {
|
||||
if (DBG) log("Avoiding captive portal network: " + nai.toShortString());
|
||||
nai.onPreventAutomaticReconnect();
|
||||
teardownUnneededNetwork(nai);
|
||||
|
|
@ -4441,7 +4441,13 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||
}
|
||||
}
|
||||
|
||||
private int getCaptivePortalMode() {
|
||||
private int getCaptivePortalMode(@NonNull NetworkAgentInfo nai) {
|
||||
if (nai.networkCapabilities.hasTransport(NetworkCapabilities.TRANSPORT_BLUETOOTH) &&
|
||||
mContext.getPackageManager().hasSystemFeature(FEATURE_WATCH)) {
|
||||
// Do not avoid captive portal when network is wear proxy.
|
||||
return ConnectivitySettingsManager.CAPTIVE_PORTAL_MODE_PROMPT;
|
||||
}
|
||||
|
||||
return Settings.Global.getInt(mContext.getContentResolver(),
|
||||
ConnectivitySettingsManager.CAPTIVE_PORTAL_MODE,
|
||||
ConnectivitySettingsManager.CAPTIVE_PORTAL_MODE_PROMPT);
|
||||
|
|
|
|||
Loading…
Reference in a new issue