diff options
author | Etienne Ruffieux <eruffieux@google.com> | 2022-06-09 18:41:59 -0700 |
---|---|---|
committer | Etienne Ruffieux <eruffieux@google.com> | 2022-06-09 18:45:34 -0700 |
commit | aa512dab6f7f2ca2610becc31d44cf91bb1e9b69 (patch) | |
tree | 23de3b643d6c9f3cd919d0baf293eb456203344f /framework/java/android/bluetooth/BluetoothDevice.java | |
parent | e3d987d906548bc980ca25b84b6af6d7fcc6c1f0 (diff) |
BluetoothDevice#getUuids() returns null again when no Uuids
getUuids was wrongly returning an empty array of Uuids when
fetchUuidsWithSdp had not been called. It now returns null
again.
Test: atest CtsBluetoothTestCases
Bug: 235456437
Tag: #feature
Ignore-AOSP-First: will be cherry-picked
Change-Id: If8aafc1b0ab4e253fdacc827726d76825b3bd1e4
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothDevice.java')
-rw-r--r-- | framework/java/android/bluetooth/BluetoothDevice.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/framework/java/android/bluetooth/BluetoothDevice.java b/framework/java/android/bluetooth/BluetoothDevice.java index e20165f522..6618a55184 100644 --- a/framework/java/android/bluetooth/BluetoothDevice.java +++ b/framework/java/android/bluetooth/BluetoothDevice.java @@ -53,7 +53,6 @@ import java.io.IOException; import java.io.UnsupportedEncodingException; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; -import java.util.ArrayList; import java.util.List; import java.util.UUID; import java.util.concurrent.TimeoutException; @@ -2228,8 +2227,8 @@ public final class BluetoothDevice implements Parcelable, Attributable { new SynchronousResultReceiver(); service.getRemoteUuids(this, mAttributionSource, recv); List<ParcelUuid> parcels = recv.awaitResultNoInterrupt(getSyncTimeout()) - .getValue(new ArrayList<>()); - return parcels.toArray(new ParcelUuid[parcels.size()]); + .getValue(null); + return parcels != null ? parcels.toArray(new ParcelUuid[parcels.size()]) : null; } catch (RemoteException | TimeoutException e) { Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable())); } |