OSDN Git Service

Prefer default Internet network for upstream tethering.
authorErik Kline <ek@google.com>
Thu, 14 Jun 2018 08:36:40 +0000 (17:36 +0900)
committerErik Kline <ek@google.com>
Tue, 19 Jun 2018 11:57:21 +0000 (20:57 +0900)
commit4080a1bd15572caf149762e45c958627feceb74d
tree502437ba95ee765c537903adb11d94c0da3ebdbf
parent1b65af27d897ccfbfb7b61c7176cb6a670a9519c
Prefer default Internet network for upstream tethering.

Rather than use the crufty config.xml list of upstream transport types,
use ConnectivityService's notion of the default network for the upstream.
In cases where a DUN network is required and the default network is
currently a mobile network, look for a DUN network (code in Tethering
is currently responsible for requesting one).

Test: as follows
    - built, flashed, booted
    - runtest frameworks-net
    - tethered via mobile, joined captive portal network, maintained
      laptop access via mobile until captive passed (then used wifi)
    - disabled client mode wifi, disabled mobile data, plugged in
      ethernet adapter, observed connectivity via ethernet
Bug: 32163131
Bug: 62648872
Bug: 63282480
Bug: 109786760
Bug: 110118584
Bug: 110260419
Change-Id: I925b75994e31df8046f3ef9916a2457b4210485e
core/res/res/values/config.xml
core/res/res/values/symbols.xml
services/core/java/com/android/server/ConnectivityService.java
services/core/java/com/android/server/connectivity/Tethering.java
services/core/java/com/android/server/connectivity/tethering/TetheringConfiguration.java
services/core/java/com/android/server/connectivity/tethering/TetheringDependencies.java
services/core/java/com/android/server/connectivity/tethering/UpstreamNetworkMonitor.java
tests/net/java/com/android/server/connectivity/TetheringTest.java
tests/net/java/com/android/server/connectivity/tethering/UpstreamNetworkMonitorTest.java