Today, mobile phones use IR-based proximity sensors to detect the presence of a human ear. This sensing is done for two purposes: to reduce display power consumption by turning off the LCD backlight and to disable the touch screen to avoid inadvertent touches by the cheek.
Photo “New VCNL4000 Proximity and Ambient Light Optical Sensor” by Vishay Intertechnology is licensed under CC BY 2.0