There are special phone cases/holders designed for that. I'm pretty sure Google will sell those too. Not to mention this might be a camera recording the driver-distraction and not the road. So it doesn't have to be in the sun. Or even for passengers in a driverless car
That seems like it might be reasonable feature to be built in to vehicle, but I can't imagine many people who are that prone to distracted driving to take the time set up such a feature every time they drive.