Loading api/current.xml +11 −0 Original line number Diff line number Diff line Loading @@ -78725,6 +78725,17 @@ visibility="public" > </field> <field name="PASSIVE_PROVIDER" type="java.lang.String" transient="false" volatile="false" value=""passive"" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> </class> <class name="LocationProvider" extends="java.lang.Object" location/java/android/location/ILocationManager.aidl +4 −2 Original line number Diff line number Diff line Loading @@ -59,8 +59,10 @@ interface ILocationManager Location getLastKnownLocation(String provider); /* used by location providers to tell the location manager when it has a new location */ void reportLocation(in Location location); // Used by location providers to tell the location manager when it has a new location. // Passive is true if the location is coming from the passive provider, in which case // it need not be shared with other providers. void reportLocation(in Location location, boolean passive); String getFromLocation(double latitude, double longitude, int maxResults, in GeocoderParams params, out List<Address> addrs); Loading location/java/android/location/LocationManager.java +13 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,19 @@ public class LocationManager { */ public static final String GPS_PROVIDER = "gps"; /** * A special location provider for receiving locations without actually initiating * a location fix. This provider can be used to passively receive location updates * when other applications or services request them without actually requesting * the locations yourself. This provider will return locations generated by other * providers. You can query the {@link Location#getProvider()} method to determine * the origin of the location update. * * Requires the permission android.permission.ACCESS_FINE_LOCATION, although if the GPS * is not enabled this provider might only return coarse fixes. */ public static final String PASSIVE_PROVIDER = "passive"; /** * Key used for the Bundle extra holding a boolean indicating whether * a proximity alert is entering (true) or exiting (false).. Loading location/java/android/location/LocationProvider.java +4 −0 Original line number Diff line number Diff line Loading @@ -71,6 +71,10 @@ public abstract class LocationProvider { * false otherwise. */ public boolean meetsCriteria(Criteria criteria) { // We do not want to match the special passive provider based on criteria. if (LocationManager.PASSIVE_PROVIDER.equals(mName)) { return false; } if ((criteria.getAccuracy() != Criteria.NO_REQUIREMENT) && (criteria.getAccuracy() < getAccuracy())) { return false; Loading location/java/android/location/provider/LocationProvider.java +1 −1 Original line number Diff line number Diff line Loading @@ -156,7 +156,7 @@ public abstract class LocationProvider { */ public void reportLocation(Location location) { try { mLocationManager.reportLocation(location); mLocationManager.reportLocation(location, false); } catch (RemoteException e) { Log.e(TAG, "RemoteException in reportLocation: ", e); } Loading Loading
api/current.xml +11 −0 Original line number Diff line number Diff line Loading @@ -78725,6 +78725,17 @@ visibility="public" > </field> <field name="PASSIVE_PROVIDER" type="java.lang.String" transient="false" volatile="false" value=""passive"" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> </class> <class name="LocationProvider" extends="java.lang.Object"
location/java/android/location/ILocationManager.aidl +4 −2 Original line number Diff line number Diff line Loading @@ -59,8 +59,10 @@ interface ILocationManager Location getLastKnownLocation(String provider); /* used by location providers to tell the location manager when it has a new location */ void reportLocation(in Location location); // Used by location providers to tell the location manager when it has a new location. // Passive is true if the location is coming from the passive provider, in which case // it need not be shared with other providers. void reportLocation(in Location location, boolean passive); String getFromLocation(double latitude, double longitude, int maxResults, in GeocoderParams params, out List<Address> addrs); Loading
location/java/android/location/LocationManager.java +13 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,19 @@ public class LocationManager { */ public static final String GPS_PROVIDER = "gps"; /** * A special location provider for receiving locations without actually initiating * a location fix. This provider can be used to passively receive location updates * when other applications or services request them without actually requesting * the locations yourself. This provider will return locations generated by other * providers. You can query the {@link Location#getProvider()} method to determine * the origin of the location update. * * Requires the permission android.permission.ACCESS_FINE_LOCATION, although if the GPS * is not enabled this provider might only return coarse fixes. */ public static final String PASSIVE_PROVIDER = "passive"; /** * Key used for the Bundle extra holding a boolean indicating whether * a proximity alert is entering (true) or exiting (false).. Loading
location/java/android/location/LocationProvider.java +4 −0 Original line number Diff line number Diff line Loading @@ -71,6 +71,10 @@ public abstract class LocationProvider { * false otherwise. */ public boolean meetsCriteria(Criteria criteria) { // We do not want to match the special passive provider based on criteria. if (LocationManager.PASSIVE_PROVIDER.equals(mName)) { return false; } if ((criteria.getAccuracy() != Criteria.NO_REQUIREMENT) && (criteria.getAccuracy() < getAccuracy())) { return false; Loading
location/java/android/location/provider/LocationProvider.java +1 −1 Original line number Diff line number Diff line Loading @@ -156,7 +156,7 @@ public abstract class LocationProvider { */ public void reportLocation(Location location) { try { mLocationManager.reportLocation(location); mLocationManager.reportLocation(location, false); } catch (RemoteException e) { Log.e(TAG, "RemoteException in reportLocation: ", e); } Loading