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

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

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
parent e3d987d9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2691,7 +2691,7 @@ public class AdapterService extends Service {

            ParcelUuid[] parcels = service.getRemoteUuids(device);
            if (parcels == null) {
                parcels = new ParcelUuid[0];
                return null;
            }
            return Arrays.asList(parcels);
        }
+2 −3
Original line number Diff line number Diff line
@@ -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()));
            }