Fourteen years ago the Supreme Court interrupted a string of law-enforcement victories to rule that, when looking for illegal drugs, the police couldn't simply walk down the aisle of an intercity bus and squeeze the bags and soft-sided luggage on the overhead rack.

This common tactic amounted to an unconstitutional search, Chief Justice William H. Rehnquist wrote for the 7-to-2 majority in Bond v. United States. While passengers certainly expect that their luggage "may be handled," the chief justice wrote, that expectation didn't extend to supposing that anyone "will, as a matter of course, feel the bag in an exploratory manner."

I remember puzzling over that decision. In one opinion after another, most written by Rehnquist, the Supreme Court had been allowing the police to write their own ticket when it came to detecting drug trafficking. Why draw the line at a duffel bag on a Greyhound bus?

Eventually it occurred to me: The justices were passengers too. Not on buses, for sure, but on Amtrak or the shuttle, and they found the notion that anyone with a badge could start randomly feeling up their carry-ons was deeply distasteful.

In another search case only three months earlier, all nine justices agreed that flight at the mere sight of a police officer could raise enough suspicion to justify the police in conducting a warrantless stop-and-frisk. That case, Wardlow v. Illinois, was another Rehnquist opinion. Would it occur to any Supreme Court justice to take off running down a Chicago street in broad daylight, as Sam Wardlow did when he saw four squad cars approaching the spot where he stood? Not likely.

I'm oversimplifying, of course. The Fourth Amendment's prohibition of unreasonable search and seizure has given rise to a complex body of law, dense with precedents that can be maneuvered in just about any direction. Perhaps the most remarkable aspect of the Supreme Court's decision in Riley v. Calif., announced on Wednesday, barring warrantless searches of cell telephones was how simple and obvious Chief Justice John G. Roberts Jr., who wrote the 9-0 opinion, made it all sound.

The court's "search incident to arrest" doctrine has a robust history, dating from the late 1960s and early 1970s. In one leading case the police arrested a man for driving with a revoked license, patted him down, fished a crumpled cigarette pack out of his pocket and found 14 heroin capsules inside. The court deemed that search valid. In the case the court decided on Wednesday, Riley v. California, the California Court of Appeal likewise deemed valid the search of a smartphone carried by a man who had been stopped for driving with expired license tags. On the telephone the police found text, photographs and video linking its owner with gang activity, including a shooting.

In the federal government's brief urging the Supreme Court to uphold the California decision, Solicitor General Donald B. Verrilli Jr. told the justices that "cell phones do not raise qualitatively different privacy concerns than items that the police have always had authority to search incident to arrest, such as letters, diaries, briefcases and purses."

Oh, yes they do, Roberts responded: "Cell phones differ in both a quantitative and a qualitative sense from other objects that might be kept on an arrestee's person." He went on at length to describe the differences, noting that a cell telephone can reveal more private information than the search of an entire house. The telephone contains "the sum of an individual's private life," he said, so searching it without a warrant is constitutionally unreasonable.

The chief justice's response to the government's warning that a warrant requirement would impede law enforcement was basically a shrug: "Privacy comes at a cost."

The Roberts court too often has been on the wrong side of history, most pointedly in its retrograde refusal to protect the right to vote. Wednesday was the first anniversary of Shelby County v. Holder, the shameful 5-to-4 decision that undermined the Voting Rights Act. When it comes to technology, however, the court seems free of ideological baggage and is trying hard, collectively, to get it right.

Two years ago the justices ruled, in United States v. Jones, that placing a GPS device on a suspected drug dealer's car in order to monitor his movements for a month was a search. The vote was 9-0, although the rationale was divided. During the argument in that case, the justices seemed taken aback by the government's concession, inherent in its legal theory, that they themselves could be subjected to such an intrusion on their privacy.

"You could tomorrow decide that you put a GPS device on every one of our cars, follow us for a month, no problem under the Constitution?," Roberts asked his one-time colleague in the solicitor general's office, Michael R. Dreeben, who had no choice but to say yes.

I had planned to conclude my discussion of the court and the search cases with a mention of "empathy," the ability to put oneself in someone else's shoes, so often missing from the Supreme Court's criminal-law decisions but perhaps on display here. On reflection, though, it's not really empathy. The justices are walking in their own shoes. The ringing cell telephone could be theirs — or ours.

Linda Greenhouse, a senior fellow at Yale University in New Haven, Conn., covered the Supreme Court for The New York Times from 1978 to 2008.