Loading services/core/java/com/android/server/connectivity/Tethering.java +3 −1 Original line number Diff line number Diff line Loading @@ -71,6 +71,7 @@ import com.android.internal.util.State; import com.android.internal.util.StateMachine; import com.android.server.connectivity.tethering.IControlsTethering; import com.android.server.connectivity.tethering.IPv6TetheringCoordinator; import com.android.server.connectivity.tethering.IPv6TetheringInterfaceServices; import com.android.server.connectivity.tethering.TetherInterfaceStateMachine; import com.android.server.net.BaseNetworkObserver; Loading Loading @@ -1939,7 +1940,8 @@ public class Tethering extends BaseNetworkObserver implements IControlsTethering private void trackNewTetherableInterface(String iface, int interfaceType) { TetherState tetherState; tetherState = new TetherState(new TetherInterfaceStateMachine(iface, mLooper, interfaceType, mNMService, mStatsService, this)); interfaceType, mNMService, mStatsService, this, new IPv6TetheringInterfaceServices(iface, mNMService))); mTetherStates.put(iface, tetherState); tetherState.mStateMachine.start(); } Loading services/core/java/com/android/server/connectivity/tethering/IPv6TetheringInterfaceServices.java +2 −2 Original line number Diff line number Diff line Loading @@ -45,7 +45,7 @@ import java.util.Objects; /** * @hide */ class IPv6TetheringInterfaceServices { public class IPv6TetheringInterfaceServices { private static final String TAG = IPv6TetheringInterfaceServices.class.getSimpleName(); private static final IpPrefix LINK_LOCAL_PREFIX = new IpPrefix("fe80::/64"); private static final int RFC7421_IP_PREFIX_LENGTH = 64; Loading @@ -59,7 +59,7 @@ class IPv6TetheringInterfaceServices { private RouterAdvertisementDaemon mRaDaemon; private RaParams mLastRaParams; IPv6TetheringInterfaceServices(String ifname, INetworkManagementService nms) { public IPv6TetheringInterfaceServices(String ifname, INetworkManagementService nms) { mIfName = ifname; mNMService = nms; } Loading services/core/java/com/android/server/connectivity/tethering/TetherInterfaceStateMachine.java +2 −2 Original line number Diff line number Diff line Loading @@ -94,14 +94,14 @@ public class TetherInterfaceStateMachine extends StateMachine { public TetherInterfaceStateMachine(String ifaceName, Looper looper, int interfaceType, INetworkManagementService nMService, INetworkStatsService statsService, IControlsTethering tetherController) { IControlsTethering tetherController, IPv6TetheringInterfaceServices ipv6Svc) { super(ifaceName, looper); mNMService = nMService; mStatsService = statsService; mTetherController = tetherController; mIfaceName = ifaceName; mInterfaceType = interfaceType; mIPv6TetherSvc = new IPv6TetheringInterfaceServices(mIfaceName, mNMService); mIPv6TetherSvc = ipv6Svc; mLastError = ConnectivityManager.TETHER_ERROR_NO_ERROR; mInitialState = new InitialState(); Loading tests/net/java/com/android/server/connectivity/tethering/TetherInterfaceStateMachineTest.java +5 −3 Original line number Diff line number Diff line Loading @@ -59,13 +59,14 @@ public class TetherInterfaceStateMachineTest { @Mock private INetworkStatsService mStatsService; @Mock private IControlsTethering mTetherHelper; @Mock private InterfaceConfiguration mInterfaceConfiguration; @Mock private IPv6TetheringInterfaceServices mIPv6TetheringInterfaceServices; private final TestLooper mLooper = new TestLooper(); private TetherInterfaceStateMachine mTestedSm; private void initStateMachine(int interfaceType) throws Exception { mTestedSm = new TetherInterfaceStateMachine(IFACE_NAME, mLooper.getLooper(), interfaceType, mNMService, mStatsService, mTetherHelper); mNMService, mStatsService, mTetherHelper, mIPv6TetheringInterfaceServices); mTestedSm.start(); // Starting the state machine always puts us in a consistent state and notifies // the test of the world that we've changed from an unknown to available state. Loading @@ -91,7 +92,8 @@ public class TetherInterfaceStateMachineTest { @Test public void startsOutAvailable() { mTestedSm = new TetherInterfaceStateMachine(IFACE_NAME, mLooper.getLooper(), ConnectivityManager.TETHERING_BLUETOOTH, mNMService, mStatsService, mTetherHelper); ConnectivityManager.TETHERING_BLUETOOTH, mNMService, mStatsService, mTetherHelper, mIPv6TetheringInterfaceServices); mTestedSm.start(); mLooper.dispatchAll(); verify(mTetherHelper).notifyInterfaceStateChange( Loading Loading
services/core/java/com/android/server/connectivity/Tethering.java +3 −1 Original line number Diff line number Diff line Loading @@ -71,6 +71,7 @@ import com.android.internal.util.State; import com.android.internal.util.StateMachine; import com.android.server.connectivity.tethering.IControlsTethering; import com.android.server.connectivity.tethering.IPv6TetheringCoordinator; import com.android.server.connectivity.tethering.IPv6TetheringInterfaceServices; import com.android.server.connectivity.tethering.TetherInterfaceStateMachine; import com.android.server.net.BaseNetworkObserver; Loading Loading @@ -1939,7 +1940,8 @@ public class Tethering extends BaseNetworkObserver implements IControlsTethering private void trackNewTetherableInterface(String iface, int interfaceType) { TetherState tetherState; tetherState = new TetherState(new TetherInterfaceStateMachine(iface, mLooper, interfaceType, mNMService, mStatsService, this)); interfaceType, mNMService, mStatsService, this, new IPv6TetheringInterfaceServices(iface, mNMService))); mTetherStates.put(iface, tetherState); tetherState.mStateMachine.start(); } Loading
services/core/java/com/android/server/connectivity/tethering/IPv6TetheringInterfaceServices.java +2 −2 Original line number Diff line number Diff line Loading @@ -45,7 +45,7 @@ import java.util.Objects; /** * @hide */ class IPv6TetheringInterfaceServices { public class IPv6TetheringInterfaceServices { private static final String TAG = IPv6TetheringInterfaceServices.class.getSimpleName(); private static final IpPrefix LINK_LOCAL_PREFIX = new IpPrefix("fe80::/64"); private static final int RFC7421_IP_PREFIX_LENGTH = 64; Loading @@ -59,7 +59,7 @@ class IPv6TetheringInterfaceServices { private RouterAdvertisementDaemon mRaDaemon; private RaParams mLastRaParams; IPv6TetheringInterfaceServices(String ifname, INetworkManagementService nms) { public IPv6TetheringInterfaceServices(String ifname, INetworkManagementService nms) { mIfName = ifname; mNMService = nms; } Loading
services/core/java/com/android/server/connectivity/tethering/TetherInterfaceStateMachine.java +2 −2 Original line number Diff line number Diff line Loading @@ -94,14 +94,14 @@ public class TetherInterfaceStateMachine extends StateMachine { public TetherInterfaceStateMachine(String ifaceName, Looper looper, int interfaceType, INetworkManagementService nMService, INetworkStatsService statsService, IControlsTethering tetherController) { IControlsTethering tetherController, IPv6TetheringInterfaceServices ipv6Svc) { super(ifaceName, looper); mNMService = nMService; mStatsService = statsService; mTetherController = tetherController; mIfaceName = ifaceName; mInterfaceType = interfaceType; mIPv6TetherSvc = new IPv6TetheringInterfaceServices(mIfaceName, mNMService); mIPv6TetherSvc = ipv6Svc; mLastError = ConnectivityManager.TETHER_ERROR_NO_ERROR; mInitialState = new InitialState(); Loading
tests/net/java/com/android/server/connectivity/tethering/TetherInterfaceStateMachineTest.java +5 −3 Original line number Diff line number Diff line Loading @@ -59,13 +59,14 @@ public class TetherInterfaceStateMachineTest { @Mock private INetworkStatsService mStatsService; @Mock private IControlsTethering mTetherHelper; @Mock private InterfaceConfiguration mInterfaceConfiguration; @Mock private IPv6TetheringInterfaceServices mIPv6TetheringInterfaceServices; private final TestLooper mLooper = new TestLooper(); private TetherInterfaceStateMachine mTestedSm; private void initStateMachine(int interfaceType) throws Exception { mTestedSm = new TetherInterfaceStateMachine(IFACE_NAME, mLooper.getLooper(), interfaceType, mNMService, mStatsService, mTetherHelper); mNMService, mStatsService, mTetherHelper, mIPv6TetheringInterfaceServices); mTestedSm.start(); // Starting the state machine always puts us in a consistent state and notifies // the test of the world that we've changed from an unknown to available state. Loading @@ -91,7 +92,8 @@ public class TetherInterfaceStateMachineTest { @Test public void startsOutAvailable() { mTestedSm = new TetherInterfaceStateMachine(IFACE_NAME, mLooper.getLooper(), ConnectivityManager.TETHERING_BLUETOOTH, mNMService, mStatsService, mTetherHelper); ConnectivityManager.TETHERING_BLUETOOTH, mNMService, mStatsService, mTetherHelper, mIPv6TetheringInterfaceServices); mTestedSm.start(); mLooper.dispatchAll(); verify(mTetherHelper).notifyInterfaceStateChange( Loading