Skip to content

Commit 8f4907e

Browse files
committed
Merge
2 parents 7467a47 + 8df7799 commit 8f4907e

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
android.enableJetifier=true
2020
android.useAndroidX=true
2121

22-
VERSION_NAME=1.4.2
22+
VERSION_NAME=1.4.3
2323
GROUP=no.nordicsemi.android.support.v18
2424

2525
POM_DESCRIPTION=Android Bluetooth LE Scanner Compat library

scanner/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ dependencies {
4141
testImplementation "org.powermock:powermock-api-mockito:1.7.4"
4242
}
4343

44-
apply from: rootProject.file('gradle/gradle-bintray-push.gradle')
44+
//apply from: rootProject.file('gradle/gradle-bintray-push.gradle')

scanner/src/main/java/no/nordicsemi/android/support/v18/scanner/ScanFilter.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,13 @@ public ScanFilter createFromParcel(final Parcel in) {
183183
final byte[] serviceData = new byte[serviceDataLength];
184184
in.readByteArray(serviceData);
185185
if (in.readInt() == 0) {
186+
//noinspection ConstantConditions
186187
builder.setServiceData(serviceDataUuid, serviceData);
187188
} else {
188189
final int serviceDataMaskLength = in.readInt();
189190
final byte[] serviceDataMask = new byte[serviceDataMaskLength];
190191
in.readByteArray(serviceDataMask);
192+
//noinspection ConstantConditions
191193
builder.setServiceData(serviceDataUuid, serviceData, serviceDataMask);
192194
}
193195
}
@@ -518,14 +520,12 @@ public Builder setServiceUuid(@Nullable final ParcelUuid serviceUuid,
518520
*
519521
* @throws IllegalArgumentException If {@code serviceDataUuid} is null.
520522
*/
521-
public Builder setServiceData(@Nullable final ParcelUuid serviceDataUuid,
523+
public Builder setServiceData(@NonNull final ParcelUuid serviceDataUuid,
522524
@Nullable final byte[] serviceData) {
523-
if (serviceDataUuid == null && serviceData != null) {
525+
//noinspection ConstantConditions
526+
if (serviceDataUuid == null) {
524527
throw new IllegalArgumentException("serviceDataUuid is null!");
525528
}
526-
if (serviceDataUuid != null && serviceData == null) {
527-
throw new IllegalArgumentException("serviceData is null!");
528-
}
529529
this.serviceDataUuid = serviceDataUuid;
530530
this.serviceData = serviceData;
531531
this.serviceDataMask = null; // clear service data mask
@@ -542,10 +542,11 @@ public Builder setServiceData(@Nullable final ParcelUuid serviceDataUuid,
542542
* {@code serviceDataMask} is {@code null} while {@code serviceData} is not or
543543
* {@code serviceDataMask} and {@code serviceData} has different length.
544544
*/
545-
public Builder setServiceData(@Nullable final ParcelUuid serviceDataUuid,
545+
public Builder setServiceData(@NonNull final ParcelUuid serviceDataUuid,
546546
@Nullable final byte[] serviceData,
547547
@Nullable final byte[] serviceDataMask) {
548-
if (serviceDataUuid == null && serviceData != null) {
548+
//noinspection ConstantConditions
549+
if (serviceDataUuid == null) {
549550
throw new IllegalArgumentException("serviceDataUuid is null");
550551
}
551552
if (serviceDataMask != null) {

0 commit comments

Comments
 (0)