; (B) any communication to or from an unmanned aircraft system or unmanned aircraft is intercepted or acquired only to the extent necessary to support an action described in subsection (e); (C) any record of a communication described in subparagraph (B) is maintained only for as long as necessary, and in no event for more than 180 days, unless the Secretary, the Attorney General, or the head of a State, local, Tribal, or territorial law enforcement agency designated under subsection (d)(2) determines that maintenance of the record is— (i) required to be maintained under Federal, State, local, Tribal, or territorial law; (ii) necessary for the purpose of any litigation; or (iii) necessary to investigate or prosecute a violation of law, including by— (I) directly supporting an ongoing security or protection operation; or (II) protecting against dangerous or unauthorized activity by an unmanned aircraft system or unmanned aircraft; and (D) the communication is not disclosed outside the agency or entity unless the disclosure— (i) is necessary to investigate or prosecute a violation of law; (ii) would support the Department of Defense, a Federal law enforcement, intelligence, or security agency, or a State, local, Tribal, or territorial law enforcement agency; (iii) would support the enforcement activities of a Federal regulatory agency in connection with a criminal or civil investigation of, or any regulatory, statutory, or other enforcement action relating to, an action described in subsection (e); (iv) is to the Department or the Department of Justice in the course of a security or protection operation of either the Department or the Department of Justice, or a joint operation of the Department and Department of Justice