Despite some police groups' opposition, the California Senate approved legislation requiring law enforcement to obtain a warrant or wiretap order before searching individuals' electronic devices, the LA Times reports.

On Wednesday, the bill (SB-178) passed the Senate in a 39-0 vote, marking a small victory for tech firms such as Apple and Google, which backed the California Electronic Communications Privacy Act (CalECPA) alongside the American Civil Liberties Union (ACLU) of Northern California, the article said. The bill will now head to the California State Assembly for consideration.

CalECPA prohibits “a government entity from compelling the production of or access to electronic communication information or electronic device information” without a search warrant or wiretap order, except in emergencies, the legislation said.

Organizations that have publicly opposed CalECPA include the California Police Chiefs Association (CPCA) and the California State Sheriffs Association (CSSA).