Android P will refuse the camera to access the background application
The restrictions are based on the application’s user ID (UID) that Android assigns to each application installed on the device. UIDs are unique to each application and as long as these apps remain on your device, these UIDs will not change. The submission status indicates that Android P will detect when the UID is “idle,” and if an inactive UID is requested for camera access, an error will be immediately generated to prevent access to the camera.
Previous Android 8.0 requires the application to display notifications when using the camera on its own initiative. Therefore, Android P camera restrictions can be seen as an extension of existing measures. This feature is a good deterrent to malicious applications that silently record video or take pictures without their knowledge.