Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Source code for Android location provider packages [closed]

I am trying to find android source code for its network_provider implementation. So far, I traced into com.android.server.location.LocationProviderProxy and found it loads packages from a list of location provider package names. The package name is supposed to be in com.android.internal.R.array.config_locationProviderPackageNames, which I can not find in com.android.internal.R.array on the Android Javadoc website.

Where are those packages and their source codes?

like image 318
windchime Avatar asked Oct 18 '25 13:10

windchime


1 Answers

The package names are defined in /frameworks/base/core/res/res/values/config.xml:

<string-array name="config_locationProviderPackageNames" translatable="false">
    <!-- The standard AOSP fused location provider -->
    <item>com.android.location.fused</item>
</string-array>

And if you're looking for the source for the fused location provider itself, you can find that on grepcode here or googlesource here.

If you're looking for the network location provider, it seems the source code for that is no longer available. Quoting a message by Mike Lockwood from the Google android team:

The network location provider used to be in the open source, but has since been removed. We did this because we want the core android framework to be independent of any Google's services. We were also concerned that someone might ship a phone that uses network location without informing the user of its existence. Since it does communicate the user's location to our servers, we want to ensure that it is strictly an opt-in service and the users are made aware of our privacy guidelines. So now we only make NetworkLocation.apk available in binary form to partners that agree to follow our guidelines on how it is used.

As for finding old versions of the network location provider, I would suggest a google search for NetworkLocationProvider.java. I didn't see anything that looked particularly authoritative, but the first result was from netmite.com.

If you're specifically interested in the code that communicates with the Google Location Service backend, though, you should probably look at the LocationMasfClient class, which you can see here.

like image 121
James Holderness Avatar answered Oct 20 '25 04:10

James Holderness



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!