As can be read in the report by Google WWatch blog, it was now possible to detect a new protective function in a commit of the Android project, apparently for monitoring the access of apps to the camera functions of the device. According to the description, this ensures that only apps which are currently running in the foreground and with which the user interact get access to the camera.
Thus, with the next major Android update, all apps that are idle are excluded from access to the camera, so they run in the background for a certain period of time. This measure is intended to reliably prevent spying applications and other malicious software from being able to access the camera functions unnoticed.
The implementation takes place directly in the system. If an app is moved to the background, this feature will produce an error as described and the camera will close for this application. If another attempt is made to access the camera in idle mode, another error is generated immediately. “Because apps should be able to handle these errors right now, these policies can be applied to all applications to protect users’ privacy,” said the developers. Whether this feature will land in the finished version of Android P, of course, is not confirmed yet.