The threat of someone hijacking your phone's camera to spy on you unawares is sometimes overstated, but it's definitely a possibility. Enough so, in fact, that Google is determined to do something about it. Recently discovered code submissions show that Android P should prevent idle apps from using both the camera and microphone. If an inactive program tries to use the camera, Android should shut it off and give you an error message. With the microphone, it's somewhat different: it'll allow recording but report empty data until the app is active. Malware wouldn't get away with recording in the background, but legitimate apps like a voice chat client (which stays active) shouldn't have an issue.