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

Commit b5a322d6 authored by Kihong Seong's avatar Kihong Seong Committed by Automerger Merge Worker
Browse files

Merge "Fix ScanManagerTest flakiness" into main am: 85d7dce7 am: cae17bbd

parents fdedc401 cae17bbd
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -75,7 +75,6 @@ import com.android.bluetooth.TestUtils;
import com.android.bluetooth.btservice.AdapterService;
import com.android.bluetooth.btservice.BluetoothAdapterProxy;
import com.android.bluetooth.btservice.MetricsLogger;
import com.android.bluetooth.flags.Flags;
import com.android.bluetooth.gatt.GattNativeInterface;
import com.android.bluetooth.gatt.GattObjectsFactory;
import com.android.bluetooth.gatt.GattService;
@@ -1284,9 +1283,9 @@ public class ScanManagerTest {
        testSleep(50);
        // Turn off screen
        sendMessageWaitForProcessed(createScreenOnOffMessage(false));
        verify(mMetricsLogger, times(1))
        verify(mMetricsLogger, atMost(2))
                .cacheCount(eq(BluetoothProtoEnums.LE_SCAN_RADIO_DURATION_REGULAR), anyLong());
        verify(mMetricsLogger, times(1))
        verify(mMetricsLogger, atMost(2))
                .cacheCount(
                        eq(BluetoothProtoEnums.LE_SCAN_RADIO_DURATION_REGULAR_SCREEN_ON),
                        anyLong());
@@ -1412,7 +1411,7 @@ public class ScanManagerTest {
            long capturedDuration = mScanDurationCaptor.getValue();
            Log.d(TAG, "capturedDuration: " + String.valueOf(capturedDuration));
            assertThat(capturedDuration).isAtLeast(weightedScanDuration);
            assertThat(capturedDuration).isAtMost(weightedScanDuration + DELAY_ASYNC_MS);
            assertThat(capturedDuration).isAtMost(weightedScanDuration + DELAY_ASYNC_MS * 2);
            Mockito.clearInvocations(mMetricsLogger);
        }
    }