Merge "Bluetooth: Make ScanRecord.getServiceSolicitationUuids NonNull" into qt-dev

This commit is contained in:
TreeHugger Robot
2019-04-15 18:38:14 +00:00
committed by Android (Google) Code Review
2 changed files with 3 additions and 5 deletions

View File

@@ -9001,7 +9001,7 @@ package android.bluetooth.le {
method @Nullable public byte[] getManufacturerSpecificData(int); method @Nullable public byte[] getManufacturerSpecificData(int);
method public java.util.Map<android.os.ParcelUuid,byte[]> getServiceData(); method public java.util.Map<android.os.ParcelUuid,byte[]> getServiceData();
method @Nullable public byte[] getServiceData(android.os.ParcelUuid); method @Nullable public byte[] getServiceData(android.os.ParcelUuid);
method @Nullable public java.util.List<android.os.ParcelUuid> getServiceSolicitationUuids(); method @NonNull public java.util.List<android.os.ParcelUuid> getServiceSolicitationUuids();
method public java.util.List<android.os.ParcelUuid> getServiceUuids(); method public java.util.List<android.os.ParcelUuid> getServiceUuids();
method public int getTxPowerLevel(); method public int getTxPowerLevel();
} }

View File

@@ -16,6 +16,7 @@
package android.bluetooth.le; package android.bluetooth.le;
import android.annotation.NonNull;
import android.annotation.Nullable; import android.annotation.Nullable;
import android.annotation.UnsupportedAppUsage; import android.annotation.UnsupportedAppUsage;
import android.bluetooth.BluetoothUuid; 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 * Returns a list of service solicitation UUIDs within the advertisement that are used to
* identify the Bluetooth GATT services. * identify the Bluetooth GATT services.
*/ */
@Nullable @NonNull
public List<ParcelUuid> getServiceSolicitationUuids() { public List<ParcelUuid> getServiceSolicitationUuids() {
return mServiceSolicitationUuids; return mServiceSolicitationUuids;
} }
@@ -297,9 +298,6 @@ public final class ScanRecord {
if (serviceUuids.isEmpty()) { if (serviceUuids.isEmpty()) {
serviceUuids = null; serviceUuids = null;
} }
if (serviceSolicitationUuids.isEmpty()) {
serviceSolicitationUuids = null;
}
return new ScanRecord(serviceUuids, serviceSolicitationUuids, manufacturerData, return new ScanRecord(serviceUuids, serviceSolicitationUuids, manufacturerData,
serviceData, advertiseFlag, txPowerLevel, localName, scanRecord); serviceData, advertiseFlag, txPowerLevel, localName, scanRecord);
} catch (Exception e) { } catch (Exception e) {