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
This commit is contained in:
markchien
2018-12-05 21:20:01 +08:00
committed by Mark Chien
parent 0882543a12
commit 1be8d8fc9c

View File

@@ -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;
}