Though Android P or Android 9.0 is still under development, the talks related to next version of Android are high. Today, one of the Android p security features was leaked on the internet. Most people are expecting that on Android P platform the camera access to the background apps will be removed. This means that the idle background application will no longer be able to use the camera.
In previous versions of Android, idle background apps were able to use the camera without notifying, and you usually overlooked it as well. Needless to say, it is easy to abuse by application developers. Think about it, an app monitoring and recording your everyday movements.
Like said in the above paragraph, this process is really easy to hide by making the camera viewfinder size to 1 pixel. This makes the camera viewfinder almost invisible on your screen, even if your screen is locked. However, some progress has been made on this issue. For e.g: Android 8 forces background applications to display notifications when using the camera. Still, that’s not the complete solution to this problem.
The best way to solve a problem and prevent it from reoccurring is by removing it from the root. Android security feature does the same thing. It disables the camera access for an idle background application. Instead, the app will only access the camera when you will want to use it or when the app is not in the background.
This will reduce the chances of hijacking your phone’s camera to the minimum. For now, we can only advice you to try not installing any unknown app or a suspicious one. Try checking which app has access to your data (contacts, email, camera). Morever, also check which apps are running in the background as well from the settings or a third-party app till you get an of Android 9.0 for your smartphone.
Source, Via (Chinese)