AltBeacon/android-beacon-library

altbeacon enforces 15 min backgroundBetweenScanPeriod on android 8+

Opened this issue · 1 comments

Expected behavior

Library integrators should be able to configure custom values for the backgroundBetweenScanPeriod.

Actual behavior

The altbeacon library does not let the integrator change the value for backgroundBetweenScanPeriod and enforces 15 min between background scans. When a value less than 15 mins is given to this parameter, it warns with the following;

"Setting a short backgroundBetweenScanPeriod has no effect on Android 8+, which is limited to scanning every ~15 minutes"

and continues to wait for ~15 mins between every background scan.

Steps to reproduce this behavior

1- Set backgroundBetweenScanPeriod from beaconManager instance to any value below 15 mins, in milliseconds.
2- Observe the log: "Setting a short backgroundBetweenScanPeriod has no effect on Android 8+, which is limited to scanning every ~15 minutes"
3- Put the app on background.
4- Observe that the scan stops and does not start for the next ~15 mins. This can be identified by the lack of: "BluetoothLeScanner org.altbeacon.beaconreference Start Scan with callback"
message in the logcat, or by the lack of ble detections.

Mobile device model and OS version

Samsung S23(SM-S911B) - Android 14 / API 34

Android Beacon Library version

implementation 'org.altbeacon:android-beacon-library:2.20.3'

@elican-doenyas can you retest using the latest beta version: [2.21.0-beta2]
This has fixed the issue for me