A system containing an ambient light and a proximity sensor with intrinsic ambient light rejection