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

Commit d0dd827a authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "GATT start timeout"

parents da806be9 5047c738
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -88,6 +88,7 @@ public class AdapterServiceTest {
    private @Mock android.app.Application mApplication;

    private static final int CONTEXT_SWITCH_MS = 100;
    private static final int GATT_START_TIME_MS = 500;
    private static final int ONE_SECOND_MS = 1000;
    private static final int NATIVE_INIT_MS = 8000;
    private static final int NATIVE_DISABLE_MS = 1000;
@@ -198,7 +199,7 @@ public class AdapterServiceTest {
                invocationNumber + 1, CONTEXT_SWITCH_MS);

        // Start GATT
        verify(mMockContext, timeout(CONTEXT_SWITCH_MS).times(
        verify(mMockContext, timeout(GATT_START_TIME_MS).times(
                startServiceCalls * invocationNumber + 1)).startService(any());
        mAdapterService.addProfile(mMockGattService);
        mAdapterService.onProfileServiceStateChanged(mMockGattService, BluetoothAdapter.STATE_ON);
@@ -328,7 +329,7 @@ public class AdapterServiceTest {
                CONTEXT_SWITCH_MS);

        // Start GATT
        verify(mMockContext, timeout(CONTEXT_SWITCH_MS).times(1)).startService(any());
        verify(mMockContext, timeout(GATT_START_TIME_MS).times(1)).startService(any());
        mAdapterService.addProfile(mMockGattService);

        verifyStateChange(BluetoothAdapter.STATE_BLE_TURNING_ON,
@@ -395,7 +396,7 @@ public class AdapterServiceTest {
                CONTEXT_SWITCH_MS);

        // Start GATT
        verify(mMockContext, timeout(CONTEXT_SWITCH_MS).times(1)).startService(any());
        verify(mMockContext, timeout(GATT_START_TIME_MS).times(1)).startService(any());
        mAdapterService.addProfile(mMockGattService);
        mAdapterService.onProfileServiceStateChanged(mMockGattService, BluetoothAdapter.STATE_ON);