Today, cellphone has two cameras. Front camera and back camera. Front camera usually used to take self photo and video call. Back camera used to take far object like people or buildings. The front camera and back camera are basically same things. They convert visible lights to electrical signals. So, why we should use two cameras in a single cellphone that the difference is only the direction that photo taken? Using single camera that can be directed to back or front can reduces the production cost. It's only use a single image sensor. So whether it comes from back or front, it will shot in the same resolution and other quality parameters.
I use mirror M to direct the image sensor to capture photo from back or front. At the end of mirror, I use ferromagnetic material to move the mirror. Doors that close and open lenses are made from ferromagnetic material too. They can be closed by magnet pulls and opened by spring.
When we want to shot from front, magnet A and D are activated and magnet B and C are deactivated. By doing this, the mirror M is directed to the front. The magnet E is deactivated so the light can comes in from front side and the magnet F is activated to prevent interference from the back side.
When we want to shoot from the back, magnet B and C are activated and magnet A and D are deactivated. By doing this, the mirror M is directed to the back. The magnet F is deactivated so the light can comes in from back side and the magnet E is activated to prevent interference from the front side.