Skip to content

Commit

Permalink
Merge "Ensure device properties are non-null before checking if the d…
Browse files Browse the repository at this point in the history
…evice is bonding in RemoteDevices#fetchUuids" into sc-dev
  • Loading branch information
TreeHugger Robot authored and Android (Google) Code Review committed Aug 10, 2021
2 parents 476aa34 + 039cfee commit 9c5863a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/com/android/bluetooth/btservice/RemoteDevices.java
Original file line number Diff line number Diff line change
Expand Up @@ -745,8 +745,9 @@ void fetchUuids(BluetoothDevice device) {
}

// If no UUIDs are cached and the device is bonding, wait for SDP after the device is bonded
boolean isBonding = getDeviceProperties(device).isBonding();
if (isBonding && getDeviceProperties(device).getUuids() == null) {
DeviceProperties deviceProperties = getDeviceProperties(device);
if (deviceProperties != null && deviceProperties.isBonding()
&& getDeviceProperties(device).getUuids() == null) {
return;
}

Expand All @@ -757,7 +758,7 @@ void fetchUuids(BluetoothDevice device) {
mHandler.sendMessageDelayed(message, UUID_INTENT_DELAY);

// Uses cached UUIDs if we are bonding. If not, we fetch the UUIDs with SDP.
if (!isBonding) {
if (deviceProperties == null || !deviceProperties.isBonding()) {
sAdapterService.getRemoteServicesNative(Utils.getBytesFromAddress(device.getAddress()));
}
}
Expand Down

0 comments on commit 9c5863a

Please sign in to comment.