diff options
| author | 2025-03-06 19:01:33 -0800 | |
|---|---|---|
| committer | 2025-03-07 11:14:03 -0800 | |
| commit | 91e31e5281fb60852aff65b960401c13dba548d7 (patch) | |
| tree | ec6843fa6d5f85f84c91205d51e62196c4c11d42 | |
| parent | 1891cca2557e09fd4016219fb7d0af6c13a57ba6 (diff) | |
PairingWithDiscoveryTest: cleanup
Test: m Bluetooth
Test: atest PairingWithDiscoveryTest
Flag: TEST_ONLY
Bug: 401391574
Change-Id: Icb1374715221e5ccfab4bc6077460ce0f0d28f93
| -rw-r--r-- | framework/tests/bumble/src/android/bluetooth/pairing/PairingWithDiscoveryTest.java | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/framework/tests/bumble/src/android/bluetooth/pairing/PairingWithDiscoveryTest.java b/framework/tests/bumble/src/android/bluetooth/pairing/PairingWithDiscoveryTest.java index f2d9725f3e..ed5dfd0561 100644 --- a/framework/tests/bumble/src/android/bluetooth/pairing/PairingWithDiscoveryTest.java +++ b/framework/tests/bumble/src/android/bluetooth/pairing/PairingWithDiscoveryTest.java @@ -94,12 +94,15 @@ public class PairingWithDiscoveryTest { private static final Duration BOND_INTENT_TIMEOUT = Duration.ofSeconds(10); private static final int DISCOVERY_TIMEOUT = 2000; // 2 seconds private static final int LE_GENERAL_DISCOVERABLE = 2; - private CompletableFuture<BluetoothDevice> mDeviceFound; private final Context mContext = ApplicationProvider.getApplicationContext(); private final BluetoothManager mManager = mContext.getSystemService(BluetoothManager.class); private final BluetoothAdapter mAdapter = mManager.getAdapter(); + private final Map<String, Integer> mActionRegistrationCounts = new HashMap<>(); + private final StreamObserverSpliterator<PairingEvent> mPairingEventStreamObserver = + new StreamObserverSpliterator<>(); + @Rule(order = 0) public final CheckFlagsRule mCheckFlagsRule = DeviceFlagsValueProvider.createCheckFlagsRule(); @@ -110,13 +113,9 @@ public class PairingWithDiscoveryTest { public final PandoraDevice mBumble = new PandoraDevice(); private BluetoothDevice mBumbleDevice; - private BluetoothDevice mRemoteLeDevice; private InOrder mInOrder = null; + private CompletableFuture<BluetoothDevice> mDeviceFound; @Mock private BroadcastReceiver mReceiver; - private final Map<String, Integer> mActionRegistrationCounts = new HashMap<>(); - - private final StreamObserverSpliterator<PairingEvent> mPairingEventStreamObserver = - new StreamObserverSpliterator<>(); @SuppressLint("MissingPermission") private final Answer<Void> mIntentHandler = @@ -159,9 +158,6 @@ public class PairingWithDiscoveryTest { mInOrder = inOrder(mReceiver); mBumbleDevice = mBumble.getRemoteDevice(); - mRemoteLeDevice = - mAdapter.getRemoteLeDevice( - Utils.BUMBLE_RANDOM_ADDRESS, BluetoothDevice.ADDRESS_TYPE_RANDOM); for (BluetoothDevice device : mAdapter.getBondedDevices()) { removeBond(device); @@ -174,7 +170,6 @@ public class PairingWithDiscoveryTest { removeBond(device); } mBumbleDevice = null; - mRemoteLeDevice = null; if (getTotalActionRegistrationCounts() > 0) { mContext.unregisterReceiver(mReceiver); mActionRegistrationCounts.clear(); |