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

Commit d6b49ec6 authored by Omair Kamil's avatar Omair Kamil Committed by Automerger Merge Worker
Browse files

Merge "Fix typos in ScanFilter where the method arguments should be checked...

Merge "Fix typos in ScanFilter where the method arguments should be checked instead of the unset members." into main am: ace0cd51 am: 5df31c6b

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/3159221



Change-Id: I690d19071c32fe66b8b2ecb01e8184b42937d2d8
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 83434e3d 5df31c6b
Loading
Loading
Loading
Loading
+18 −18
Original line number Diff line number Diff line
@@ -887,7 +887,7 @@ public final class ScanFilter implements Parcelable {
         *     uuidMask} is not {@code null}.
         */
        public Builder setServiceUuid(ParcelUuid serviceUuid, ParcelUuid uuidMask) {
            if (mUuidMask != null && mServiceUuid == null) {
            if (uuidMask != null && serviceUuid == null) {
                throw new IllegalArgumentException("uuid is null while uuidMask is not null!");
            }
            mServiceUuid = serviceUuid;
@@ -958,14 +958,14 @@ public final class ScanFilter implements Parcelable {
            if (serviceDataUuid == null) {
                throw new IllegalArgumentException("serviceDataUuid is null");
            }
            if (mServiceDataMask != null) {
                if (mServiceData == null) {
            if (serviceDataMask != null) {
                if (serviceData == null) {
                    throw new IllegalArgumentException(
                            "serviceData is null while serviceDataMask is not null");
                }
                // Since the mServiceDataMask is a bit mask for mServiceData, the lengths of the two
                // byte array need to be the same.
                if (mServiceData.length != mServiceDataMask.length) {
                // Since the serviceDataMask is a bit mask for serviceData, the lengths of the two
                // byte arrays need to be the same.
                if (serviceData.length != serviceDataMask.length) {
                    throw new IllegalArgumentException(
                            "size mismatch for service data and service data mask");
                }
@@ -1007,14 +1007,14 @@ public final class ScanFilter implements Parcelable {
            if (manufacturerData != null && manufacturerId < 0) {
                throw new IllegalArgumentException("invalid manufacture id");
            }
            if (mManufacturerDataMask != null) {
                if (mManufacturerData == null) {
            if (manufacturerDataMask != null) {
                if (manufacturerData == null) {
                    throw new IllegalArgumentException(
                            "manufacturerData is null while manufacturerDataMask is not null");
                }
                // Since the mManufacturerDataMask is a bit mask for mManufacturerData, the lengths
                // of the two byte array need to be the same.
                if (mManufacturerData.length != mManufacturerDataMask.length) {
                // Since the manufacturerDataMask is a bit mask for manufacturerData, the lengths
                // of the two byte arrays need to be the same.
                if (manufacturerData.length != manufacturerDataMask.length) {
                    throw new IllegalArgumentException(
                            "size mismatch for manufacturerData and manufacturerDataMask");
                }
@@ -1083,16 +1083,16 @@ public final class ScanFilter implements Parcelable {
            if (advertisingDataType < 0) {
                throw new IllegalArgumentException("invalid advertising data type");
            }
            if (mAdvertisingDataMask != null) {
                if (mAdvertisingData == null) {
            if (advertisingDataMask != null) {
                if (advertisingData == null) {
                    throw new IllegalArgumentException(
                            "mAdvertisingData is null while mAdvertisingDataMask is not null");
                            "advertisingData is null while advertisingDataMask is not null");
                }
                // Since the mAdvertisingDataMask is a bit mask for mAdvertisingData, the lengths
                // of the two byte array need to be the same.
                if (mAdvertisingData.length != mAdvertisingDataMask.length) {
                // Since the advertisingDataMask is a bit mask for advertisingData, the lengths
                // of the two byte arrays need to be the same.
                if (advertisingData.length != advertisingDataMask.length) {
                    throw new IllegalArgumentException(
                            "size mismatch for mAdvertisingData and mAdvertisingDataMask");
                            "size mismatch for advertisingData and advertisingDataMask");
                }
            }
            mAdvertisingDataType = advertisingDataType;