summaryrefslogtreecommitdiffstats
path: root/location
diff options
context:
space:
mode:
authorNick Pelly <npelly@google.com>2012-08-10 15:47:53 -0700
committerNick Pelly <npelly@google.com>2012-08-10 17:17:32 -0700
commit08ca1046fe4f1890f91241f8d082a024ef6cfd93 (patch)
treeda4e378d5fb57beac9ab8bca3f28e0f6da335456 /location
parent3914e4b7d12b014f73085cd6e34b6fd69ea26226 (diff)
downloadframeworks_base-08ca1046fe4f1890f91241f8d082a024ef6cfd93.zip
frameworks_base-08ca1046fe4f1890f91241f8d082a024ef6cfd93.tar.gz
frameworks_base-08ca1046fe4f1890f91241f8d082a024ef6cfd93.tar.bz2
Fix a couple of bugs from the location overhaul.
Marshall LocationRequest array correctly. Observe reportLocation from FusionEngine. Actually deliver the setRequest message to fusion engine. Change-Id: Iff64596fdd42f9fb06e563591dda9fbe0241533a
Diffstat (limited to 'location')
-rw-r--r--location/java/com/android/internal/location/ProviderRequest.java12
-rw-r--r--location/lib/java/com/android/location/provider/ProviderRequestUnbundled.java3
2 files changed, 9 insertions, 6 deletions
diff --git a/location/java/com/android/internal/location/ProviderRequest.java b/location/java/com/android/internal/location/ProviderRequest.java
index 25c51f5..26243e7 100644
--- a/location/java/com/android/internal/location/ProviderRequest.java
+++ b/location/java/com/android/internal/location/ProviderRequest.java
@@ -39,10 +39,9 @@ public final class ProviderRequest implements Parcelable {
* is a high power slow interval request and a
* low power fast interval request.
*/
- public List<LocationRequest> locationRequests = null;
+ public List<LocationRequest> locationRequests = new ArrayList<LocationRequest>();
- public ProviderRequest() {
- }
+ public ProviderRequest() { }
public static final Parcelable.Creator<ProviderRequest> CREATOR =
new Parcelable.Creator<ProviderRequest>() {
@@ -52,7 +51,6 @@ public final class ProviderRequest implements Parcelable {
request.reportLocation = in.readInt() == 1;
request.interval = in.readLong();
int count = in.readInt();
- request.locationRequests = new ArrayList<LocationRequest>(count);
for (int i = 0; i < count; i++) {
request.locationRequests.add(LocationRequest.CREATOR.createFromParcel(in));
}
@@ -73,8 +71,10 @@ public final class ProviderRequest implements Parcelable {
public void writeToParcel(Parcel parcel, int flags) {
parcel.writeInt(reportLocation ? 1 : 0);
parcel.writeLong(interval);
- parcel.writeParcelableArray(locationRequests.toArray(
- new LocationRequest[locationRequests.size()]), 0);
+ parcel.writeInt(locationRequests.size());
+ for (LocationRequest request : locationRequests) {
+ request.writeToParcel(parcel, flags);
+ }
}
@Override
diff --git a/location/lib/java/com/android/location/provider/ProviderRequestUnbundled.java b/location/lib/java/com/android/location/provider/ProviderRequestUnbundled.java
index 7487a56..3ff19ca 100644
--- a/location/lib/java/com/android/location/provider/ProviderRequestUnbundled.java
+++ b/location/lib/java/com/android/location/provider/ProviderRequestUnbundled.java
@@ -42,6 +42,9 @@ public final class ProviderRequestUnbundled {
return mRequest.interval;
}
+ /**
+ * Never null.
+ */
public List<LocationRequest> getLocationRequests() {
return mRequest.locationRequests;
}