Devices having one or more sensors located outside a viewing area of a touch screen display are disclosed. The one or more sensors can be located behind an opaque
mask area of the device; the opaque
mask area extending between the sides of a housing of the device and viewing area of the touch screen display. In addition, the sensors located behind the
mask can be separate from a touch sensor panel used to detect objects on or near the touch screen display, and can be used to enhance or provide additional functionality to the device. For example, a device having a sensor located outside the viewing area can be used to detect objects in proximity to a functional component incorporated in the device, such as an ear piece (i.e., speaker for outputting sound). The sensor can also output a
signal indicating a level of detection which may be interpreted by a controller of the device as a level of proximity of an object to the functional component. In addition, the controller can initiate a variety of actions related to the functional component based on the output
signal, such as adjusting the volume of the earpiece.