This issue wouldn't impact iOS devices finding each other, as CoreBluetooth handles parsing overflow data for apps.
I haven't run a live test of this issue to reproduce it, or test that this would be enough to make it actually work. I also haven't tested how the NHSx app interacts with having TraceTogether on the same device.
But as is, from reading the source code, this definitely doesn't work, regardless of what the other peripheral app does.
Describe the bug
The Android app will not discover iOS devices running the app in the background if they are running any other peripheral service (eg: TraceTogether).
At present, it appears to check for an explicit Apple manufacturer-specific data field value:
https://github.com/nhsx/COVID-19-app-Android-BETA/blob/acfb01e3c40ac8f35cb85b55208e6efa3a10241d/gradle.properties#L29
https://github.com/nhsx/COVID-19-app-Android-BETA/blob/acfb01e3c40ac8f35cb85b55208e6efa3a10241d/app/src/main/java/uk/nhs/nhsx/sonar/android/app/ble/Scanner.kt#L67-L73
The value is:
01 00 00 00 00 00 00 00 00 00 40 00 00 00 00 00 00
Instead, it should check the Apple manufacturer data:
0x01
(Overflow area)0x40
is setThis could be partially be done with
ScanFilter
by passing the additional manufacturerDataMask parameter, but you need to ignore the other types of Apple BLE submessages.To Reproduce
Expected behaviour
The Android device in central mode should be able to discover the iOS device in peripheral mode with the app in the background.
Additional context
http://www.davidgyoungtech.com/2020/05/07/hacking-the-overflow-area
This issue wouldn't impact iOS devices finding each other, as CoreBluetooth handles parsing overflow data for apps.
I haven't run a live test of this issue to reproduce it, or test that this would be enough to make it actually work. I also haven't tested how the NHSx app interacts with having TraceTogether on the same device.
But as is, from reading the source code, this definitely doesn't work, regardless of what the other peripheral app does.