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

Commit 14f7faf7 authored by Erik Kline's avatar Erik Kline
Browse files

Split chooseUpstreamType() into two separate functions

Test: as follows
    - built (bullhead)
    - flashed
    - booted
    - runtest frameworks-net passes
Bug: 32163131
Change-Id: If892864ff59a6f38340791597c2d9e5b4022bbfa
parent ed6d75d5
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -1058,9 +1058,13 @@ public class Tethering extends BaseNetworkObserver implements IControlsTethering
            }

            protected void chooseUpstreamType(boolean tryCell) {
                final int upstreamType = findPreferredUpstreamType(tryCell);
                setUpstreamByType(upstreamType);
            }

            protected int findPreferredUpstreamType(boolean tryCell) {
                final ConnectivityManager cm = getConnectivityManager();
                int upType = ConnectivityManager.TYPE_NONE;
                String iface = null;

                updateConfiguration(); // TODO - remove?

@@ -1117,7 +1121,13 @@ public class Tethering extends BaseNetworkObserver implements IControlsTethering
                        break;
                }

                return upType;
            }

            protected void setUpstreamByType(int upType) {
                final ConnectivityManager cm = getConnectivityManager();
                Network network = null;
                String iface = null;
                if (upType != ConnectivityManager.TYPE_NONE) {
                    LinkProperties linkProperties = cm.getLinkProperties(upType);
                    if (linkProperties != null) {