Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1be8d8fc authored by markchien's avatar markchien Committed by Mark Chien
Browse files

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
parent 0882543a
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -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;
    }