SAN FRANCISCO – Yasir Afifi, a 20-year-old computer salesman and community college student, took his car in for an oil change earlier this month and the mechanic spotted an odd wire hanging from the undercarriage.

The wire was attached to a strange magnetic device that puzzled Afifi and the mechanic. They freed it from the car and posted images of it online, asking for help in identifying it.

Two days later, FBI agents arrived at Afifi’s Santa Clara apartment and demanded the return of their property — a global positioning system tracking device now at the center of a raging legal debate over privacy rights.

One federal judge wrote that the widespread use of the device was straight out of George Orwell’s novel, “1984.”

“holding that this kind of surveillance doesn’t impair an individual’s reasonable expectation of privacy, the panel hands the government the power to track the movements of every one of us, every day of our lives,” wrote Alex Kozinski, the chief judge of the 9th U.S. Circuit Court of Appeals, in a blistering dissent in which a three-judge panel from his court ruled that search warrants weren’t necessary for GPS tracking.

But other federal and state courts have come to the opposite conclusion.

Law enforcement advocates for the devices say GPS can eliminate time-consuming stakeouts and old-fashioned “tails” with unmarked police cars. The technology had a starring role in the HBO cops-and- drug dealers series “The Wire” and police use it to track every type of suspect — from terrorists to thieves stealing copper from air conditioners.

That investigators don’t need a warrant to use GPS tracking devices in California troubles privacy advocates, technophiles, criminal defense attorneys and others.

The federal appeals court based in Washington, D.C., said in August that investigators must obtain a warrant for GPS use in tossing out the conviction and life sentence of Antoine Jones, a nightclub owner convicted of operating a cocaine distribution ring.

That court concluded that the accumulation of four weeks of data collected from a GPS on Jones’ Jeep amounted to a government “search” that required a search warrant.

Judge Douglas Ginsburg said watching Jones’ Jeep for an entire month rather than trailing him on one trip made all the difference between surveilling a suspect on public property and a search needing court approval.

“First, unlike one’s movements during a single journey, the whole of one’s movements over the course of a month is not actually exposed to the public because the likelihood anyone will observe all those movements is effectively nil,” Ginsburg wrote. The state high courts of New York, Washington and Oregon have ruled similarly.

The Obama administration last month asked the D.C. federal appeals court to change its ruling, calling the decision “vague and unworkable” and arguing that investigators will lose access to a tool they now use “with great frequency.”

After the D.C. appeals court decision, the 9th Circuit refused to revisit its opposite ruling.

The panel had concluded that law enforcement agents could have gathered the same information by personally following Juan Pineda-Moreno, who was convicted of marijuana distribution after a GPS device alerted agents he was leaving a suspected “grow site.”

Legal scholars predict the U.S. Supreme Court will ultimately resolve the issue since so many courts disagree.