Having an iPhone doesn't stop Google handing over your data to the police, according to a New York Times investigation.

Apple has long touted itself as more privacy-conscious than competitors like Google, and even opposed the FBI over a case it said would set a "dangerous precedent" for user privacy.

But the Times found that Google is giving law enforcement data from both Android devices and iPhones when requests are granted.

Apple told the Times that it doesn't have the ability to furnish law enforcement with data in the same way as Google.

Visit BusinessInsider.com for more stories.

A New York Times investigation into how Google furnishes law enforcement with phone data exposed one crucial detail — having an iPhone doesn't stop Google handing over your data.

The in-depth investigation by the Times revealed many details about how Google uses its in-house database — called Sensorvault — to cooperate with law enforcement.

Using the database, Google is able to provide police with the data of phones from a specific time and location. By submitting "geofence" warrants, police are able to look at which phones were in close proximity to a crime. According to a Google employee, the firm once received as many as 180 of such requests in one week.

The data attached to each phone is initially anonymous, then once police have whittled down the number of suspect devices, Google provides them with the names of the people each device is associated with.

The technology has been praised as a useful tool for law enforcement, but the Times piece calls into question whether its powers are too sweeping, especially in the case of innocent people's data.

Former Google employee Brian McClendon who oversaw Google Maps until 2015, told the Times the method seemed to him "like a fishing expedition."

iPhones are findable in Google's database

An intelligence analyst, who has himself examined the data from hundreds of phones, told the Times that it wasn't just Android users who had their information examined by law enforcement. He said "most Android devices" and "some iPhones" had their data made available by Google.

Investigators told the Times that they hadn't sent the warrants to any other companies apart from Google, and Apple said it didn't have the ability to perform the same kind of searches.

Read more: Apple News won't let advertisers track users or monitor what they read

It is not clear from the Times' piece exactly how Google was able to provide law enforcement with the data of iPhone users, although it seems possible that it was able to do so through installed Google services, such as Google Maps.

Apple was not immediately available for comment when contacted by Business Insider.

Apple has a history of locking horns with law enforcement

Apple famously refused to help the FBI break into the phone of Syed Rizwan Farook, a perpetrator of the 2015 San Bernardino shooting, which left 14 people dead. Farook was shot dead by police.

Apple CEO Tim Cook published an open letter in 2016, saying that the FBI's request for Apple to build a new version of its iOS operating software to break into Farook's phone would not only create a weakness exploitable by hackers, but that it would set a "dangerous precedent."

Apple CEO Tim Cook. Getty

"The government could extend this breach of privacy and demand that Apple build surveillance software to intercept your messages, access your health records or financial data, track your location, or even access your phone’s microphone or camera without your knowledge," Cook wrote.

Privacy remains a major marketing point for Apple, which it flaunts at Google's expense. At CES this year, Apple mocked Google with a huge poster which read: "What happens on your iPhone, stays on your iPhone." Last month, the company released a video ad with the tagline: "If privacy matters in your life, it should matter to the phone your life is on."

Read more: Apple released a 45-second video on why you should care about your smartphone's privacy

Google's cooperation with law enforcement is not blind. It requires a warrant, and officials told the Times that Google has pushed back on searches it considers overly broad.

"We vigorously protect the privacy of our users while supporting the important work of law enforcement," Google's director of law enforcement and information security, Richard Salgado, said in a statement sent to Business Insider.

"We have created a new process for these specific requests designed to honor our legal obligations while narrowing the scope of data disclosed and only producing information that identifies specific users where legally required."

Equally, Apple does not always refuse requests from law enforcement for user data. "When the FBI has requested data that's in our possession, we have provided it," Cook wrote in his 2016 letter.