Skip to content

Commit b03c8c5

Browse files
author
Nick Pelly
committed
Add documentation for com.android.location.provider shared library.
Change-Id: I222d61811c88272e84a85512623210c0238337e5
1 parent 4e31c4f commit b03c8c5

File tree

5 files changed

+61
-13
lines changed

5 files changed

+61
-13
lines changed

location/lib/README.txt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
This library (com.android.location.provider.jar) is a shared java library
2+
containing classes required by unbundled location providers.
3+
4+
--- Rules of this library ---
5+
o This library is effectively a PUBLIC API for unbundled location providers
6+
that may be distributed outside the system image. So it MUST BE API STABLE.
7+
You can add but not remove. The rules are the same as for the
8+
public platform SDK API.
9+
o This library can see and instantiate internal platform classes (such as
10+
ProviderRequest.java), but it must not expose them in any public method
11+
(or by extending them via inheritance). This would break clients of the
12+
library because they cannot see the internal platform classes.
13+
14+
This library is distributed in the system image, and loaded as
15+
a shared library. So you can change the implementation, but not
16+
the interface. In this way it is like framework.jar.
17+
18+
--- Why does this library exists? ---
19+
20+
Unbundled location providers (such as the NetworkLocationProvider)
21+
can not use internal platform classes.
22+
23+
So ideally all of these classes would be part of the public platform SDK API,
24+
but that doesn't seem like a great idea when only applications with a special
25+
signature can implement this API.
26+
27+
The compromise is this library.
28+
29+
It wraps internal platform classes (like ProviderRequest) with a stable
30+
API that does not leak the internal classes.

location/lib/java/com/android/location/provider/GeocodeProvider.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,14 @@
2525
import java.util.List;
2626

2727
/**
28-
* An abstract superclass for geocode providers that are implemented
29-
* outside of the core android platform.
30-
* Geocode providers can be implemented as services and return the result of
28+
* Base class for geocode providers implemented as unbundled services.
29+
*
30+
* <p>Geocode providers can be implemented as services and return the result of
3131
* {@link GeocodeProvider#getBinder()} in its getBinder() method.
3232
*
33-
* @hide
33+
* <p>IMPORTANT: This class is effectively a public API for unbundled
34+
* applications, and must remain API stable. See README.txt in the root
35+
* of this package for more information.
3436
*/
3537
public abstract class GeocodeProvider {
3638

location/lib/java/com/android/location/provider/LocationProviderBase.java

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,22 @@
3434
import com.android.internal.location.ProviderProperties;
3535
import com.android.internal.location.ProviderRequest;
3636

37-
3837
/**
39-
* Base class for location providers implemented as services.
40-
* @hide
38+
* Base class for location providers implemented as unbundled services.
39+
*
40+
* <p>The network location provider must export a service with action
41+
* "com.android.location.service.v2.NetworkLocationProvider"
42+
* and a valid minor version in a meta-data field on the service, and
43+
* then return the result of {@link #getBinder()} on service binding.
44+
*
45+
* <p>The fused location provider must export a service with action
46+
* "com.android.location.service.FusedLocationProvider"
47+
* and a valid minor version in a meta-data field on the service, and
48+
* then return the result of {@link #getBinder()} on service binding.
49+
*
50+
* <p>IMPORTANT: This class is effectively a public API for unbundled
51+
* applications, and must remain API stable. See README.txt in the root
52+
* of this package for more information.
4153
*/
4254
public abstract class LocationProviderBase {
4355
private final String TAG;

location/lib/java/com/android/location/provider/ProviderPropertiesUnbundled.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@
1919
import com.android.internal.location.ProviderProperties;
2020

2121
/**
22-
* This class is a public API for unbundled providers,
23-
* that hides the (hidden framework) ProviderProperties.
24-
* <p>Do _not_ remove public methods on this class.
22+
* This class is an interface to Provider Properties for unbundled applications.
23+
*
24+
* <p>IMPORTANT: This class is effectively a public API for unbundled
25+
* applications, and must remain API stable. See README.txt in the root
26+
* of this package for more information.
2527
*/
2628
public final class ProviderPropertiesUnbundled {
2729
private final ProviderProperties mProperties;

location/lib/java/com/android/location/provider/ProviderRequestUnbundled.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@
2323
import com.android.internal.location.ProviderRequest;
2424

2525
/**
26-
* This class is a public API for unbundled providers,
27-
* that hides the (hidden framework) ProviderRequest.
28-
* <p>Do _not_ remove public methods on this class.
26+
* This class is an interface to Provider Requests for unbundled applications.
27+
*
28+
* <p>IMPORTANT: This class is effectively a public API for unbundled
29+
* applications, and must remain API stable. See README.txt in the root
30+
* of this package for more information.
2931
*/
3032
public final class ProviderRequestUnbundled {
3133
private final ProviderRequest mRequest;

0 commit comments

Comments
 (0)