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.
https://assets.chaos.social/media_attachments/files/111/181/847/404/556/040/original/03c033549747252e.png