summaryrefslogtreecommitdiffstats
path: root/location/java
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@android.com>2009-05-21 11:28:20 -0400
committerMike Lockwood <lockwood@android.com>2009-05-21 11:28:20 -0400
commitfd6e5f0dda50e113db4ccc55338b6c4f09da37a4 (patch)
treefaf8e2c6510d2a0c4439cdcdfe74d97100dc9020 /location/java
parentbb7b7b316a6a15f4df6af3c62a293920c68c7b00 (diff)
downloadframeworks_base-fd6e5f0dda50e113db4ccc55338b6c4f09da37a4.zip
frameworks_base-fd6e5f0dda50e113db4ccc55338b6c4f09da37a4.tar.gz
frameworks_base-fd6e5f0dda50e113db4ccc55338b6c4f09da37a4.tar.bz2
location: Replace ILocationCollector interface with new ILocationProvider method
This change replaces ILocationCollector with a more general mechanism that passes locations received from a provider to all other providers. The network location provider now uses this to implement the location collector. In the future, this could be used to inject network locations to the GPS as aiding data. This change also removes the now obsolete permission INSTALL_LOCATION_COLLECTOR. Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'location/java')
-rw-r--r--location/java/android/location/ILocationCollector.aidl36
-rw-r--r--location/java/android/location/ILocationManager.aidl2
-rw-r--r--location/java/android/location/ILocationProvider.aidl2
-rw-r--r--location/java/android/location/LocationManager.java21
-rw-r--r--location/java/com/android/internal/location/GpsLocationProvider.java7
-rw-r--r--location/java/com/android/internal/location/LocationProviderProxy.java8
-rw-r--r--location/java/com/android/internal/location/MockProvider.java3
7 files changed, 20 insertions, 59 deletions
diff --git a/location/java/android/location/ILocationCollector.aidl b/location/java/android/location/ILocationCollector.aidl
deleted file mode 100644
index b2e1796..0000000
--- a/location/java/android/location/ILocationCollector.aidl
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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.Location;
-
-/**
- * Listens for GPS and cell/wifi changes and anonymously uploads to server
- * for improving quality of service of NetworkLocationProvider.
- * This service is only enabled when the user has enabled the
- * network location provider.
- *
- * {@hide}
- */
-oneway interface ILocationCollector {
- /**
- * Updates GPS location if collection is enabled
- *
- * @param location location object
- */
- void updateLocation(in Location location);
-}
diff --git a/location/java/android/location/ILocationManager.aidl b/location/java/android/location/ILocationManager.aidl
index 2c214c9..caf9516 100644
--- a/location/java/android/location/ILocationManager.aidl
+++ b/location/java/android/location/ILocationManager.aidl
@@ -20,7 +20,6 @@ import android.app.PendingIntent;
import android.location.Address;
import android.location.IGeocodeProvider;
import android.location.IGpsStatusListener;
-import android.location.ILocationCollector;
import android.location.ILocationListener;
import android.location.ILocationProvider;
import android.location.Location;
@@ -83,6 +82,5 @@ interface ILocationManager
/* for installing external Location Providers */
void installLocationProvider(String name, ILocationProvider provider);
- void installLocationCollector(ILocationCollector collector);
void installGeocodeProvider(IGeocodeProvider provider);
}
diff --git a/location/java/android/location/ILocationProvider.aidl b/location/java/android/location/ILocationProvider.aidl
index 6c23f83..4fe0494 100644
--- a/location/java/android/location/ILocationProvider.aidl
+++ b/location/java/android/location/ILocationProvider.aidl
@@ -16,6 +16,7 @@
package android.location;
+import android.location.Location;
import android.os.Bundle;
/**
@@ -41,6 +42,7 @@ interface ILocationProvider {
void enableLocationTracking(boolean enable);
void setMinTime(long minTime);
void updateNetworkState(int state);
+ void updateLocation(in Location location);
boolean sendExtraCommand(String command, inout Bundle extras);
void addListener(int uid);
void removeListener(int uid);
diff --git a/location/java/android/location/LocationManager.java b/location/java/android/location/LocationManager.java
index 872838c..86ea66f 100644
--- a/location/java/android/location/LocationManager.java
+++ b/location/java/android/location/LocationManager.java
@@ -1279,27 +1279,6 @@ public class LocationManager {
}
/**
- * Installs a location collector.
- *
- * @param provider Binder interface for the location collector
- *
- * @return true if the command succeeds.
- *
- * Requires the android.permission.INSTALL_LOCATION_COLLECTOR permission.
- *
- * {@hide}
- */
- public boolean installLocationCollector(ILocationCollector collector) {
- try {
- mService.installLocationCollector(collector);
- return true;
- } catch (RemoteException e) {
- Log.e(TAG, "RemoteException in setLocationCollector: ", e);
- return false;
- }
- }
-
- /**
* Installs a geocoder server.
*
* @param provider Binder interface for the geocoder provider
diff --git a/location/java/com/android/internal/location/GpsLocationProvider.java b/location/java/com/android/internal/location/GpsLocationProvider.java
index 9003848..725fbf9 100644
--- a/location/java/com/android/internal/location/GpsLocationProvider.java
+++ b/location/java/com/android/internal/location/GpsLocationProvider.java
@@ -406,6 +406,13 @@ public class GpsLocationProvider extends ILocationProvider.Stub {
}
/**
+ * This is called to inform us when another location provider returns a location.
+ * Someday we might use this for network location injection to aid the GPS
+ */
+ public void updateLocation(Location location) {
+ }
+
+ /**
* Returns true if the provider requires access to a
* satellite-based positioning system (e.g., GPS), false
* otherwise.
diff --git a/location/java/com/android/internal/location/LocationProviderProxy.java b/location/java/com/android/internal/location/LocationProviderProxy.java
index b40cdca..bd7088c 100644
--- a/location/java/com/android/internal/location/LocationProviderProxy.java
+++ b/location/java/com/android/internal/location/LocationProviderProxy.java
@@ -219,6 +219,14 @@ public class LocationProviderProxy implements IBinder.DeathRecipient {
}
}
+ public void updateLocation(Location location) {
+ try {
+ mProvider.updateLocation(location);
+ } catch (RemoteException e) {
+ Log.e(TAG, "updateLocation failed", e);
+ }
+ }
+
public boolean sendExtraCommand(String command, Bundle extras) {
try {
return mProvider.sendExtraCommand(command, extras);
diff --git a/location/java/com/android/internal/location/MockProvider.java b/location/java/com/android/internal/location/MockProvider.java
index f167a44..e2e0562 100644
--- a/location/java/com/android/internal/location/MockProvider.java
+++ b/location/java/com/android/internal/location/MockProvider.java
@@ -172,6 +172,9 @@ public class MockProvider extends ILocationProvider.Stub {
public void updateNetworkState(int state) {
}
+ public void updateLocation(Location location) {
+ }
+
public boolean sendExtraCommand(String command, Bundle extras) {
return false;
}