From 1be8d8fc9c610b572c3000473798d4c127498b17 Mon Sep 17 00:00:00 2001 From: markchien Date: Wed, 5 Dec 2018 21:20:01 +0800 Subject: Upstream Configuration should also consider automatic configuration Tethering already support two type upstream configurations, but hasTetherableConfiguration() only check legacy one. Bug: 120533392 Test: -runtest frameworks-net -build, flash, booted Change-Id: I986070fc009abcad17994b73858962f776b4c3f5 --- .../core/java/com/android/server/connectivity/Tethering.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/services/core/java/com/android/server/connectivity/Tethering.java b/services/core/java/com/android/server/connectivity/Tethering.java index 3c14393ca740..d75601be23e3 100644 --- a/services/core/java/com/android/server/connectivity/Tethering.java +++ b/services/core/java/com/android/server/connectivity/Tethering.java @@ -944,10 +944,11 @@ public class Tethering extends BaseNetworkObserver { public boolean hasTetherableConfiguration() { final TetheringConfiguration cfg = mConfig; final boolean hasDownstreamConfiguration = - (cfg.tetherableUsbRegexs.length != 0) || - (cfg.tetherableWifiRegexs.length != 0) || - (cfg.tetherableBluetoothRegexs.length != 0); - final boolean hasUpstreamConfiguration = !cfg.preferredUpstreamIfaceTypes.isEmpty(); + (cfg.tetherableUsbRegexs.length != 0) + || (cfg.tetherableWifiRegexs.length != 0) + || (cfg.tetherableBluetoothRegexs.length != 0); + final boolean hasUpstreamConfiguration = !cfg.preferredUpstreamIfaceTypes.isEmpty() + || cfg.chooseUpstreamAutomatically; return hasDownstreamConfiguration && hasUpstreamConfiguration; } -- cgit v1.2.3-59-g8ed1b