Skip to content
Commit 569c14a1 authored by Chiachang Wang's avatar Chiachang Wang
Browse files

Replace ConnectivityManager.isNetworkTypeMobile usage in NSS

ConnectivityManager is a part of connectivity mainline. The
hidden methods dependency in ConnectivityManager should be
removed to make it a moudle. NSS use isNetworkTypeMobile to
check if the NetworkState belongs to a cellular network or not.
It should be replaced by the NetworkCapabilities inside the
NetworkState.

The result of isNetworkTypeMobile relies on the legacy network
type. The legacy network type comes from the network type
of its network info. The replacement should consider VPN active
case because the network type will not be TYPE_MOBILE. Thus,
replace it with Networkcapabilities.getDisplayTransport() to
get a transport that can be used to classify a network when
displaying its info to users, i.e. it will return TRANSPORT_VPN
for a vpn network on cellular network.

Bug: 172183305
Test: atest FrameworksNetTests
Change-Id: I2132a7288a93e4430cbd9efabc33ae56ce8bdd9b
parent 02d57fc2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment