From cc01027e500f36c8bb146261adeda1d13ce083d4 Mon Sep 17 00:00:00 2001 From: Jakub Pawlowski Date: Wed, 10 Apr 2019 18:48:57 +0200 Subject: [PATCH] Bluetooth: Make ScanRecord.getServiceSolicitationUuids NonNull Test: compilation Bug: 115639878 Merged-In: I5f895d65a7036275ab0faa0afd2ee1eebc416476 Change-Id: I5f895d65a7036275ab0faa0afd2ee1eebc416476 --- api/current.txt | 2 +- core/java/android/bluetooth/le/ScanRecord.java | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/api/current.txt b/api/current.txt index 01edc71191f8e..d957d68be641e 100644 --- a/api/current.txt +++ b/api/current.txt @@ -8998,7 +8998,7 @@ package android.bluetooth.le { method @Nullable public byte[] getManufacturerSpecificData(int); method public java.util.Map getServiceData(); method @Nullable public byte[] getServiceData(android.os.ParcelUuid); - method @Nullable public java.util.List getServiceSolicitationUuids(); + method @NonNull public java.util.List getServiceSolicitationUuids(); method public java.util.List getServiceUuids(); method public int getTxPowerLevel(); } diff --git a/core/java/android/bluetooth/le/ScanRecord.java b/core/java/android/bluetooth/le/ScanRecord.java index 2174255a3619a..30868bfeac66f 100644 --- a/core/java/android/bluetooth/le/ScanRecord.java +++ b/core/java/android/bluetooth/le/ScanRecord.java @@ -16,6 +16,7 @@ package android.bluetooth.le; +import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.UnsupportedAppUsage; import android.bluetooth.BluetoothUuid; @@ -97,7 +98,7 @@ public final class ScanRecord { * Returns a list of service solicitation UUIDs within the advertisement that are used to * identify the Bluetooth GATT services. */ - @Nullable + @NonNull public List getServiceSolicitationUuids() { return mServiceSolicitationUuids; } @@ -297,9 +298,6 @@ public final class ScanRecord { if (serviceUuids.isEmpty()) { serviceUuids = null; } - if (serviceSolicitationUuids.isEmpty()) { - serviceSolicitationUuids = null; - } return new ScanRecord(serviceUuids, serviceSolicitationUuids, manufacturerData, serviceData, advertiseFlag, txPowerLevel, localName, scanRecord); } catch (Exception e) {