The new "feature" you've said is actually "something normal all the time" form Android 4.0 +. This is something you can have on AOSP. What you want is actually something "dirty" made by the device manufacturer, which is a nightmare for Android developers. Those manufacturers don't follow the Android standard and prevent the software to be triggered under some circumstances, this breaks the functionality of the app.
For example, using the Android
WorkManager can register a worker with a scheduled task. Developers can assign the task to be executed at a specific time or every a period of time. The WorkManager is a wrapper for
Jobscheduler and
AlarmManager. Depending on the Android OS version, the WorkManager automatically choose to use one of the above methods to run the scheduled task. If an app registers a
PeriodicWorkRequest and assign it to execute every 2 hours, even the app is closed, the
PeriodicWorkRequest still can be triggered and revives the app every 2 hours. The nightmare for developers is that OPPO, Xiaomi...etc, these manufacturers prevent the scheduled tasks to be executed if the app is closed(Hall of shame). They are not following the Android standard, so apps can not behave as expected. It is totally different from the documentation at
developer.android.com, but every manufacturer is doing this under the excuse of battery optimization, so many users think this is normal. However this is actually some nasty customization to the OS made by the manufacturer to break many apps on the device. That's why apps with background services, such as, Tasker, Bitwarden can not work correctly on many devices if they're not excluded in battery optimization management apps made by the manufacturer.
Almost every Android developer has to tell users to visit
https://dontkillmyapp.com/, because Chinese manufacturers like to kill app services and break all the apps with background services. And finally now Google is introducing
CTS-D, to tell devs about how background services work on the device. I guess this is why things are finally moving back to normal in Android 13.
#The page
https://dontkillmyapp.com/ is a website made by developers to teach users to whitelist apps after receiving a lot of complaints about apps not working correctly. Thanks to those manufactures created this mess.