Merge "Pre-emptively mark BLE device as lost if the bluetooth disconnect was detected on the same device."

This commit is contained in:
Raphael Kim
2023-01-30 08:22:07 +00:00
committed by Android (Google) Code Review

View File

@@ -164,6 +164,12 @@ public class CompanionDevicePresenceMonitor implements AssociationStore.OnChange
@Override
public void onBluetoothCompanionDeviceDisconnected(int associationId) {
// If disconnected device is also a BLE device, skip the 2-minute timer and mark it as gone.
boolean isConnectableBleDevice = mNearbyBleDevices.remove(associationId);
if (DEBUG && isConnectableBleDevice) {
Log.d(TAG, "Bluetooth device disconnect was detected."
+ " Pre-emptively marking the BLE device as lost.");
}
onDeviceGone(mConnectedBtDevices, associationId, /* sourceLoggingTag */ "bt");
}