Smartphone contact tracing without Apple or Google

Yesterday I considered what effect a smartphone app to report, diagnose and trace contacts might have on the transmission of Covid-19. That made the assumption that such an app could first of all identify contacts, and determine which were sufficiently close to be high risk. This article considers whether an iPhone can do that, specifically when running the UK’s new Covid-19 app.

Like many infections, you can catch Covid-19 when the coronavirus gets inside your body. It has quite a wide if sordid choice of routes, which include the favourite vector of unwashed hands, which have viable virus on them and are then licked or brought into contact with the eyes. Smartphones can do nothing to warn you of what might be lurking on the taps or doorhandles of the toilets: you know what you have to do in the way of hand hygiene.

It’s thought that the most popular way to become infected with the Covid-19 virus is by inhaling viable virus from the air around you, either in the form of larger virus-rich droplets or finer aerosols. There’s considerable debate over which is the more important: if you want to read an excellent article considering some of the evidence and drawing excellent conclusions, I recommend this one by Erin Bromage. This explains how the main determinant is virus dose times the time of exposure to that dose.

Sadly, there aren’t hard and fast rules as to what is likely to result in Covid-19 infection, which in any case varies considerably from one individual to another, even within one person at different times of the day. What we need to be concerned about is risk averaged across the population. If your iPhone (don’t worry, I’ll mention Android phones later) can record how long and how close you were to someone likely to be pushing out virus-rich droplets and aerosol, then it should be able to give a reasonable assessment of your risk from that exposure.

Recent models of iPhone (and lesser devices) can do this using low-energy Bluetooth, BLE. The basis for this is that the phone can transmit a short digital ‘ping’, and listen for the pings of others within the locale. The overall outdoor range of BLE can reach a hundred metres or more, but its radio signal is rapidly attenuated by walls and most other solids that come in the way. Once in communication, two phones can then exchange details and, by estimating the strength of the radio signal, can work out how far away they are from one another. They can also keep in touch over time, giving a good idea of how long the phones were within any given range.

Problems come with the fact that mobile phones are designed to maximise battery endurance, and both iOS and Android devices use several techniques to limit the energy used by BLE. iOS is particularly difficult in this respect: ordinarily, it won’t allow apps free access to BLE when the phone is locked, and it may even force an app to quit when it needs to. Some iOS developers went on record saying that, without using privileged features in Apple’s forthcoming frameworks to support contact tracing, due in iOS 13.5, it was impossible for an app to access BLE when the phone was locked.

That turns out to be incorrect. Although quite an engineering challenge, there are ways and means as Apple has described. Fortunately, this is a subject which the folk at Reincubate have examined very carefully, even using the UK app on jailbroken devices. Their first article here and sequel here are valuable reading, and not too technical. The horse’s mouth is the source code of the UK app, which is available for both iOS and Android on GitHub.

The upshot of all this technical scrutiny is the conclusion that, in ordinary use in populous areas, the UK Covid-19 app is likely to capture contacts with good reliability. There are some circumstances where, when an iPhone is locked, it may miss a contact. These are most likely where that iPhone hasn’t been active for more than an hour, and there haven’t been any active Android phones in the vicinity either.

This tallies with my experience using the app here on the Isle of Wight. When we go shopping and have abundant opportunity for BLE contacts, the app clocks up long periods in the background, and a few minutes in the foreground, presumably when it has established a contact. For the last few days, my only close contacts have been with my wife and her iPhone, and the app seemingly vanished, and didn’t even register in the Battery monitor. Once I had opened the app again, it resumed more normal activity, again in the background.

As the app gives no indication of whether it ever makes contact with other phones, it’s impossible to even guess whether it’s missing a significant number of contacts when my phone is locked. That’s clearly something its developers will need to monitor.

Another popular criticism is that, for it to make contacts, it would use excessive amounts of battery power. Even when we have been quite active, and it has clocked up several hours in the background, it is amazingly frugal with energy on iPhones, and neither I nor my wife have noticed any increase in battery use since installing the app.

The final, and perhaps most important, question is whether it’s assessing the risk of contacts correctly. This is the most difficult to answer, as its centralised model of contact tracing deals with all such decision-making in the server, to which the app merely sends the private GUID of the phone it has contacted, and information about the distance and duration of that exposure.

For the purposes of contact tracing, the World Health Organisation defines a contact as being within 1 metre of a Covid-19 case for a period of more than 15 minutes, or having direct physical contact for any period of time. Although smartphones can’t assess the latter, even with low time resolution in BLE contacts the former should be easy to assess. Buried in the PDF source code of one of the NHS documents about its Covid-19 contact tracing app, I discovered the hidden figures of 1.5 metres for 30 seconds, or 6 metres for 10 minutes, which could perhaps reflect starting thresholds for the UK app.

The big difference between centralised and de-centralised methods of contact tracing is where matching of contacts is performed: in the de-centralised method, the central database has no knowledge of matches, which have to be performed in the app itself. In the centralised method, not only is matching of contacts performed in the central server, but the data there can be used to refine and modify the matching algorithm.

I haven’t seen this discussed anywhere yet, but the ability to use existing contact data, and knowledge of whether they have later tested positive, to improve the criteria for contacts appears to be a huge advantage in the UK system. An app based on the Apple-Google frameworks doesn’t appear to be able to do that at all, although the app can of course be updated to use different matching criteria.

I hope this short series of articles has given you better insight into what the UK’s Covid-19 app can currently do. I will be posting updates with further experience in the next week or two, and am always happy to answer questions. I’m not associated with the app or its development in any way, other than being a trial subject. Neither an I am iOS engineer or a public health consultant. However, I am (still) a medical practitioner with long experience in healthcare and research computing. I’ve even done a fair bit of epidemiological research, although not in viral illness or pandemics.

Stay safe.