I believe this is how it works at least in iOS if the mic is used by an app in the background
Anything less than a physical switch that physically enables or disables the camera and microphone is meaningless, since any update to the software or malicious app could just bypass that code.