OSDN Git Service

resolve merge conflicts of a2640b6f5142697162d4f02b4134e78b268f4a4b to pi-dev-plus...
authordimitry <dimitry@google.com>
Tue, 27 Mar 2018 15:56:35 +0000 (17:56 +0200)
committerdimitry <dimitry@google.com>
Tue, 27 Mar 2018 15:57:59 +0000 (17:57 +0200)
Test: n/a
Change-Id: I3b91125b1a715690c2cd417b1e937e568c755d9f

1  2 
services/core/java/com/android/server/connectivity/Tethering.java
tests/net/java/com/android/server/connectivity/TetheringTest.java

@@@ -311,13 -423,16 +426,16 @@@ public class TetheringTest 
          // Emulate pressing the USB tethering button in Settings UI.
          mTethering.startTethering(TETHERING_USB, null, false);
          mLooper.dispatchAll();
 -        verify(mUsbManager, times(1)).setCurrentFunction(UsbManager.USB_FUNCTION_RNDIS, false);
 +        verify(mUsbManager, times(1)).setCurrentFunctions(UsbManager.FUNCTION_RNDIS);
  
-         // Pretend we receive a USB connected broadcast. Here we also pretend
-         // that the RNDIS function is somehow enabled, so that we see if we
-         // might trip ourselves up.
-         sendUsbBroadcast(true, false, true);
-         mLooper.dispatchAll();
+         mTethering.interfaceStatusChanged(TEST_USB_IFNAME, true);
+     }
+     @Test
+     public void testUsbConfiguredBroadcastStartsTethering() throws Exception {
+         NetworkState upstreamState = buildMobileIPv4UpstreamState();
+         prepareUsbTethering(upstreamState);
          // This should produce no activity of any kind.
          verifyNoMoreInteractions(mConnectivityManager);
          verifyNoMoreInteractions(mNMService);