The ACLU of Northern California is challenging a police search of a suspect's cellphone after his arrest, saying it violated his civil rights and those of his friends and contacts.

The group, an affiliate of the American Civil Liberties Union, sued the city and county of San Francisco and its police chief on Wednesday in a case involving Bob Offer-Westort, a protestor who was arrested in January 2012. Right after Offer-Westort was arrested, a police officer started looking through the text messages on his phone and reading them aloud, the Northern California ACLU said in a press release. The police hadn't obtained a warrant for the search.

That violated Offer-Westort's rights to privacy, free speech and freedom from unreasonable search and seizure, as well as the rights of the people he communicated with on his phone, the civil rights group said in a press release. It filed suit in the California Superior Court in San Francisco.

As users store more data and communications on their smartphones, controversy over law enforcement's treatment of the devices has grown. California's Supreme Court ruled in 2011 that police don't need a warrant to search a phone that a suspect is carrying at the time of an arrest. In its suit on Wednesday, the ACLU said law enforcement does need a warrant, citing the California and U.S. constitutions.

Offer-Westort was arrested after pitching a tent as part of a civil-disobedience protest against a proposed law that would unfairly target homeless people, the ACLU said. After the arrest, when the police officer started reading his text messages out loud in public, Offer-Westort was worried that his relationships as a community activist could be damaged if his private text messages were made public.

The civil-rights group argued that cellphones can contain private data, including social media accounts and information about health and finance, that police should not be able to see unless they have a good reason. To get a search warrant, police would have to persuade a judge that the search was justified.

"Cell phones today are virtual home offices," and a phone search should be treated the same way as a home search, attorney Marley Degner of the firm Pillsbury Winthrop Shaw Pittman said in the press release. The firm is providing pro bono assistance to the ACLU.

The California Supreme Court decision in 2011 found that a warrantless phone search didn't violate the Fourth Amendment to the U.S. Constitution, which is intended to protect against unreasonable searches and seizures. In Wednesday's suit, the ACLU said the California Constitution provides stronger guarantees of privacy and freedom from unreasonable searches.

The group also cited the U.S. Constitution's First Amendment guarantees of free speech and association. The ACLU argues people should be free to communicate using their cellphones without police virtually listening in.

San Francisco officials were not immediately available for comment on the suit.