Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c99ff3a1 authored by Erik Kline's avatar Erik Kline Committed by android-build-merger
Browse files

resolve merge conflicts of b1eb85c9 to stage-aosp-master

am: dbc7279e

Change-Id: I0280190a1d2d48ca2e80e823ed43112161af8271
parents 61be6964 dbc7279e
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
@@ -275,6 +275,32 @@ public class TetheringTest {
        mIntents.remove(bcast);
    }

    @Test
    public void testUsbConfiguredBroadcastStartsTethering() throws Exception {
        when(mConnectivityManager.isTetheringSupported()).thenReturn(true);

        // 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);

        // 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();
        // This should produce no activity of any kind.
        verifyNoMoreInteractions(mConnectivityManager);
        verifyNoMoreInteractions(mNMService);

        // Pretend we then receive USB configured broadcast.
        sendUsbBroadcast(true, true, true);
        mLooper.dispatchAll();
        // Now we should see the start of tethering mechanics (in this case:
        // tetherMatchingInterfaces() which starts by fetching all interfaces).
        verify(mNMService, times(1)).listInterfaces();
    }

    public void failingLocalOnlyHotspotLegacyApBroadcast(
            boolean emulateInterfaceStatusChanged) throws Exception {
        when(mConnectivityManager.isTetheringSupported()).thenReturn(true);