summaryrefslogtreecommitdiffstats
path: root/location/java/android
diff options
context:
space:
mode:
authorMike Lockwood <>2009-04-06 10:51:26 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-04-06 10:51:26 -0700
commite932f7f2a47b770c636443d411436bd29cc4bb43 (patch)
tree75a53e7d58fd8b9524aa22e370854e4c65bba17e /location/java/android
parent53566b140ffa7b1e2f522ab1cdec13c74f8779e7 (diff)
downloadframeworks_base-e932f7f2a47b770c636443d411436bd29cc4bb43.zip
frameworks_base-e932f7f2a47b770c636443d411436bd29cc4bb43.tar.gz
frameworks_base-e932f7f2a47b770c636443d411436bd29cc4bb43.tar.bz2
AI 144663: Use Binder interfaces between NetworkLocationManager and LocationManagerService.
This fixes a hack that was added when NetworkLocationManager was moved out of the framework. This also lays the groundwork for supporting location providers outside of the system process. BUG=1729031 Automated import of CL 144663
Diffstat (limited to 'location/java/android')
-rw-r--r--location/java/android/location/ILocationCollector.aidl36
-rw-r--r--location/java/android/location/ILocationManager.aidl6
-rw-r--r--location/java/android/location/ILocationProvider.aidl61
-rw-r--r--location/java/android/location/LocationProviderImpl.java2
4 files changed, 104 insertions, 1 deletions
diff --git a/location/java/android/location/ILocationCollector.aidl b/location/java/android/location/ILocationCollector.aidl
new file mode 100644
index 0000000..b2e1796
--- /dev/null
+++ b/location/java/android/location/ILocationCollector.aidl
@@ -0,0 +1,36 @@
+/*
+ * 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 a7fb04d..86bd8b6 100644
--- a/location/java/android/location/ILocationManager.aidl
+++ b/location/java/android/location/ILocationManager.aidl
@@ -19,7 +19,9 @@ package android.location;
import android.app.PendingIntent;
import android.location.Address;
import android.location.IGpsStatusListener;
+import android.location.ILocationCollector;
import android.location.ILocationListener;
+import android.location.ILocationProvider;
import android.location.Location;
import android.os.Bundle;
@@ -74,4 +76,8 @@ interface ILocationManager
void clearTestProviderEnabled(String provider);
void setTestProviderStatus(String provider, int status, in Bundle extras, long updateTime);
void clearTestProviderStatus(String provider);
+
+ /* for installing Network Location Provider */
+ void setNetworkLocationProvider(ILocationProvider provider);
+ void setLocationCollector(ILocationCollector collector);
}
diff --git a/location/java/android/location/ILocationProvider.aidl b/location/java/android/location/ILocationProvider.aidl
new file mode 100644
index 0000000..6f9daff
--- /dev/null
+++ b/location/java/android/location/ILocationProvider.aidl
@@ -0,0 +1,61 @@
+/*
+ * 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;
+import android.os.Bundle;
+
+/**
+ * An interface for location providers implemented outside of the system process.
+ *
+ * {@hide}
+ */
+interface ILocationProvider {
+
+ /* for LocationProvider */
+ boolean requiresNetwork();
+ boolean requiresSatellite();
+ boolean requiresCell();
+ boolean hasMonetaryCost();
+ boolean supportsAltitude();
+ boolean supportsSpeed();
+ boolean supportsBearing();
+ int getPowerRequirement();
+ int getAccuracy();
+
+ /* for LocationProviderImpl */
+ void enable();
+ void disable();
+ boolean isEnabled();
+ int getStatus(out Bundle extras);
+ long getStatusUpdateTime();
+ void enableLocationTracking(boolean enable);
+ void setMinTime(long minTime);
+ void updateNetworkState(int state);
+ boolean sendExtraCommand(String command, inout Bundle extras);
+
+ /* the following are only used for NetworkLocationProvider */
+ 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/android/location/LocationProviderImpl.java b/location/java/android/location/LocationProviderImpl.java
index b6453c6..2a9199e 100644
--- a/location/java/android/location/LocationProviderImpl.java
+++ b/location/java/android/location/LocationProviderImpl.java
@@ -119,7 +119,7 @@ public abstract class LocationProviderImpl extends LocationProvider {
try {
mLocationManager.setLocation(location);
} catch (RemoteException e) {
- Log.e(TAG, "RemoteException calling ILocationManager.onLocationChanged");
+ Log.e(TAG, "RemoteException calling ILocationManager.setLocation");
}
}