Phones (Google Pixels at least) use sensor data from inertial sensors and slight hand movement as part of their depth calculation: https://research.google/pubs/depth-from-motion-for-smartphon...
I do not believe this technique is used for photographs.