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

Commit ace0cd51 authored by Omair Kamil's avatar Omair Kamil Committed by Gerrit Code Review
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
parents 581b7f3e 742a58a6
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;