The deal has been reached during a California federal court trial over claims brought by 29 states.