Loading api/current.xml +11 −0 Original line number Original line Diff line number Diff line Loading @@ -82140,6 +82140,17 @@ <exception name="IOException" type="java.io.IOException"> <exception name="IOException" type="java.io.IOException"> </exception> </exception> </method> </method> <method name="isImplemented" return="java.lang.Boolean" abstract="false" native="false" synchronized="false" static="true" final="false" deprecated="not deprecated" visibility="public" > </method> </class> </class> <class name="GeocoderParams" <class name="GeocoderParams" extends="java.lang.Object" extends="java.lang.Object" location/java/android/location/Geocoder.java +20 −1 Original line number Original line Diff line number Diff line Loading @@ -40,7 +40,9 @@ import java.util.List; * * * The Geocoder class requires a backend service that is not included in * The Geocoder class requires a backend service that is not included in * the core android framework. The Geocoder query methods will return an * the core android framework. The Geocoder query methods will return an * empty list if there no backend service in the platform. * empty list if there no backend service in the platform. Use the * isImplemented() method to determine whether a Geocoder implementation * exists. */ */ public final class Geocoder { public final class Geocoder { private static final String TAG = "Geocoder"; private static final String TAG = "Geocoder"; Loading @@ -48,6 +50,23 @@ public final class Geocoder { private GeocoderParams mParams; private GeocoderParams mParams; private ILocationManager mService; private ILocationManager mService; /** * Returns true if the Geocoder methods getFromLocation and * getFromLocationName are implemented. Lack of network * connectivity may still cause these methods to return null or * empty lists. */ public static Boolean isImplemented() { IBinder b = ServiceManager.getService(Context.LOCATION_SERVICE); ILocationManager lm = ILocationManager.Stub.asInterface(b); try { return lm.geocoderIsImplemented(); } catch (RemoteException e) { Log.e(TAG, "isImplemented: got RemoteException", e); return false; } } /** /** * Constructs a Geocoder whose responses will be localized for the * Constructs a Geocoder whose responses will be localized for the * given Locale. * given Locale. Loading location/java/android/location/ILocationManager.aidl +1 −0 Original line number Original line Diff line number Diff line Loading @@ -67,6 +67,7 @@ interface ILocationManager // it need not be shared with other providers. // it need not be shared with other providers. void reportLocation(in Location location, boolean passive); void reportLocation(in Location location, boolean passive); boolean geocoderIsImplemented(); String getFromLocation(double latitude, double longitude, int maxResults, String getFromLocation(double latitude, double longitude, int maxResults, in GeocoderParams params, out List<Address> addrs); in GeocoderParams params, out List<Address> addrs); String getFromLocationName(String locationName, String getFromLocationName(String locationName, Loading services/java/com/android/server/LocationManagerService.java +4 −0 Original line number Original line Diff line number Diff line Loading @@ -1940,6 +1940,10 @@ public class LocationManagerService extends ILocationManager.Stub implements Run // Geocoder // Geocoder public Boolean geocoderIsImplemented() { return mGeocodeProvider != null; } public String getFromLocation(double latitude, double longitude, int maxResults, public String getFromLocation(double latitude, double longitude, int maxResults, GeocoderParams params, List<Address> addrs) { GeocoderParams params, List<Address> addrs) { if (mGeocodeProvider != null) { if (mGeocodeProvider != null) { Loading Loading
api/current.xml +11 −0 Original line number Original line Diff line number Diff line Loading @@ -82140,6 +82140,17 @@ <exception name="IOException" type="java.io.IOException"> <exception name="IOException" type="java.io.IOException"> </exception> </exception> </method> </method> <method name="isImplemented" return="java.lang.Boolean" abstract="false" native="false" synchronized="false" static="true" final="false" deprecated="not deprecated" visibility="public" > </method> </class> </class> <class name="GeocoderParams" <class name="GeocoderParams" extends="java.lang.Object" extends="java.lang.Object"
location/java/android/location/Geocoder.java +20 −1 Original line number Original line Diff line number Diff line Loading @@ -40,7 +40,9 @@ import java.util.List; * * * The Geocoder class requires a backend service that is not included in * The Geocoder class requires a backend service that is not included in * the core android framework. The Geocoder query methods will return an * the core android framework. The Geocoder query methods will return an * empty list if there no backend service in the platform. * empty list if there no backend service in the platform. Use the * isImplemented() method to determine whether a Geocoder implementation * exists. */ */ public final class Geocoder { public final class Geocoder { private static final String TAG = "Geocoder"; private static final String TAG = "Geocoder"; Loading @@ -48,6 +50,23 @@ public final class Geocoder { private GeocoderParams mParams; private GeocoderParams mParams; private ILocationManager mService; private ILocationManager mService; /** * Returns true if the Geocoder methods getFromLocation and * getFromLocationName are implemented. Lack of network * connectivity may still cause these methods to return null or * empty lists. */ public static Boolean isImplemented() { IBinder b = ServiceManager.getService(Context.LOCATION_SERVICE); ILocationManager lm = ILocationManager.Stub.asInterface(b); try { return lm.geocoderIsImplemented(); } catch (RemoteException e) { Log.e(TAG, "isImplemented: got RemoteException", e); return false; } } /** /** * Constructs a Geocoder whose responses will be localized for the * Constructs a Geocoder whose responses will be localized for the * given Locale. * given Locale. Loading
location/java/android/location/ILocationManager.aidl +1 −0 Original line number Original line Diff line number Diff line Loading @@ -67,6 +67,7 @@ interface ILocationManager // it need not be shared with other providers. // it need not be shared with other providers. void reportLocation(in Location location, boolean passive); void reportLocation(in Location location, boolean passive); boolean geocoderIsImplemented(); String getFromLocation(double latitude, double longitude, int maxResults, String getFromLocation(double latitude, double longitude, int maxResults, in GeocoderParams params, out List<Address> addrs); in GeocoderParams params, out List<Address> addrs); String getFromLocationName(String locationName, String getFromLocationName(String locationName, Loading
services/java/com/android/server/LocationManagerService.java +4 −0 Original line number Original line Diff line number Diff line Loading @@ -1940,6 +1940,10 @@ public class LocationManagerService extends ILocationManager.Stub implements Run // Geocoder // Geocoder public Boolean geocoderIsImplemented() { return mGeocodeProvider != null; } public String getFromLocation(double latitude, double longitude, int maxResults, public String getFromLocation(double latitude, double longitude, int maxResults, GeocoderParams params, List<Address> addrs) { GeocoderParams params, List<Address> addrs) { if (mGeocodeProvider != null) { if (mGeocodeProvider != null) { Loading