That black box attached to your 2007 Ford F-150's rearview mirror is most likely the
OnStar module (if your truck was equipped with OnStar) or a similar
telematics control unit. These units handle communication for features like emergency services, remote unlocking, vehicle diagnostics, and possibly navigation (depending on the options your truck had).
It could also *possibly* be a less common aftermarket device, but the OnStar/telematics module is the most likely culprit. If you can provide a picture, I might be able to give you a more precise answer.