Loading core/java/android/net/ConnectivityManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -1196,7 +1196,7 @@ public class ConnectivityManager { }; } private HashMap<NetworkCapabilities, LegacyRequest> sLegacyRequests = private static HashMap<NetworkCapabilities, LegacyRequest> sLegacyRequests = new HashMap<NetworkCapabilities, LegacyRequest>(); private NetworkRequest findRequestForFeature(NetworkCapabilities netCap) { Loading services/core/java/com/android/server/ConnectivityService.java +1 −1 Original line number Diff line number Diff line Loading @@ -788,7 +788,7 @@ public class ConnectivityService extends IConnectivityManager.Stub { } } mTethering = new Tethering(mContext, mNetd, statsService, this, mHandler.getLooper()); mTethering = new Tethering(mContext, mNetd, statsService, mHandler.getLooper()); //set up the listener for user state for creating user VPNs IntentFilter intentFilter = new IntentFilter(); Loading services/core/java/com/android/server/connectivity/Tethering.java +10 −28 Original line number Diff line number Diff line Loading @@ -27,7 +27,6 @@ import android.content.pm.PackageManager; import android.content.res.Resources; import android.hardware.usb.UsbManager; import android.net.ConnectivityManager; import android.net.IConnectivityManager; import android.net.INetworkStatsService; import android.net.InterfaceConfiguration; import android.net.LinkAddress; Loading Loading @@ -95,7 +94,7 @@ public class Tethering extends BaseNetworkObserver { private final INetworkManagementService mNMService; private final INetworkStatsService mStatsService; private final IConnectivityManager mConnService; private final ConnectivityManager mConnManager; private Looper mLooper; private HashMap<String, TetherInterfaceSM> mIfaces; // all tethered/tetherable ifaces Loading Loading @@ -132,11 +131,11 @@ public class Tethering extends BaseNetworkObserver { // when RNDIS is enabled public Tethering(Context context, INetworkManagementService nmService, INetworkStatsService statsService, IConnectivityManager connService, Looper looper) { INetworkStatsService statsService, Looper looper) { mContext = context; mNMService = nmService; mStatsService = statsService; mConnService = connService; mConnManager = (ConnectivityManager)mContext.getSystemService(Context.CONNECTIVITY_SERVICE); mLooper = looper; mPublicSync = new Object(); Loading Loading @@ -367,11 +366,7 @@ public class Tethering extends BaseNetworkObserver { // TODO - move all private methods used only by the state machine into the state machine // to clarify what needs synchronized protection. private void sendTetherStateChangedBroadcast() { try { if (!mConnService.isTetheringSupported()) return; } catch (RemoteException e) { return; } if (!mConnManager.isTetheringSupported()) return; ArrayList<String> availableList = new ArrayList<String>(); ArrayList<String> activeList = new ArrayList<String>(); Loading Loading @@ -1188,11 +1183,8 @@ public class Tethering extends BaseNetworkObserver { int result = PhoneConstants.APN_REQUEST_FAILED; String enableString = enableString(apnType); if (enableString == null) return false; try { result = mConnService.startUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE, enableString, new Binder()); } catch (Exception e) { } result = mConnManager.startUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE, enableString); switch (result) { case PhoneConstants.APN_ALREADY_ACTIVE: case PhoneConstants.APN_REQUEST_STARTED: Loading @@ -1213,12 +1205,8 @@ public class Tethering extends BaseNetworkObserver { // ignore pending renewal requests ++mCurrentConnectionSequence; if (mMobileApnReserved != ConnectivityManager.TYPE_NONE) { try { mConnService.stopUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE, mConnManager.stopUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE, enableString(mMobileApnReserved)); } catch (Exception e) { return false; } mMobileApnReserved = ConnectivityManager.TYPE_NONE; } return true; Loading Loading @@ -1281,10 +1269,7 @@ public class Tethering extends BaseNetworkObserver { } for (Integer netType : mUpstreamIfaceTypes) { NetworkInfo info = null; try { info = mConnService.getNetworkInfo(netType.intValue()); } catch (RemoteException e) { } NetworkInfo info = mConnManager.getNetworkInfo(netType.intValue()); if ((info != null) && info.isConnected()) { upType = netType.intValue(); break; Loading Loading @@ -1322,10 +1307,7 @@ public class Tethering extends BaseNetworkObserver { sendMessageDelayed(CMD_RETRY_UPSTREAM, UPSTREAM_SETTLE_TIME_MS); } } else { LinkProperties linkProperties = null; try { linkProperties = mConnService.getLinkPropertiesForType(upType); } catch (RemoteException e) { } LinkProperties linkProperties = mConnManager.getLinkProperties(upType); if (linkProperties != null) { // Find the interface with the default IPv4 route. It may be the // interface described by linkProperties, or one of the interfaces Loading Loading
core/java/android/net/ConnectivityManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -1196,7 +1196,7 @@ public class ConnectivityManager { }; } private HashMap<NetworkCapabilities, LegacyRequest> sLegacyRequests = private static HashMap<NetworkCapabilities, LegacyRequest> sLegacyRequests = new HashMap<NetworkCapabilities, LegacyRequest>(); private NetworkRequest findRequestForFeature(NetworkCapabilities netCap) { Loading
services/core/java/com/android/server/ConnectivityService.java +1 −1 Original line number Diff line number Diff line Loading @@ -788,7 +788,7 @@ public class ConnectivityService extends IConnectivityManager.Stub { } } mTethering = new Tethering(mContext, mNetd, statsService, this, mHandler.getLooper()); mTethering = new Tethering(mContext, mNetd, statsService, mHandler.getLooper()); //set up the listener for user state for creating user VPNs IntentFilter intentFilter = new IntentFilter(); Loading
services/core/java/com/android/server/connectivity/Tethering.java +10 −28 Original line number Diff line number Diff line Loading @@ -27,7 +27,6 @@ import android.content.pm.PackageManager; import android.content.res.Resources; import android.hardware.usb.UsbManager; import android.net.ConnectivityManager; import android.net.IConnectivityManager; import android.net.INetworkStatsService; import android.net.InterfaceConfiguration; import android.net.LinkAddress; Loading Loading @@ -95,7 +94,7 @@ public class Tethering extends BaseNetworkObserver { private final INetworkManagementService mNMService; private final INetworkStatsService mStatsService; private final IConnectivityManager mConnService; private final ConnectivityManager mConnManager; private Looper mLooper; private HashMap<String, TetherInterfaceSM> mIfaces; // all tethered/tetherable ifaces Loading Loading @@ -132,11 +131,11 @@ public class Tethering extends BaseNetworkObserver { // when RNDIS is enabled public Tethering(Context context, INetworkManagementService nmService, INetworkStatsService statsService, IConnectivityManager connService, Looper looper) { INetworkStatsService statsService, Looper looper) { mContext = context; mNMService = nmService; mStatsService = statsService; mConnService = connService; mConnManager = (ConnectivityManager)mContext.getSystemService(Context.CONNECTIVITY_SERVICE); mLooper = looper; mPublicSync = new Object(); Loading Loading @@ -367,11 +366,7 @@ public class Tethering extends BaseNetworkObserver { // TODO - move all private methods used only by the state machine into the state machine // to clarify what needs synchronized protection. private void sendTetherStateChangedBroadcast() { try { if (!mConnService.isTetheringSupported()) return; } catch (RemoteException e) { return; } if (!mConnManager.isTetheringSupported()) return; ArrayList<String> availableList = new ArrayList<String>(); ArrayList<String> activeList = new ArrayList<String>(); Loading Loading @@ -1188,11 +1183,8 @@ public class Tethering extends BaseNetworkObserver { int result = PhoneConstants.APN_REQUEST_FAILED; String enableString = enableString(apnType); if (enableString == null) return false; try { result = mConnService.startUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE, enableString, new Binder()); } catch (Exception e) { } result = mConnManager.startUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE, enableString); switch (result) { case PhoneConstants.APN_ALREADY_ACTIVE: case PhoneConstants.APN_REQUEST_STARTED: Loading @@ -1213,12 +1205,8 @@ public class Tethering extends BaseNetworkObserver { // ignore pending renewal requests ++mCurrentConnectionSequence; if (mMobileApnReserved != ConnectivityManager.TYPE_NONE) { try { mConnService.stopUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE, mConnManager.stopUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE, enableString(mMobileApnReserved)); } catch (Exception e) { return false; } mMobileApnReserved = ConnectivityManager.TYPE_NONE; } return true; Loading Loading @@ -1281,10 +1269,7 @@ public class Tethering extends BaseNetworkObserver { } for (Integer netType : mUpstreamIfaceTypes) { NetworkInfo info = null; try { info = mConnService.getNetworkInfo(netType.intValue()); } catch (RemoteException e) { } NetworkInfo info = mConnManager.getNetworkInfo(netType.intValue()); if ((info != null) && info.isConnected()) { upType = netType.intValue(); break; Loading Loading @@ -1322,10 +1307,7 @@ public class Tethering extends BaseNetworkObserver { sendMessageDelayed(CMD_RETRY_UPSTREAM, UPSTREAM_SETTLE_TIME_MS); } } else { LinkProperties linkProperties = null; try { linkProperties = mConnService.getLinkPropertiesForType(upType); } catch (RemoteException e) { } LinkProperties linkProperties = mConnManager.getLinkProperties(upType); if (linkProperties != null) { // Find the interface with the default IPv4 route. It may be the // interface described by linkProperties, or one of the interfaces Loading