diff options
author | Mike Lockwood <lockwood@android.com> | 2009-04-15 11:10:11 -0400 |
---|---|---|
committer | Mike Lockwood <lockwood@android.com> | 2009-04-15 11:17:37 -0400 |
commit | a55c321329ae52a2db7a4f2bd36673a20b8f271d (patch) | |
tree | 97ee2b13cf6c464305930be581bcf14c072e7a55 /location | |
parent | 967f7c169c0ff8723a72fce7073f591dcfab018d (diff) | |
download | frameworks_base-a55c321329ae52a2db7a4f2bd36673a20b8f271d.zip frameworks_base-a55c321329ae52a2db7a4f2bd36673a20b8f271d.tar.gz frameworks_base-a55c321329ae52a2db7a4f2bd36673a20b8f271d.tar.bz2 |
location: Move geocoding support from ILocationProvider to a new interface.
Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'location')
4 files changed, 38 insertions, 33 deletions
diff --git a/location/java/android/location/IGeocodeProvider.aidl b/location/java/android/location/IGeocodeProvider.aidl new file mode 100644 index 0000000..e79e8d2 --- /dev/null +++ b/location/java/android/location/IGeocodeProvider.aidl @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2009 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.location; + +import android.location.Address; + +/** + * An interface for location providers implementing the Geocoder services. + * + * {@hide} + */ +interface IGeocodeProvider { + + String getFromLocation(double latitude, double longitude, int maxResults, + String language, String country, String variant, String appName, out List<Address> addrs); + + String getFromLocationName(String locationName, + double lowerLeftLatitude, double lowerLeftLongitude, + double upperRightLatitude, double upperRightLongitude, int maxResults, + String language, String country, String variant, String appName, out List<Address> addrs); +} diff --git a/location/java/android/location/ILocationManager.aidl b/location/java/android/location/ILocationManager.aidl index 86bd8b6..7d35814 100644 --- a/location/java/android/location/ILocationManager.aidl +++ b/location/java/android/location/ILocationManager.aidl @@ -18,6 +18,7 @@ package android.location; import android.app.PendingIntent; import android.location.Address; +import android.location.IGeocodeProvider; import android.location.IGpsStatusListener; import android.location.ILocationCollector; import android.location.ILocationListener; @@ -77,7 +78,8 @@ interface ILocationManager void setTestProviderStatus(String provider, int status, in Bundle extras, long updateTime); void clearTestProviderStatus(String provider); - /* for installing Network Location Provider */ + /* for installing external Location Providers */ void setNetworkLocationProvider(ILocationProvider provider); void setLocationCollector(ILocationCollector collector); + void setGeocodeProvider(IGeocodeProvider provider); } diff --git a/location/java/android/location/ILocationProvider.aidl b/location/java/android/location/ILocationProvider.aidl index 6f9daff..08b9246 100644 --- a/location/java/android/location/ILocationProvider.aidl +++ b/location/java/android/location/ILocationProvider.aidl @@ -16,7 +16,6 @@ package android.location; -import android.location.Address; import android.os.Bundle; /** @@ -52,10 +51,4 @@ interface ILocationProvider { void updateCellLockStatus(boolean acquired); void addListener(in String[] applications); void removeListener(in String[] applications); - String getFromLocation(double latitude, double longitude, int maxResults, - String language, String country, String variant, String appName, out List<Address> addrs); - String getFromLocationName(String locationName, - double lowerLeftLatitude, double lowerLeftLongitude, - double upperRightLatitude, double upperRightLongitude, int maxResults, - String language, String country, String variant, String appName, out List<Address> addrs); } diff --git a/location/java/com/android/internal/location/LocationProviderProxy.java b/location/java/com/android/internal/location/LocationProviderProxy.java index 1f4940f..5b5b27a 100644 --- a/location/java/com/android/internal/location/LocationProviderProxy.java +++ b/location/java/com/android/internal/location/LocationProviderProxy.java @@ -245,29 +245,4 @@ public class LocationProviderProxy extends LocationProviderImpl { Log.e(TAG, "removeListener failed", e); } } - - public String getFromLocation(double latitude, double longitude, int maxResults, - String language, String country, String variant, String appName, List<Address> addrs) { - try { - return mProvider.getFromLocation(latitude, longitude, maxResults, language, country, - variant, appName, addrs); - } catch (RemoteException e) { - Log.e(TAG, "getFromLocation failed", e); - return null; - } - } - - public String getFromLocationName(String locationName, - double lowerLeftLatitude, double lowerLeftLongitude, - double upperRightLatitude, double upperRightLongitude, int maxResults, - String language, String country, String variant, String appName, List<Address> addrs) { - try { - return mProvider.getFromLocationName(locationName, lowerLeftLatitude, - lowerLeftLongitude, upperRightLatitude, upperRightLongitude, - maxResults, language, country, variant, appName, addrs); - } catch (RemoteException e) { - Log.e(TAG, "getFromLocationName failed", e); - return null; - } - } } |