I have an app that uses Bluetooth Beacons. When app is in doze mode proximity notifications from bluetooth beacons are not waking the phone. It is only when I unlock phone that the notification is delivered. This issue is the same for foreground or app that has been killed.
-
Are there any known issues? Or could it be the code? – user2593835 Dec 17 '18 at 00:13
1 Answers
Starting with Android 6.0, Doze mode blocks any bluetooth scan callbacks or other events, including beacon detections. I discussed this issue with Android Bluetooth engineers during a session at Google I/O 2015. Their position was that because sensed motion will exit Doze mode, this is not an issue, since a phone typically cannot discover new bluetooth beacons when it is motionless and therefore presumably in the same place.
While this is true for most use cases, there are a few exceptions: (1) On a train or other vehicle in a single direction on a straight path, the accelerometer won't detect motion and the phone may go into Doze despite being in motion and potentially seeing new beacons. (2) In some use cases, beacon advertisements are built to be dynamic, so they appear and disappear in the same case. In both of these situations Android devices are simply unable to detect new beacon advertisements if they are in Doze mode.
This is an unfortunate limitation you must simply design around.
EDIT: Starting with Android 7 there are two types of Doze mode, heavy and light. Light doze mode kicks in when the screen is off but the phone is not motionless. Heavy doze mode kicks in when the screen is off and the device is motionless for a period of time. In light doze mode, beacon detections are delivered normally. In heavy doze mode, they are not supposed to be according to Google. However, on some devices they do. I see them delivered in heavy doze mode on a Samsung Galaxy S8 with Android 8.0 with a foreground service running.

- 63,876
- 14
- 121
- 204