Merge "Fix a bug where modern network agents start in UNKNOWN" am: 0512d7cd48 am: 8d783edbe8 am: b3dcc65424 am: 20b2858a92

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1460964

Change-Id: I4de127e0ce7f4fc0591ee59e65a60592e96efbfc
This commit is contained in:
Chalard Jean
2020-10-29 14:32:37 +00:00
committed by Automerger Merge Worker

View File

@@ -353,10 +353,11 @@ 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.
// with 0 (TelephonyManager.NETWORK_TYPE_UNKNOWN) and an empty description.
final NetworkInfo ni = new NetworkInfo(config.legacyType, 0, config.legacyTypeName, "");
ni.setIsAvailable(true);
ni.setExtraInfo(config.getLegacyExtraInfo());
ni.setDetailedState(NetworkInfo.DetailedState.CONNECTING, null /* reason */,
config.getLegacyExtraInfo());
return ni;
}