-
Notifications
You must be signed in to change notification settings - Fork 587
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add and use AdvertisingSidExtractor, add ScanResult constructor
- Loading branch information
1 parent
27dd3f4
commit ea0989e
Showing
6 changed files
with
82 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
...oidble/src/main/java/com/polidea/rxandroidble2/internal/scan/AdvertisingSidExtractor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.polidea.rxandroidble2.internal.scan; | ||
|
||
import android.bluetooth.le.ScanResult; | ||
|
||
import androidx.annotation.RestrictTo; | ||
|
||
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) | ||
public interface AdvertisingSidExtractor { | ||
Integer extract(ScanResult scanResult); | ||
} |
16 changes: 16 additions & 0 deletions
16
...e/src/main/java/com/polidea/rxandroidble2/internal/scan/AdvertisingSidExtractorApi18.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.polidea.rxandroidble2.internal.scan; | ||
|
||
import android.bluetooth.le.ScanResult; | ||
|
||
import bleshadow.javax.inject.Inject; | ||
|
||
public class AdvertisingSidExtractorApi18 implements AdvertisingSidExtractor { | ||
@Inject | ||
public AdvertisingSidExtractorApi18() { | ||
} | ||
|
||
@Override | ||
public Integer extract(ScanResult scanResult) { | ||
return null; | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...e/src/main/java/com/polidea/rxandroidble2/internal/scan/AdvertisingSidExtractorApi26.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.polidea.rxandroidble2.internal.scan; | ||
|
||
import android.bluetooth.le.ScanResult; | ||
|
||
import androidx.annotation.RequiresApi; | ||
import androidx.annotation.RestrictTo; | ||
|
||
import bleshadow.javax.inject.Inject; | ||
|
||
@RequiresApi(26 /* Build.VERSION_CODES.O */) | ||
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) | ||
public class AdvertisingSidExtractorApi26 implements AdvertisingSidExtractor { | ||
@Inject | ||
public AdvertisingSidExtractorApi26() { | ||
} | ||
|
||
@Override | ||
public Integer extract(ScanResult scanResult) { | ||
return scanResult.getAdvertisingSid(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters