You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I stumbled on a bug when testing scanning strategies for our use-case. We had phones running the app for long periods of time and were connected to remote logging solution so we had the logs to be observed.
We tested IntentScanningStrategy first and then via an app updated switched the app to use ForegroundServiceScanning.
Expected behavior
After the update all IntentScanningStrategy broadcasts should stop, ie. app is unregistered from Android BluetoothLE pending intent callbacks
We used remote logging solution so I saw this behaviour on one of our phones, other 3 phones in the tests were not impacted, nor could I reproduce the issue on my local device.
What I suggest is explicitly calling BluetoothLeScanner#stopScan(getScanCallbackIntent()) when client calls BeaconManager#setIntentScanningStrategyEnabled(false)
Mobile device model and OS version
Affected device in our tests: Galaxy S9 (SM-G960U1), Android 10
Android Beacon Library version
2.19.5-beta9
The text was updated successfully, but these errors were encountered:
Thank you for this report. I know that boundary conditions associated with switching strategies is not well tested, so I believe you are probably correct here.
I stumbled on a bug when testing scanning strategies for our use-case. We had phones running the app for long periods of time and were connected to remote logging solution so we had the logs to be observed.
We tested IntentScanningStrategy first and then via an app updated switched the app to use ForegroundServiceScanning.
Expected behavior
After the update all IntentScanningStrategy broadcasts should stop, ie. app is unregistered from Android BluetoothLE pending intent callbacks
Actual behavior
Foreground service starts scanning, but the app is also receiving intents in StartupBroadcastReceiver#L37
Steps to reproduce this behavior
We used remote logging solution so I saw this behaviour on one of our phones, other 3 phones in the tests were not impacted, nor could I reproduce the issue on my local device.
What I observed from the sdk code is that in case of a process restart with a different scanning strategy ScanHelper#stopAndroidOBackgroundScan is never called since the sdk doesn't have any reference to previous intent scanning strategy startup, even when calling BeaconManager#setIntentScanningStrategyEnabled(false).
What I suggest is explicitly calling
BluetoothLeScanner#stopScan(getScanCallbackIntent())
when client callsBeaconManager#setIntentScanningStrategyEnabled(false)
Mobile device model and OS version
Affected device in our tests: Galaxy S9 (SM-G960U1), Android 10
Android Beacon Library version
2.19.5-beta9
The text was updated successfully, but these errors were encountered: