Email or username:

Password:

Forgot your password?
Daniel

What happens when #Android manufacturers prefer battery life over proper functionality 😮

This is from the android issue tracker about OEMs stopping background workers unexpectedly ✋

dontkillmyapp.com

I use Android APS (AAPS), an artificial pancreas app to automate insulin pump delivery based on Continuous Glucose monitor readings. I have disabled battery optimisations for this app, and play protect. This is a S22 Ultra on Android 13. Twice this month Android APS (AAPS) has been killed during the night. I believe it was the adaptive power saving setting (which I have now had to disable system wide).

the net result both times was insulin delivery stopped and I slipped into Hyperglycemia in my sleep and woke up (fortunately) to alarms from high blood sugar. Not only is there some aggressive app killing going on, but it's somehow subverting my explicit "Do not optimise" configuration.
58 comments
Daniel

An insulin pump which depends on an app working at all times sounds like something that should not make it through approval ⚡

DELETED

@djh This is fascinating, I just learned that AAPS is an unlicensed hack to directly connect the glucose sensor to the pump and to control it in realtime. I would have expected that that is the default but apparently it's not.

So: Cool, but a bit dangerous.

Charlie

@elfrinjo @djh That kind of closed loop system sounds really dangerous.

Ian Holmes

@djh @faheus @elfrinjo no, it’s a life saver. Closed loop artificial pancreas systems reduce lows and highs. But it’s a recent technology and there are only a few devices with limited configurability - and not all insurance plans cover them. These people trying out open source versions are pioneers.

rc

@djh insulin pumps should never depend on a smart phone in any way.
Second point is that this type of data should not be exchanged with some sort of cloud driven by the manufacturer of pump or CGM.

Natalie

@rc @djh many diabetics hack pumps and apps in this way due to proprietary software and the whole system "retail" being prohibitively expensive. I don't know much about the actual hacking side of it but I am not brave enough to experiment with it myself. I do multiple daily injections to manage my blood sugar - a luddite in the type 1 world!

Fortunately the CGM should catch the high blood sugars but it still isn't optimal diabetic treatment!

Jennifer Kayla | Theogrin 🦊

@Natalie @rc @djh

I'm on an ultralente and a log, which works just fine for me, but even without a pump, recently my Android phone has been disabling the CGM's notifications for Reasons, which, yanno, not so good.

I make half jokes about how because I can tell when I'm low while awake, I can't tell so easily when I'm asleep, so I prefer to be higher before I slumber...

rc

@theogrin @Natalie @djh I soon will get my semi-automatic system. At least basal will be managed automatically depending on CGM readings. Sounds great and hopefully is.

𝕸𝔞𝔩𝔦𝔫

@rc @theogrin @Natalie @djh this doesn't look ideal, but still, if people use software in a particular way then it's not a bug, it's a feature, and requires attention.

And sometimes the buggy bio-hack is the best alternative someone has.

DELETED

@djh

Mobile phones are not intended to be medical devices.

It can be difficult to create a dedicated device. But to run life-critical software on an internet-connected computer where you have little control or knowledge of the inner workings?

Was the app actually killed by the phone to save power? Is there a bug that caused the app to be killed? Perhaps the bug is in the app, not the phone?

cominixo
@djh A bit of context: Killing the app doesn't mean the insulin pump will stop working, it will just revert to its default behavior (so the same as it was doing without AndroidAPS). A lot of people (like myself) resort to open-source solutions like this because manufacturers give us very little control over our own medical devices, so sure, ideally this wouldn't be running on a smartphone, but the official proprietary solutions (if there even is one available for you depending on insurance/country/whatever) are behind what we get with open-source solutions right now. The improvement in quality of life is incredibly noticeable, a lot of people are suffering with burnout, the tech is here and we're not going to wait years for some shitty proprietary solution to be available.
@djh A bit of context: Killing the app doesn't mean the insulin pump will stop working, it will just revert to its default behavior (so the same as it was doing without AndroidAPS). A lot of people (like myself) resort to open-source solutions like this because manufacturers give us very little control over our own medical devices, so sure, ideally this wouldn't be running on a smartphone, but the official proprietary solutions (if there even is one available for you depending on insurance/country/whatever)...
Jonas Köritz

@djh thats bad product design, but Samsung is to blame as well, they're just bad at doing Android the right way imo.

your auntifa liza 🇵🇷 🦛 🦦

@jonas @djh samsung used to be good until it was not. nowadays, it's just plain awful.

Camerondotca

@djh wouldn't an insulin pump be a class one medical device under FDA regulations? Like.. erm.. wtf?

Resuna

@djh “AAPS is an open source app for people living with insulin-dependent diabetes that acts as an artificial pancreas system (APS) on Google Android smartphones.”

androidaps.readthedocs.io/en/l

DELETED

@djh @leafless …you’d think an insulin pump would have all the mission-critical stuff simply on-board, with all the smartphone integrations as an optional extra.

(The latter carefully firewalled off.)

Dr. Claire Le Goues

@djh Android APS is an open source/patient-and-advocate-driven project. So…no approval involved, really. There’s a very long history here that I (pump wearing T1D) don’t know all the details of about unbelievably frustrating FDA/regulatory foot dragging on approving innovations in closed loop pump technology. The most specific early precipitating example was probably European regulators approving the first Medtronic Guardian system something like five+ years before the US did.

Dr. Claire Le Goues

@djh they’ve basically caught up (and in fact IMO have possibly swung a bit too hard), but it contributed to a trend of T1D-adjacent folks hacking the available technology to DIY their own closed loop pumps. I have the impression that the movement led to embarrassment at the FDA, amping the pressure to figure their shit out when it comes to approving pump software innovations (like official closed loop stuff, which has been an astonishing game changer in T1D management over the last <5 years).

Dr. Claire Le Goues

@djh (sorry, you didn’t really ask for a walk through recent socio-technical-regulatory history viz a viz type 1 diabetes medical equipment, but I felt like just saying “AAPS is open source” without at least SOME context was only gonna be more confusing…)

Ian Holmes

@djh @clegoues I appreciate the overview! My SO is a T1D so I knew a lot of this, but your thread still added a lot to what I knew, so thanks!

Floaty Birb

@djh oh god no do not make the insulin pump depend on an app

delProfundo

@djh 👀 what the (and I can’t stress this enough) the actual.

C.

@djh

It never should have made it past a design review, let alone prototyping, testing, pre-production...

#fail #tech

Phil Stevens

@cazabon @djh I'd be a lot more comfortable with open source code running on an Arduino.

Qole

@djh The Tandem t:slim x2 has the app built into the pump, which is why we chose it. Medical device software needs to run on medical device hardware. But I understand why some people would hack their systems to do this with unsanctioned hardware, because the benefits are amazing.

Twobiscuits

@djh somebody doing diy insulin pump control is kinda outside the approval process anyway ...

DELETED

@djh it absolutely hasn’t been approved - this is the result of a power user who has hacked their insulin pump to work without their intervention in response to a third party app on their phone that acts as an intermediary.

one of the top things i was taught when i was on an insulin pump is to always be prepared for it to stop working. batteries die, cables get caught, accidents happen. once i ended up in hospital because the cannula that was stuck in my stomach had bent on insertion and i kept trying to correct high sugars with the pump unable to actually deliver the insulin. this is without any kind of app interface, by the way.

in approved app based systems that work with continual glucose monitoring (cgm) you would simply get a phone alert of your high sugars and then must choose yourself to give an appropriate dose of insulin using your pump. if the sensor loses connection you might not get an alert, which is why even those of us who have sensors still carry test strips.

@djh it absolutely hasn’t been approved - this is the result of a power user who has hacked their insulin pump to work without their intervention in response to a third party app on their phone that acts as an intermediary.

one of the top things i was taught when i was on an insulin pump is to always be prepared for it to stop working. batteries die, cables get caught, accidents happen. once i ended up in hospital because the cannula that was stuck in my stomach had bent on insertion and i kept trying...

ariels

@djh #T1D myself. Of course, and of course this one is a system built from multiple parts with no certification. I actually considered setting up such a system for myself a few years back. It's the uncommon cases that made me back off.
I don't see it as a software problem, feedback loops are the easy bit. The hard parts are input signal - determining blood sugar levels over time and output - delivering insulin. I have difficulty with both. /...

ariels

@djh /...
Delivery sometimes clogs up - same amount of insulin starts doing much less. And the latest generation of sensors is actually accurate enough for me to depend on them - except for the first few hours. OSS can't fix these component issues, neither can systems engineering. With a more suitable infusion set (one intended for kids) and a current sensor this works well enough, and I'm on a closed loop system now.
../

ariels

@djh /...
Having the controller on the pump is critical: a separate uncoordinated component means that you cannot fail open or closed, only fail. The pump user interface and programmability are awful, I'd ove to replace it. But the complete system is now important. Everything fails, so this is literally vital.

Marcel_Gehlen (he/him)

@djh an app is bad enough, but depending on BT working 100% of the time is somehow even worse

Ilpo

@djh I'm not too familiar with the diabetes apps on android, but AAPS sounds like one of those DIY (or compile IY) diabetes apps that are not exactly approved by the local medical device approval authority.

But people use those anyway because the same QoL improving features they already have are to be released from the insulin pump manufacturer within the next couple of decades :D

Alexander Dyas

@djh Much more this than a problem with the smart phone’s OS.

crepererum

@djh Let's step back a bit here: Why on earth are people running criticial health controls on an android smartphone? This has nothing to do with "proper functionality", but it's the wrong platform for these kinds of apps. Critical apps needs an RT operating system, guaranteed resources, a watchdog, and more. And the pump shouldn't rely on bluetooth in the first place, it's not a protocol for safety critical communication.

Mathias Hasselmann

@crepererum @djh You might cry, but using Bluetooth for safety critical operation is pretty common these days. Well, and considering the poor quality of other safety critical components in such setups, the Bluetooth connection might often be the most reliable part of these systems. We have failed.

Ian Douglas Scott

@taschenorakel
@crepererum @djh
I'm still not even convinced Bluetooth reliability is good enough yet to be a viable replacement for headphone jacks.

But I certainly wouldn't want my life to depend on Bluetooth. And ideally the entire software stack required would be formally verified. Regardless, the safety critical part should be minimal and well tested.

Your life depending on an Android app not crashing or being killed sounds a bit like Therac-25. I guess not much progress has been made.

@taschenorakel
@crepererum @djh
I'm still not even convinced Bluetooth reliability is good enough yet to be a viable replacement for headphone jacks.

But I certainly wouldn't want my life to depend on Bluetooth. And ideally the entire software stack required would be formally verified. Regardless, the safety critical part should be minimal and well tested.

Mathias Hasselmann

@ids1024 @crepererum @djh In the end you work with hard dead lines for safety criticial operation: "If no packet, no hearthbeat received within X milliseconds, assume the physical emergency stop button has been pushed". Exactly same code path. If you don't get the physical emergency stop button right, you are doomed anyway.

Escaping Galt's Gorean Gulch

@crepererum @djh yes, but that is all that people are being offered or able to afford.

This is a systemic problem. Not a moral failing of someone who needs to take insulin.

F4GRX Sébastien

@djh tbh using an android phone to automate what should be running on a RTOS inside the device is kind of a bad idea.

LisPi

@f4grx @djh That is also true. For automatic readout collection or something it makes sense to use a computer that can fail, but for something that *cannot be allowed* to fail, it really doesn't.

koehntopp ~ :

@djh
That takes threat modelling to a new level.

(Having said that, maybe you don't want to rely on electronic toys for stuff that might kill you. There are many other ways this could have happened)

Sven-Ola Tücke ✌

@djh
Maybe programming is simply wrong. To do things regularly, use developer.android.com/referenc instead of continuous running as background task

petur 🔵😶

@sven_ola @djh OTOH the post mentions Samsung; I use a location tracker at a set interval on several phones and on a Samsung (A33) it gets completely killed every once in a while. It's as if the app never ran.

Deadly Headshot

@djh I've been told that the ability to GPS-tag photos taken with Sony cameras using their app (the camera links to the phone) is similarly affected by this issue, so the camera disconnects every few minutes; but this post is a far more dangerous result of the problem!

Cegorach

@djh why would you even THINK about controlling something that important by your phone?

That said: this is bad for non-stupid-usage too. Like having things monitor the network.

Thing is, vendors still don't take smartphone OSes serious. It's toys to them!

If your desktop OS would randomly kill processes, you'd get rid of it sooooo fast.

Martin Kelly

@djh I wouldn’t rely on Samsung software to wipe my arse. wish their failings were more widely known

Noxy 🐾

@djh I'm gonna guess this isn't an FDA approved medical device...

Procrasturbate

@djh whilst Android OEMs doing stupid things (Samsung) annoys me no end… but holy cow this isn’t a problem with Samsung. This is a problem with the equipment manufacturer itself relying on a consumer smartphone for critical medical functionality.

Sure, have a configuration interface on a phone. But the logic should be fully handled on the medical equipment and should definitely fail in a safe way.

DELETED

@djh

I have a similar problem with my dexcom which works with my omnipod (insulin pump). Whatever the phone is doing now when an alarm goes off, it shuts my phone down. Doesn't matter if it is completely charged, it shuts down. When it starts back up, it turns the dexcom off. The only time it stays on when an alarm goes off is if the phone is plugged in

rehacked.substack.com Dainius

@djh I suspect this is more Samsung issue than Android. I had pure Android phones, now using Samsung and the bs with constant "optimisations" are very annoying here in Samsung.

Kevin Karhan :verified:

@djh Thanks for reminding me to never trust any #MedicalIT and to keep @internetofshit - Style stiff from my body.

Cuz that's literally a way one could kill a person!!!

author_is_ShrikeTron🔠💉x6

@djh Time to run the Android app on a PC emulator. Then no power-saving shenanigans. Either #BlueStacks or Win11.

Doesn't get you away from multiple OS shenanigans, nor the ridiculousness of running critical logic on Android, but better than relying on a phone device whose entire purpose is to shut itself off.

Jennifer Moore

@djh

Nothing remotely as important as an insulin pump, but this makes sense of one of my apps not working properly, so thanks for sharing!

Green Roc Thoughts

@djh How scary! An app killing software that could literally kill someone.

and I wanna scream out to the makers of these automated things, let me customize my own tech, a life may depend on it... and in this case, a life literally does.

Go Up