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

Commit f51d5626 authored by Erik Kline's avatar Erik Kline Committed by android-build-merger
Browse files

Merge "Split chooseUpstreamType() into two separate functions" am: 7a42d3ad am: f6d55d7e

am: 8eb1fbf1

Change-Id: Ia8fd663404f1d0a70243ab9c9bd853ac6d51d68f
parents 0f5cf474 8eb1fbf1
Loading
Loading
Loading
Loading
+11 −1
Original line number Original line Diff line number Diff line
@@ -1057,9 +1057,13 @@ public class Tethering extends BaseNetworkObserver implements IControlsTethering
            }
            }


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

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


                updateConfiguration(); // TODO - remove?
                updateConfiguration(); // TODO - remove?


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


                return upType;
            }

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