summaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/BluetoothAdapter.java
diff options
context:
space:
mode:
authorEtienne Ruffieux <eruffieux@google.com>2022-03-17 09:44:51 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2022-03-17 09:44:51 +0000
commit0bf8d23c0fd94afb9b8623f337d7b50211f4e9cb (patch)
tree84cbaf773c867b5c9b21b6f2279dcdc1c379b288 /framework/java/android/bluetooth/BluetoothAdapter.java
parent0b0c8673409545cfb947f52f1f31ec5f4dab83da (diff)
parentc0525aa40d5f30f1920ff917470418eb5e353396 (diff)
Merge "[API Review] Add new GetUuidsList method"
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 c5d550aed7..716d808a11 100644
--- a/framework/java/android/bluetooth/BluetoothAdapter.java
+++ b/framework/java/android/bluetooth/BluetoothAdapter.java
@@ -1440,11 +1440,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];
@@ -1468,6 +1467,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