Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c0525aa4 authored by Etienne Ruffieux's avatar Etienne Ruffieux
Browse files

[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
parent d3a3a534
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@ package android.bluetooth {
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public long getDiscoveryEndMillis();
    method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.List<android.bluetooth.BluetoothDevice> getMostRecentlyConnectedDevices();
    method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.List<java.lang.Integer> getSupportedProfiles();
    method @NonNull @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public android.os.ParcelUuid[] getUuids();
    method @NonNull @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public java.util.List<android.os.ParcelUuid> getUuidsList();
    method public boolean isBleScanAlwaysAvailable();
    method public boolean isLeEnabled();
    method @NonNull public static String nameForState(int);
+13 −2
Original line number Diff line number Diff line
@@ -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];
@@ -1460,6 +1459,18 @@ public final class BluetoothAdapter {
        return new ParcelUuid[0];
    }

    /**
     * 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.