The US Justice Department has entered an agreement with the Antioch, California, police department, which will end an investigation into racist text messages sent and received by its officers.