Send full LinkProperties to NetworkMonitor

Set the parcelSensitiveFields bit when sending LinkProperties to
NetworkMonitor, so that the captive portal API URL is not lost.

Test: atest ConnectivityServiceIntegrationTest (see followup change)
Bug: 156062304
Change-Id: Ifd4e9c02a6b9a2b2b8b254fc4da7bfb9e0a84550
This commit is contained in:
Remi NGUYEN VAN
2020-05-10 16:11:11 +09:00
parent 062e45d48c
commit c9f24746f2

View File

@@ -5969,7 +5969,8 @@ public class ConnectivityService extends IConnectivityManager.Stub
// Start or stop DNS64 detection and 464xlat according to network state. // Start or stop DNS64 detection and 464xlat according to network state.
networkAgent.clatd.update(); networkAgent.clatd.update();
notifyIfacesChangedForNetworkStats(); notifyIfacesChangedForNetworkStats();
networkAgent.networkMonitor().notifyLinkPropertiesChanged(newLp); networkAgent.networkMonitor().notifyLinkPropertiesChanged(
new LinkProperties(newLp, true /* parcelSensitiveFields */));
if (networkAgent.everConnected) { if (networkAgent.everConnected) {
notifyNetworkCallbacks(networkAgent, ConnectivityManager.CALLBACK_IP_CHANGED); notifyNetworkCallbacks(networkAgent, ConnectivityManager.CALLBACK_IP_CHANGED);
} }
@@ -7149,7 +7150,9 @@ public class ConnectivityService extends IConnectivityManager.Stub
networkAgent.networkMonitor().setAcceptPartialConnectivity(); networkAgent.networkMonitor().setAcceptPartialConnectivity();
} }
networkAgent.networkMonitor().notifyNetworkConnected( networkAgent.networkMonitor().notifyNetworkConnected(
networkAgent.linkProperties, networkAgent.networkCapabilities); new LinkProperties(networkAgent.linkProperties,
true /* parcelSensitiveFields */),
networkAgent.networkCapabilities);
scheduleUnvalidatedPrompt(networkAgent); scheduleUnvalidatedPrompt(networkAgent);
// Whether a particular NetworkRequest listen should cause signal strength thresholds to // Whether a particular NetworkRequest listen should cause signal strength thresholds to