Prominent privacy advocate and Apple executive Andreas Gal has teamed up with the ACLU on a lawsuit against the federal government concerning invasive practices by Customs and Border Patrol.

Gal writes in a Medium post about an incident in December in which he — a Hungarian immigrant and naturalized U.S. citizen who uses Global Entry to travel frequently — was directed by a Global Entry kiosk to a secondary inspection. He was detained by armed Customs and Border Patrol (CBP) agents, questioned about his former work for Mozilla and his travels, and ordered to unlock his laptop and cellphone for guards to search.

Gal was taken aback, and says that he wasn't sure what his responsibilities to Apple might be given that he had proprietary, unreleased software and other information on his devices — and he had signed a non-disclosure agreement. He requested that he speak to his employer or to an attorney, and he writes, "This request seemed to aggravate the customs officers. They informed me that I had no right to speak to an attorney at the border despite being a U.S. citizen, and threatened me that failure to immediately comply with their demand is a violation of federal criminal code 18 USC 111." Gal stood his ground and ultimately was allowed to leave with his devices, however CBP kept his Global Entry card as punishment.

Reportedly, such aggressive questioning and detainment of American citizens at the border is becoming increasingly, disturbingly common. Gal cites this NBC News report from last month that CBP agents under the Trump administration now have a dossier of American journalists, activists, and attorneys whom they are ordered to submit to intense questioning if they are trying to cross the border back into the U.S.

Now, the ACLU has filed a civil rights suit against the federal government over what they say was Gal's unlawful detention at SFO in December. Also as KPIX/CBS SF reports, the suit demands an investigation of CBP search policies and a comprehensive review of those policies.

"CBP’s baseless detention and intrusive interrogation of Andreas Gal and the attempted search of his devices violated his Fourth Amendment rights," says William Freeman, ACLU of Northern California Senior Counsel, in a statement published Tuesday. "Furthermore, CBP’s policies lack protections for First Amendment rights by allowing interrogation and device searches that may be based on a traveler’s political beliefs, activism, nation of origin, or identity."

The ACLU further says in the statement, "The attempted unconstitutional search of Gal’s devices illustrates that CBP’s policies do not include the requirements necessary to safeguard the constitutional rights of people at the border."

Previously: ACLU Files Lawsuit Against Trump On Behalf Of Three Middle Eastern Students