Loading services/core/java/com/android/server/connectivity/tethering/TetherInterfaceStateMachine.java +6 −1 Original line number Diff line number Diff line Loading @@ -185,7 +185,12 @@ public class TetherInterfaceStateMachine extends StateMachine { private boolean startIPv4() { return configureIPv4(true); } private void stopIPv4() { configureIPv4(false); } private void stopIPv4() { configureIPv4(false); // NOTE: All of configureIPv4() will be refactored out of existence // into calls to InterfaceController, shared with startIPv4(). mInterfaceCtrl.clearIPv4Address(); } // TODO: Refactor this in terms of calls to InterfaceController. private boolean configureIPv4(boolean enabled) { Loading tests/net/java/com/android/server/connectivity/TetheringTest.java +4 −3 Original line number Diff line number Diff line Loading @@ -775,11 +775,12 @@ public class TetheringTest { sendWifiApStateChanged(WIFI_AP_STATE_ENABLED, TEST_WLAN_IFNAME, IFACE_IP_MODE_TETHERED); mLooper.dispatchAll(); // We verify get/set called twice here: once for setup and once during // We verify get/set called thrice here: once for setup and twice during // teardown because all events happen over the course of the single // dispatchAll() above. // dispatchAll() above. Note that once the TISM IPv4 address config // code is refactored the two calls during shutdown will revert to one. verify(mNMService, times(2)).getInterfaceConfig(TEST_WLAN_IFNAME); verify(mNMService, times(2)) verify(mNMService, times(3)) .setInterfaceConfig(eq(TEST_WLAN_IFNAME), any(InterfaceConfiguration.class)); verify(mNMService, times(1)).tetherInterface(TEST_WLAN_IFNAME); verify(mWifiManager).updateInterfaceIpState( Loading tests/net/java/com/android/server/connectivity/tethering/TetherInterfaceStateMachineTest.java +2 −0 Original line number Diff line number Diff line Loading @@ -173,6 +173,7 @@ public class TetherInterfaceStateMachineTest { dispatchCommand(TetherInterfaceStateMachine.CMD_TETHER_UNREQUESTED); InOrder inOrder = inOrder(mNMService, mStatsService, mTetherHelper); inOrder.verify(mNMService).untetherInterface(IFACE_NAME); inOrder.verify(mNMService).setInterfaceConfig(eq(IFACE_NAME), any()); inOrder.verify(mTetherHelper).updateInterfaceState( mTestedSm, STATE_AVAILABLE, TETHER_ERROR_NO_ERROR); inOrder.verify(mTetherHelper).updateLinkProperties( Loading Loading @@ -270,6 +271,7 @@ public class TetherInterfaceStateMachineTest { inOrder.verify(mNMService).stopInterfaceForwarding(IFACE_NAME, UPSTREAM_IFACE); inOrder.verify(mNMService).disableNat(IFACE_NAME, UPSTREAM_IFACE); inOrder.verify(mNMService).untetherInterface(IFACE_NAME); inOrder.verify(mNMService).setInterfaceConfig(eq(IFACE_NAME), any()); inOrder.verify(mTetherHelper).updateInterfaceState( mTestedSm, STATE_AVAILABLE, TETHER_ERROR_NO_ERROR); inOrder.verify(mTetherHelper).updateLinkProperties( Loading Loading
services/core/java/com/android/server/connectivity/tethering/TetherInterfaceStateMachine.java +6 −1 Original line number Diff line number Diff line Loading @@ -185,7 +185,12 @@ public class TetherInterfaceStateMachine extends StateMachine { private boolean startIPv4() { return configureIPv4(true); } private void stopIPv4() { configureIPv4(false); } private void stopIPv4() { configureIPv4(false); // NOTE: All of configureIPv4() will be refactored out of existence // into calls to InterfaceController, shared with startIPv4(). mInterfaceCtrl.clearIPv4Address(); } // TODO: Refactor this in terms of calls to InterfaceController. private boolean configureIPv4(boolean enabled) { Loading
tests/net/java/com/android/server/connectivity/TetheringTest.java +4 −3 Original line number Diff line number Diff line Loading @@ -775,11 +775,12 @@ public class TetheringTest { sendWifiApStateChanged(WIFI_AP_STATE_ENABLED, TEST_WLAN_IFNAME, IFACE_IP_MODE_TETHERED); mLooper.dispatchAll(); // We verify get/set called twice here: once for setup and once during // We verify get/set called thrice here: once for setup and twice during // teardown because all events happen over the course of the single // dispatchAll() above. // dispatchAll() above. Note that once the TISM IPv4 address config // code is refactored the two calls during shutdown will revert to one. verify(mNMService, times(2)).getInterfaceConfig(TEST_WLAN_IFNAME); verify(mNMService, times(2)) verify(mNMService, times(3)) .setInterfaceConfig(eq(TEST_WLAN_IFNAME), any(InterfaceConfiguration.class)); verify(mNMService, times(1)).tetherInterface(TEST_WLAN_IFNAME); verify(mWifiManager).updateInterfaceIpState( Loading
tests/net/java/com/android/server/connectivity/tethering/TetherInterfaceStateMachineTest.java +2 −0 Original line number Diff line number Diff line Loading @@ -173,6 +173,7 @@ public class TetherInterfaceStateMachineTest { dispatchCommand(TetherInterfaceStateMachine.CMD_TETHER_UNREQUESTED); InOrder inOrder = inOrder(mNMService, mStatsService, mTetherHelper); inOrder.verify(mNMService).untetherInterface(IFACE_NAME); inOrder.verify(mNMService).setInterfaceConfig(eq(IFACE_NAME), any()); inOrder.verify(mTetherHelper).updateInterfaceState( mTestedSm, STATE_AVAILABLE, TETHER_ERROR_NO_ERROR); inOrder.verify(mTetherHelper).updateLinkProperties( Loading Loading @@ -270,6 +271,7 @@ public class TetherInterfaceStateMachineTest { inOrder.verify(mNMService).stopInterfaceForwarding(IFACE_NAME, UPSTREAM_IFACE); inOrder.verify(mNMService).disableNat(IFACE_NAME, UPSTREAM_IFACE); inOrder.verify(mNMService).untetherInterface(IFACE_NAME); inOrder.verify(mNMService).setInterfaceConfig(eq(IFACE_NAME), any()); inOrder.verify(mTetherHelper).updateInterfaceState( mTestedSm, STATE_AVAILABLE, TETHER_ERROR_NO_ERROR); inOrder.verify(mTetherHelper).updateLinkProperties( Loading