; (2) communications to or from an unmanned aircraft system are intercepted or acquired only to the extent necessary to support an action described in subsection (b)(1); (3) records of such communications are maintained only for as long as necessary, and in no event for more than 180 days, unless the Secretary or the Attorney General determine that maintenance of such records— (A) is necessary to support 1 or more safety or security functions of the Department of Homeland Security or the Department of Justice, respectively, or to investigate or prosecute a violation of law; or (B) is required for a longer period to support a civilian law enforcement agency or by any other applicable statute or regulation; and (4) such communications are not disclosed outside the Department of Homeland Security or the Department of Justice unless the disclosure— (A) would fulfill a safety or security function of the Department of Homeland Security or the Department of Justice, respectively, or to investigate or prosecute a violation of law; (B) would support the Department of Defense, another civilian law enforcement agency, or the activities of a regulatory agency of the Federal Government in connection with a criminal or civil investigation of, or any regulatory, statutory, or other enforcement action arising out of an action described in subsection (b)(1)