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

Commit 24966886 authored by Zach Johnson's avatar Zach Johnson
Browse files

Add nullability annotations to android.bluetooth.le.ScanFilter.Builder setServiceSolicitationUuid

Test: compilation
Fixes: 126698824
Change-Id: I4873b46a37df3e103ddc62001cc9f0bc01aea4dc
parent f2d49bda
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package android.bluetooth.le;

import android.annotation.NonNull;
import android.annotation.Nullable;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
@@ -586,7 +587,8 @@ public final class ScanFilter implements Parcelable {
        /**
         * Set filter on service solicitation uuid.
         */
        public Builder setServiceSolicitationUuid(ParcelUuid serviceSolicitationUuid) {
        public @NonNull Builder setServiceSolicitationUuid(
                @Nullable ParcelUuid serviceSolicitationUuid) {
            mServiceSolicitationUuid = serviceSolicitationUuid;
            return this;
        }
@@ -601,8 +603,9 @@ public final class ScanFilter implements Parcelable {
         * @throws IllegalArgumentException If {@code serviceSolicitationUuid} is {@code null} but
         *             {@code serviceSolicitationUuidMask} is not {@code null}.
         */
        public Builder setServiceSolicitationUuid(ParcelUuid serviceSolicitationUuid,
                ParcelUuid solicitationUuidMask) {
        public @NonNull Builder setServiceSolicitationUuid(
                @Nullable ParcelUuid serviceSolicitationUuid,
                @Nullable ParcelUuid solicitationUuidMask) {
            if (mServiceSolicitationUuidMask != null && mServiceSolicitationUuid == null) {
                throw new IllegalArgumentException(
                        "SolicitationUuid is null while SolicitationUuidMask is not null!");