summaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/BluetoothAdapter.java
diff options
context:
space:
mode:
authorEtienne Ruffieux <eruffieux@google.com>2022-03-10 14:12:18 +0000
committerEtienne Ruffieux <eruffieux@google.com>2022-03-10 14:14:49 +0000
commitc0525aa40d5f30f1920ff917470418eb5e353396 (patch)
treeca12d910d70c058e5851d1e060a502ad251cfce8 /framework/java/android/bluetooth/BluetoothAdapter.java
parentd3a3a5346af9941fdc40802f717930cc648b199c (diff)
[API Review] Add new GetUuidsList method
As per API review, created nex GetUuids method that returns a list instead of an array so we don't have to suppressLint Bug: 223253153 Test: build Tag: #feature Change-Id: I3d0036f323ba35f9182edb0c843caa0e32bec42a
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothAdapter.java')
-rw-r--r--framework/java/android/bluetooth/BluetoothAdapter.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/framework/java/android/bluetooth/BluetoothAdapter.java b/framework/java/android/bluetooth/BluetoothAdapter.java
index 46d19217dd..b4f7d15c66 100644
--- a/framework/java/android/bluetooth/BluetoothAdapter.java
+++ b/framework/java/android/bluetooth/BluetoothAdapter.java
@@ -1433,11 +1433,10 @@ public final class BluetoothAdapter {
* @return the UUIDs supported by the local Bluetooth Adapter.
* @hide
*/
- @SystemApi
+ @UnsupportedAppUsage
@RequiresLegacyBluetoothPermission
@RequiresBluetoothConnectPermission
@RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
- @SuppressLint(value = {"ArrayReturn", "NullableCollection"})
public @NonNull ParcelUuid[] getUuids() {
if (getState() != STATE_ON) {
return new ParcelUuid[0];
@@ -1461,6 +1460,18 @@ public final class BluetoothAdapter {
}
/**
+ * Get the UUIDs supported by the local Bluetooth adapter.
+ *
+ * @return a list of the UUIDs supported by the local Bluetooth Adapter.
+ * @hide
+ */
+ @SystemApi
+ @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
+ public @NonNull List<ParcelUuid> getUuidsList() {
+ return Arrays.asList(getUuids());
+ }
+
+ /**
* Set the friendly Bluetooth name of the local Bluetooth adapter.
* <p>This name is visible to remote Bluetooth devices.
* <p>Valid Bluetooth names are a maximum of 248 bytes using UTF-8