Skip to content

On Samsung phones running Android OS 17, beacons are not detected when the app switches to the background. #1250

Description

@bluendev

I am developing an app that continuously scans for beacons and performs an action when a signal is detected.

While apps previously ran without issues even when in the background, a problem has recently arisen on Samsung phones running OS 17.

On Samsung phones running Android OS 17, the didEnterRegion state within MonitorNotifer does not execute when the app enters the background.

The following is a portion of my app's logs.

09-09 16:28:54.007 29949 30270 I BeaconModeHelper: Normal BLE Device : test , Address : E2:C3:67:7E:8C:05
09-09 16:28:54.007 29949 30270 I BeaconModeHelper: Valid Device Null, Support Beacon State: true
09-09 16:28:54.007 29949 30281 I BeaconModeHelper: Normal BLE Device : test , Address : E2:C3:67:7E:8C:05
09-09 16:28:54.007 29949 30281 I BeaconModeHelper: Valid Device Null, Support Beacon State: true
09-09 16:28:54.007 29949 30255 I BeaconModeHelper: Normal BLE Device : test , Address : E2:C3:67:7E:8C:05
09-09 16:28:54.007 29949 30255 I BeaconModeHelper: Valid Device Null, Support Beacon State: true
09-09 16:28:54.012 29949 30271 I BeaconModeHelper: Normal BLE Device : test , Address : E2:C3:67:7E:8C:05
09-09 16:28:54.012 29949 30271 I BeaconModeHelper: Valid Device Null, Support Beacon State: true
09-09 16:28:54.072 29949 30282 I BeaconModeHelper: Normal BLE Device : test , Address : E2:C3:67:7E:8C:05
09-09 16:28:54.072 29949 30282 I BeaconModeHelper: Valid Device Null, Support Beacon State: true
09-09 16:28:54.093 29949 30256 I BeaconModeHelper: Normal BLE Device : test , Address : E2:C3:67:7E:8C:05
09-09 16:28:54.093 29949 30256 I BeaconModeHelper: Valid Device Null, Support Beacon State: true
09-09 16:28:59.230 29949 29949 I BeaconModeHelper: ----Did Range Beacons----
09-09 16:28:59.230 29949 29949 I BEACON_TEST_APK : beacon module scan
09-09 16:28:59.230 29949 29949 I BeaconModeHelper: Gate Beacon is Null
09-09 16:28:59.230 29949 29949 I BEACON_TEST_APK : none beacon
09-09 16:28:59.266 29949 29949 I VRI[Gayo_Main]@2ff5c9c: onDisplayChanged oldDisplayState=1 newDisplayState=2
09-09 16:28:59.274 29949 29949 D Choreographer: CoreRune.SYSPERF_ACTIVE_APP_BBA_ENABLE : stop animation in background states
09-09 16:28:59.326 29949 30283 I BeaconModeHelper: Normal BLE Device : test , Address : E2:C3:67:7E:8C:05
09-09 16:28:59.326 29949 30283 I BeaconModeHelper: Valid Device Null, Support Beacon State: true
09-09 16:28:59.348 29949 30269 I BeaconModeHelper: Normal BLE Device : test , Address : E2:C3:67:7E:8C:05
09-09 16:28:59.348 29949 30269 I BeaconModeHelper: Valid Device Null, Support Beacon State: true
09-09 16:28:59.398 29949 30267 I BeaconModeHelper: Normal BLE Device : test , Address : E2:C3:67:7E:8C:05
09-09 16:28:59.398 29949 30267 I BeaconModeHelper: Valid Device Null, Support Beacon State: true
09-09 16:28:59.400 29949 30270 I BeaconModeHelper: INSIDE
09-09 16:28:59.400 29949 30270 I ModelSpecificDistanceCalculator: No distanceModelUpdateUrl is configured. App will use built-in database for Android distance calculations.
09-09 16:28:59.400 29949 30270 W ModelSpecificDistanceCalculator: Cannot find match for this device. Using default
09-09 16:28:59.400 29949 30270 W ModelSpecificDistanceCalculator: Cannot find match for this device. Using default
09-09 16:28:59.400 29949 30270 I BeaconModeHelper: Did Enter Region
09-09 16:28:59.401 29949 29949 I BeaconService: start ranging received
09-09 16:28:59.401 29949 29949 I BeaconService: Already ranging that region -- will replace existing region.
09-09 16:28:59.411 29949 29949 I CycledLeScanner: Adjusted scanStopTime to be 1064588876
09-09 16:28:59.419 29949 29949 I SystemServiceReceiver: ACTION_SCREEN_ON
09-09 16:28:59.455 29949 30281 I BeaconModeHelper: Normal BLE Device : test , Address : E2:C3:67:7E:8C:05
09-09 16:28:59.456 29949 30281 I BeaconModeHelper: Valid Device Null, Support Beacon State: true
09-09 16:28:59.482 29949 30271 I BeaconModeHelper: Normal BLE Device : test , Address : E2:C3:67:7E:8C:05
09-09 16:28:59.482 29949 30271 I BeaconModeHelper: Valid Device Null, Support Beacon State: true
09-09 16:28:59.491 29949 30282 I BeaconModeHelper: Normal BLE Device : test , Address : E2:C3:67:7E:8C:05
09-09 16:28:59.491 29949 30282 I BeaconModeHelper: Valid Device Null, Support Beacon State: true
09-09 16:29:00.231 29949 29949 I BeaconModeHelper: ----Did Range Beacons----
09-09 16:29:00.232 29949 29949 I BEACON_TEST_APK : beacon module scan
09-09 16:29:00.232 29949 29949 I BeaconModeHelper: Did Range Beacon : id1: 1111ab00-00cd-e1e1-e3e3-000000000777 id2: 0 id3: 0


The module I am testing transmits both standard BLE signals and beacon signals.

The "BeaconModeHelper: Normal BLE Device" message is part of the log from the setNonBeaconLeScanCallback registered with beaconManager. While "Normal BLE" devices are being scanned successfully, beacons are not being detected.

The moment I turn on the mobile phone screen, did enter region triggers, and the beacon is scanned successfully. I do not know the reason why this happens.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions