As far as I know, since Android 12 an app needs to have a Foreground Service Worker (with an active permanent notification) to run in all the time without being stopped when no activity is in foreground. The guide to background work also states that the only real alternative is to use scheduled tasks. My question is, can those tasks initiate microphone recording and most importantly, will this be visualized in the notification bar so the user would spot the recording?
I know that it is possible to achieve the same level of spying with permanent location tracking permissions, but I'm pretty sure nothing of the kind exists for microphone permission. How strict is Android in this regard? Will an app stop recording as soon as no Activity is in the foreground? Can the app bypass this limitation if it has full device management permissions?
My current research tells me that background recording is impossible since Android 9 and a visual indicator in the right-top corner is shown when any recording is active since Android 12. I would love to get more insight in the specifics.
In this regard, I do not want to discuss the possibility of zero day exploits, but de-facto working methods that spy-ware can make use of in the Android threat model.