summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2020-07-28 09:18:46 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2020-07-29 04:04:42 +0000
commite95a490dd1fdeeb64a2e19e71f5b7685a10040be (patch)
treeec6f235bda06442ebb68cfc5ae10ec8c889805bd
parent87a6fd7acd7ad2b128026082884e584ade5d95ed (diff)
downloadbase-e95a490dd1fdeeb64a2e19e71f5b7685a10040be.tar.gz
Set the NetworkInfo subtype to 0.
For non-telephony networks, this was always set to 0 before R. In R, it is currently set to the same value as the network type. This is incorrect because the two have different namespaces. or example, currently, any network of type WIFI (==1) will have a subtype of NETWORK_TYPE_GPRS (==1). Similarly, all ETHERNET networks will have subtype NETWORK_TYPE_1XRTT, all VPN networks will have a subtype of NETWORK_TYPE_TD_SCDMA, etd. Bug: 161653721 Test: builds, boots Change-Id: I07e111c1762e0021c931cefc27f193f78578748b (cherry picked from commit a40ff70cad00a6c298e07c2c38e95d58074a7157)
-rw-r--r--core/java/android/net/NetworkAgent.java3
1 files changed, 1 insertions, 2 deletions
diff --git a/core/java/android/net/NetworkAgent.java b/core/java/android/net/NetworkAgent.java
index 482d2d2192b8..327e42bdd2f7 100644
--- a/core/java/android/net/NetworkAgent.java
+++ b/core/java/android/net/NetworkAgent.java
@@ -354,8 +354,7 @@ public abstract class NetworkAgent {
private static NetworkInfo getLegacyNetworkInfo(final NetworkAgentConfig config) {
// The subtype can be changed with (TODO) setLegacySubtype, but it starts
// with the type and an empty description.
- final NetworkInfo ni = new NetworkInfo(config.legacyType, config.legacyType,
- config.legacyTypeName, "");
+ final NetworkInfo ni = new NetworkInfo(config.legacyType, 0, config.legacyTypeName, "");
ni.setIsAvailable(true);
ni.setExtraInfo(config.getLegacyExtraInfo());
return ni;