During iFixit's teardown of the iPhone 4S, the site came across a component that it couldn't immediately identify. After subsequent testing, iFixit has determined that the iPhone 4S has an infrared LED that acts as a secondary proximity sensor, and its functions appear to be tied directly to Siri.
All earlier models of iPhones have had a proximity sensor designed to shut the handset's touchscreen off when you r