No. Modern cameras usually use a combination of contrast detection (pure image analysis checking the contrast of the region you want in focus), phase detection (an optical system where you split the income image in two and then compare them) and sometimes help of some sort of assist lamp.