They are sensors. If you look into the sensors when there is bright enough light hitting the phone, you see 2 of them. AFAIK, 1 is the light sensor used for detecting when to dim the backlights and the other is the proximity sensor used for turning the screen on/off when it is next to your face. I'm sure there are probably other uses too. I'm guessing the proximity sensor is used if you have the 'in pocket detection' turned on