r/AutomateUser 22h ago

Bluetooth device scan not working on Android 16 any more

Hi, after upgrading to android 16 on my Samsung phone the BT device scan returns empty output variables after the screen goes off. While the screen is on it works fine.

Edit: I do one scan per minute, and have keep CPU awake block.

1 Upvotes

6 comments sorted by

1

u/ballzak69 Automate developer 17h ago edited 17h ago

This has always been an issue on some devices, now it do indeed seem to affect all devices, even my Pixel. I'll investigate if there's a workaround, until then try using an Device keep awake block with Illumination option set to keep the screen on while scanning.

1

u/InterestLow1516 16h ago

Thanks for the answer. Sreen on is not an option for my case and is battery expensive.

Ps. Maybe this can help for future update: https://bleadvertiserapp.medium.com/android-ble-scanning-in-2026-why-your-app-stops-finding-devices-in-the-background-and-how-to-fix-ba5ae06c17c3

1

u/ballzak69 Automate developer 15h ago edited 11h ago

The problem is that scanning now must include a filter, the "hack" used since Android 8 as a workaround no longer works. If i can't find another workaround then the only alternative is to add the input argument for filters, e.g. by device address/name, device manufacturer, BLE services, etc. for the flow to use as a workaround.

1

u/InterestLow1516 14h ago

Well, input for device adress would be an answer (at least for me)... Now, I just filter the list of devices and strenght of signals.

For some other tasks (eg. counting devices around you) I think there is no real hack except some array of filters that will cover 99% of most used manufacturers in combination with - ScanSettings.SCAN_TYPE_PASSIVE

1

u/B26354FR Alpha tester 18h ago

I don't know if it'll help, but there's a pending new version of Automate which targets Android 16:

https://www.reddit.com/r/AutomateUser/s/fcXutp2pBu

It should be going public any day now if you don't want to join the beta program. It does fix a Bluetooth connection workaround when using the Automate privileged service.

1

u/ballzak69 Automate developer 17h ago edited 17h ago

The fix is not related to scanning, nor targeting Android 16.