Loading android/app/src/com/android/bluetooth/gatt/ScanManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -141,7 +141,7 @@ public class ScanManager { private static final int SCAN_MODE_MAX_IN_CONCURRENCY = ScanSettings.SCAN_MODE_BALANCED; private final SparseBooleanArray mIsUidForegroundMap = new SparseBooleanArray(); private boolean mScreenOn = false; private boolean mIsConnecting; @VisibleForTesting boolean mIsConnecting; private int mProfilesConnecting, mProfilesConnected, mProfilesDisconnecting; @VisibleForTesting Loading android/app/tests/unit/src/com/android/bluetooth/gatt/ScanManagerTest.java +9 −1 Original line number Diff line number Diff line Loading @@ -1361,10 +1361,18 @@ public class ScanManagerTest { @Test public void profileConnectionStateChanged_sendStartConnectionMessage() { // Set scan downgrade duration through Mock when(mAdapterService.getScanDowngradeDurationMillis()) .thenReturn((long) DELAY_SCAN_DOWNGRADE_DURATION_MS); assertThat(mScanManager.mIsConnecting).isFalse(); mScanManager.handleBluetoothProfileConnectionStateChanged( BluetoothProfile.A2DP, BluetoothProfile.STATE_DISCONNECTED, BluetoothProfile.STATE_CONNECTING); assertThat(mHandler.hasMessages(ScanManager.MSG_START_CONNECTING)).isTrue(); // Wait for handleConnectingState to happen TestUtils.waitForLooperToBeIdle(mHandler.getLooper()); assertThat(mScanManager.mIsConnecting).isTrue(); } } Loading
android/app/src/com/android/bluetooth/gatt/ScanManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -141,7 +141,7 @@ public class ScanManager { private static final int SCAN_MODE_MAX_IN_CONCURRENCY = ScanSettings.SCAN_MODE_BALANCED; private final SparseBooleanArray mIsUidForegroundMap = new SparseBooleanArray(); private boolean mScreenOn = false; private boolean mIsConnecting; @VisibleForTesting boolean mIsConnecting; private int mProfilesConnecting, mProfilesConnected, mProfilesDisconnecting; @VisibleForTesting Loading
android/app/tests/unit/src/com/android/bluetooth/gatt/ScanManagerTest.java +9 −1 Original line number Diff line number Diff line Loading @@ -1361,10 +1361,18 @@ public class ScanManagerTest { @Test public void profileConnectionStateChanged_sendStartConnectionMessage() { // Set scan downgrade duration through Mock when(mAdapterService.getScanDowngradeDurationMillis()) .thenReturn((long) DELAY_SCAN_DOWNGRADE_DURATION_MS); assertThat(mScanManager.mIsConnecting).isFalse(); mScanManager.handleBluetoothProfileConnectionStateChanged( BluetoothProfile.A2DP, BluetoothProfile.STATE_DISCONNECTED, BluetoothProfile.STATE_CONNECTING); assertThat(mHandler.hasMessages(ScanManager.MSG_START_CONNECTING)).isTrue(); // Wait for handleConnectingState to happen TestUtils.waitForLooperToBeIdle(mHandler.getLooper()); assertThat(mScanManager.mIsConnecting).isTrue(); } }