Loading location/lib/README.txt 0 → 100644 +30 −0 Original line number Diff line number Diff line This library (com.android.location.provider.jar) is a shared java library containing classes required by unbundled location providers. --- Rules of this library --- o This library is effectively a PUBLIC API for unbundled location providers that may be distributed outside the system image. So it MUST BE API STABLE. You can add but not remove. The rules are the same as for the public platform SDK API. o This library can see and instantiate internal platform classes (such as ProviderRequest.java), but it must not expose them in any public method (or by extending them via inheritance). This would break clients of the library because they cannot see the internal platform classes. This library is distributed in the system image, and loaded as a shared library. So you can change the implementation, but not the interface. In this way it is like framework.jar. --- Why does this library exists? --- Unbundled location providers (such as the NetworkLocationProvider) can not use internal platform classes. So ideally all of these classes would be part of the public platform SDK API, but that doesn't seem like a great idea when only applications with a special signature can implement this API. The compromise is this library. It wraps internal platform classes (like ProviderRequest) with a stable API that does not leak the internal classes. location/lib/java/com/android/location/provider/GeocodeProvider.java +6 −4 Original line number Diff line number Diff line Loading @@ -25,12 +25,14 @@ import android.location.IGeocodeProvider; import java.util.List; /** * An abstract superclass for geocode providers that are implemented * outside of the core android platform. * Geocode providers can be implemented as services and return the result of * Base class for geocode providers implemented as unbundled services. * * <p>Geocode providers can be implemented as services and return the result of * {@link GeocodeProvider#getBinder()} in its getBinder() method. * * @hide * <p>IMPORTANT: This class is effectively a public API for unbundled * applications, and must remain API stable. See README.txt in the root * of this package for more information. */ public abstract class GeocodeProvider { Loading location/lib/java/com/android/location/provider/LocationProviderBase.java +15 −3 Original line number Diff line number Diff line Loading @@ -34,10 +34,22 @@ import com.android.internal.location.ILocationProvider; import com.android.internal.location.ProviderProperties; import com.android.internal.location.ProviderRequest; /** * Base class for location providers implemented as services. * @hide * Base class for location providers implemented as unbundled services. * * <p>The network location provider must export a service with action * "com.android.location.service.v2.NetworkLocationProvider" * and a valid minor version in a meta-data field on the service, and * then return the result of {@link #getBinder()} on service binding. * * <p>The fused location provider must export a service with action * "com.android.location.service.FusedLocationProvider" * and a valid minor version in a meta-data field on the service, and * then return the result of {@link #getBinder()} on service binding. * * <p>IMPORTANT: This class is effectively a public API for unbundled * applications, and must remain API stable. See README.txt in the root * of this package for more information. */ public abstract class LocationProviderBase { private final String TAG; Loading location/lib/java/com/android/location/provider/ProviderPropertiesUnbundled.java +5 −3 Original line number Diff line number Diff line Loading @@ -19,9 +19,11 @@ package com.android.location.provider; import com.android.internal.location.ProviderProperties; /** * This class is a public API for unbundled providers, * that hides the (hidden framework) ProviderProperties. * <p>Do _not_ remove public methods on this class. * This class is an interface to Provider Properties for unbundled applications. * * <p>IMPORTANT: This class is effectively a public API for unbundled * applications, and must remain API stable. See README.txt in the root * of this package for more information. */ public final class ProviderPropertiesUnbundled { private final ProviderProperties mProperties; Loading location/lib/java/com/android/location/provider/ProviderRequestUnbundled.java +5 −3 Original line number Diff line number Diff line Loading @@ -23,9 +23,11 @@ import android.location.LocationRequest; import com.android.internal.location.ProviderRequest; /** * This class is a public API for unbundled providers, * that hides the (hidden framework) ProviderRequest. * <p>Do _not_ remove public methods on this class. * This class is an interface to Provider Requests for unbundled applications. * * <p>IMPORTANT: This class is effectively a public API for unbundled * applications, and must remain API stable. See README.txt in the root * of this package for more information. */ public final class ProviderRequestUnbundled { private final ProviderRequest mRequest; Loading Loading
location/lib/README.txt 0 → 100644 +30 −0 Original line number Diff line number Diff line This library (com.android.location.provider.jar) is a shared java library containing classes required by unbundled location providers. --- Rules of this library --- o This library is effectively a PUBLIC API for unbundled location providers that may be distributed outside the system image. So it MUST BE API STABLE. You can add but not remove. The rules are the same as for the public platform SDK API. o This library can see and instantiate internal platform classes (such as ProviderRequest.java), but it must not expose them in any public method (or by extending them via inheritance). This would break clients of the library because they cannot see the internal platform classes. This library is distributed in the system image, and loaded as a shared library. So you can change the implementation, but not the interface. In this way it is like framework.jar. --- Why does this library exists? --- Unbundled location providers (such as the NetworkLocationProvider) can not use internal platform classes. So ideally all of these classes would be part of the public platform SDK API, but that doesn't seem like a great idea when only applications with a special signature can implement this API. The compromise is this library. It wraps internal platform classes (like ProviderRequest) with a stable API that does not leak the internal classes.
location/lib/java/com/android/location/provider/GeocodeProvider.java +6 −4 Original line number Diff line number Diff line Loading @@ -25,12 +25,14 @@ import android.location.IGeocodeProvider; import java.util.List; /** * An abstract superclass for geocode providers that are implemented * outside of the core android platform. * Geocode providers can be implemented as services and return the result of * Base class for geocode providers implemented as unbundled services. * * <p>Geocode providers can be implemented as services and return the result of * {@link GeocodeProvider#getBinder()} in its getBinder() method. * * @hide * <p>IMPORTANT: This class is effectively a public API for unbundled * applications, and must remain API stable. See README.txt in the root * of this package for more information. */ public abstract class GeocodeProvider { Loading
location/lib/java/com/android/location/provider/LocationProviderBase.java +15 −3 Original line number Diff line number Diff line Loading @@ -34,10 +34,22 @@ import com.android.internal.location.ILocationProvider; import com.android.internal.location.ProviderProperties; import com.android.internal.location.ProviderRequest; /** * Base class for location providers implemented as services. * @hide * Base class for location providers implemented as unbundled services. * * <p>The network location provider must export a service with action * "com.android.location.service.v2.NetworkLocationProvider" * and a valid minor version in a meta-data field on the service, and * then return the result of {@link #getBinder()} on service binding. * * <p>The fused location provider must export a service with action * "com.android.location.service.FusedLocationProvider" * and a valid minor version in a meta-data field on the service, and * then return the result of {@link #getBinder()} on service binding. * * <p>IMPORTANT: This class is effectively a public API for unbundled * applications, and must remain API stable. See README.txt in the root * of this package for more information. */ public abstract class LocationProviderBase { private final String TAG; Loading
location/lib/java/com/android/location/provider/ProviderPropertiesUnbundled.java +5 −3 Original line number Diff line number Diff line Loading @@ -19,9 +19,11 @@ package com.android.location.provider; import com.android.internal.location.ProviderProperties; /** * This class is a public API for unbundled providers, * that hides the (hidden framework) ProviderProperties. * <p>Do _not_ remove public methods on this class. * This class is an interface to Provider Properties for unbundled applications. * * <p>IMPORTANT: This class is effectively a public API for unbundled * applications, and must remain API stable. See README.txt in the root * of this package for more information. */ public final class ProviderPropertiesUnbundled { private final ProviderProperties mProperties; Loading
location/lib/java/com/android/location/provider/ProviderRequestUnbundled.java +5 −3 Original line number Diff line number Diff line Loading @@ -23,9 +23,11 @@ import android.location.LocationRequest; import com.android.internal.location.ProviderRequest; /** * This class is a public API for unbundled providers, * that hides the (hidden framework) ProviderRequest. * <p>Do _not_ remove public methods on this class. * This class is an interface to Provider Requests for unbundled applications. * * <p>IMPORTANT: This class is effectively a public API for unbundled * applications, and must remain API stable. See README.txt in the root * of this package for more information. */ public final class ProviderRequestUnbundled { private final ProviderRequest mRequest; Loading