The debate over whether Apple should defeat the security on the iPhone of San Bernardino shooter Syed Rizwan Farook isn't the first time the company has clashed with law enforcement.
The FBI also wanted to get into the iPhone of a drug dealer in Brooklyn. Jun Feng pleaded guilty to selling methamphetamine last year. As part of its investigation, the government obtained a search warrant for Feng's iPhone. But the phone was locked by a passcode, so prosecutors asked a judge for an order compelling Apple to bypass it.
"In about 70 prior occasions, this exact situation had occurred," says Susan Hennessey, a former National Security Agency lawyer who's now a fellow at the Brookings Institution. "And Apple had elected to comply with the court order."
The fact that Apple had bypassed the lock on roughly 70 phones in previous cases was revealed during a court hearing last October.
And Apple might have quietly done the same to Jun Feng's phone, too, but something unusual happened. Federal Magistrate Judge James Orenstein did not sign the order the government wanted. Instead, he went public and asked Apple if the company had any objections.
"What was remarkable was that the public hadn't seen the argument surfaced," says Jennifer Granick at the Stanford Center for Internet and Society. She says Judge Orenstein was trying to stoke a public debate. "Judge Orenstein had concerns about whether the government's legal argument was a valid legal argument."
The judge seemed particularly skeptical that the government relied in part on an 18th-century law called the All Writs Act. Prosecutors say it gives them authority to compel private companies to help carry out search warrants.
The government probably expected Apple to comply, just like the company had dozens of times before, says Hennessey.
"What All Writs is intended to do is that in those areas where Congress has not spoken, it's intended to fill the gap, such that the courts can effectuate their orders," Hennessey says. "This is precisely how All Writs has been applied throughout history."
But this time, lawyers for Apple disagreed. They said the company had complied when the law seemed settled, but at the hearing in Feng's case in October, Apple's lawyers argued that the government was actually asking for something novel: the power to force a tech company to break the security on one of its devices.
It's similar to the argument that's now playing out in California, where the FBI wants Apple to defeat the security on Farook's iPhone.
"The cases are different, but the underlying legal question is very similar," says Alex Abdo, a lawyer with the American Civil Liberties Union. "The question in the New York case is whether the government can rely on this very old statute to conscript Apple into government service."
There are some key differences between the two cases. The defendant's iPhone in New York was using an older operating system, iOS 7, which makes it relatively easy for Apple to bypass the lock. The iPhone in California is running Apple's newer operating system, iOS 9, and the company says it would have to create software just to get into the phone. Abdo says that's a conscious choice by Apple.
"They didn't want to be in the position, they told the court, of having to serve as a government investigative agent," he says. "They wanted to be out of the business of spying on their customers."
That may be especially important to Apple in international markets, where security is a big selling point. But U.S. law enforcement is frustrated by that argument. Federal prosecutors say Apple is putting its own public relations interests ahead of national security.
They think Apple could easily defeat the security on the phones in California and Brooklyn — just like it's done 70 times before.