Editor's note: Amy Gahran writes about mobile tech for CNN.com. She is a San Francisco Bay Area writer and media consultant whose blog, Contentious.com, explores how people communicate in the online age.

(CNN) -- If you get arrested in California, better hope there are no incriminating texts or e-mails or sensitive data stored on your phone.

On Monday, the California Supreme Court ruled that police in that state can search the contents of an arrested person's cell phone.

Citing U.S. Supreme Court precedents, the ruling contends that "The loss of privacy upon arrest extends beyond the arrestee's body to include 'personal property ... immediately associated with the person of the arrestee' at the time of arrest."

Two justices (Kathryn Mickle Werdegar and Carlos Moreno) dissented from the majority opinion: "In light of the vast data storage capacity of smartphones and similar devices, the privacy interests that the federal Constitution's Fourth Amendment was intended to protect would be better served by a rule that did not allow police to rummage at leisure through the wealth of personal and business information that can be carried on a mobile phone or handheld computer merely because the device was taken from an arrestee's person."

In a blog post, Ohio attorney Patrick Murphy summarized the California case that led to this ruling:

In 2007 a Ventura County Deputy Sheriff witnessed a drug deal involving a car driven by Gregory Diaz. Diaz and his passenger were immediately arrested, and six Ecstasy pills were seized. At the police station, Diaz's phone was confiscated. Diaz denied knowledge of or involvement in the drug deal.

After Diaz was interviewed by police, Murphy writes, the deputy "looked at the cell phone's text message folder and discovered a message that said '6 4 80' -- which in the deputy's experience meant 'Six pills of Ecstasy for $80.' Minutes later [the deputy] confronted Diaz with the text message, at which time the suspect admitted to participating in the sale of Ecstasy."

But this ruling is not limited to text messages.

The ruling allows police in California to access any data stored on an arrestee's phone: photos, address book, Web browsing history, data stored in apps (including social media apps), voicemail messages, search history, chat logs, and more. Also, depending on the use of location-enabled services or apps that store data on the phone, the police might also be able to infer the arrestee's past whereabouts.

What if access to your phone is locked with a security code or pattern?

According to Catherine Crump of the American Civil Liberties Union, "The police can ask you to unlock the phone -- which many people will do -- but they almost certainly cannot compel you to unlock your phone without the involvement of a judge," she said. Also, she noted that so far it's legally unresolved whether police can copy data from an arrestee's phone for future examination.

Depending on who's getting arrested, and for what, warrantless searches of cell phone data could have wide-ranging potential to implicate not just the arrested person, but also to draw police attention to other people who might be involved (or merely associated) with the arrestee.

That might sound reasonable for investigations involving street crime, but what about for people who are arrested during protests and demonstrations?

Expect the California ruling to be challenged -- perhaps in the U.S. Supreme Court. The San Francisco Chronicle reports, "This issue has divided other courts. U.S. District Judge Susan Illston of San Francisco ruled in May 2007 that police had violated drug defendants' rights by searching their cell phones after their arrests.

"The Ohio Supreme Court reached a similar conclusion in a December 2009 ruling in which the state unsuccessfully sought U.S. Supreme Court review. The Ohio-California split could prompt the nation's high court to take up the issue."

The opinions expressed in this post are solely those of Amy Gahran.