There are cyber threats and attacks lurking at every corner. There’s always a possibility that even your own devices, like your phone, can be hijacked and the camera can spy on you. This is why Google has decided to something about issues like this with Android P.
There were some recently discovered code submissions that showed Android P was capable of preventing idle apps from using both the camera and microphone. For instance, if there was an inactive program tries to use the camera, Android should shut it off and give you an error message. It’s a little different when it comes to the microphone. The Android allows recording but reports empty data until the app is active.
With the recording, certain malware would find it impossible to steal the recording in the background. But, legitimate apps like a voice chat clients, which stay active, will not have any problem. But eager users beware! Google hasn't even announced Android P, so it could take a while. The developers and engineers behind Android P have just one goal in mind: ‘to protect user privacy.’ However, there’s still no guarantee that will stop the snooping around for sure. It’ll definitely require more work, but, users will gladly welcome it.