But in Android, apart from default doze, battery optimisation feature, each manufacturer implement their own aggressive app killing services and so managing background tasks becomes very hard. At least in recent versions of Android, app developer can navigate the user to disable battery optimisation for their app if needed, which would affect default system behaviour but out of luck if the manufacturer implements their own app killer.
Unfortunately, I didn't see any of the contact tracing apps of several countries explicitly asking users to disable battery optimisation/app killers or whitelist bg task permission for their apps and I think that's one of the main reasons for the supposed failure of contact tracing apps.