Loading services/java/com/android/server/connectivity/Tethering.java +17 −2 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import android.net.ConnectivityManager; import android.net.InterfaceConfiguration; import android.net.IConnectivityManager; import android.net.INetworkManagementEventObserver; import android.net.LinkProperties; import android.net.NetworkInfo; import android.os.Binder; import android.os.Environment; Loading Loading @@ -1219,7 +1220,20 @@ public class Tethering extends INetworkManagementEventObserver.Stub { } protected String findActiveUpstreamIface() { // check for what iface we can use - if none found switch to error. IBinder b = ServiceManager.getService(Context.NETWORKMANAGEMENT_SERVICE); IBinder b = ServiceManager.getService(Context.CONNECTIVITY_SERVICE); IConnectivityManager cm = IConnectivityManager.Stub.asInterface(b); try { LinkProperties defaultProp = cm.getActiveLinkProperties(); if (defaultProp != null) { String iface = defaultProp.getInterfaceName(); for(String regex : mUpstreamIfaceRegexs) { if (iface.matches(regex)) return iface; } } } catch (RemoteException e) { } b = ServiceManager.getService(Context.NETWORKMANAGEMENT_SERVICE); INetworkManagementService service = INetworkManagementService.Stub.asInterface(b); String[] ifaces = new String[0]; Loading Loading @@ -1390,7 +1404,8 @@ public class Tethering extends INetworkManagementEventObserver.Stub { } break; case CMD_UPSTREAM_CHANGED: mTryCell = WAIT_FOR_NETWORK_TO_SETTLE; // need to try DUN immediately if Wifi goes down mTryCell = !WAIT_FOR_NETWORK_TO_SETTLE; chooseUpstreamType(mTryCell); mTryCell = !mTryCell; break; Loading Loading
services/java/com/android/server/connectivity/Tethering.java +17 −2 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import android.net.ConnectivityManager; import android.net.InterfaceConfiguration; import android.net.IConnectivityManager; import android.net.INetworkManagementEventObserver; import android.net.LinkProperties; import android.net.NetworkInfo; import android.os.Binder; import android.os.Environment; Loading Loading @@ -1219,7 +1220,20 @@ public class Tethering extends INetworkManagementEventObserver.Stub { } protected String findActiveUpstreamIface() { // check for what iface we can use - if none found switch to error. IBinder b = ServiceManager.getService(Context.NETWORKMANAGEMENT_SERVICE); IBinder b = ServiceManager.getService(Context.CONNECTIVITY_SERVICE); IConnectivityManager cm = IConnectivityManager.Stub.asInterface(b); try { LinkProperties defaultProp = cm.getActiveLinkProperties(); if (defaultProp != null) { String iface = defaultProp.getInterfaceName(); for(String regex : mUpstreamIfaceRegexs) { if (iface.matches(regex)) return iface; } } } catch (RemoteException e) { } b = ServiceManager.getService(Context.NETWORKMANAGEMENT_SERVICE); INetworkManagementService service = INetworkManagementService.Stub.asInterface(b); String[] ifaces = new String[0]; Loading Loading @@ -1390,7 +1404,8 @@ public class Tethering extends INetworkManagementEventObserver.Stub { } break; case CMD_UPSTREAM_CHANGED: mTryCell = WAIT_FOR_NETWORK_TO_SETTLE; // need to try DUN immediately if Wifi goes down mTryCell = !WAIT_FOR_NETWORK_TO_SETTLE; chooseUpstreamType(mTryCell); mTryCell = !mTryCell; break; Loading