From 08ca1046fe4f1890f91241f8d082a024ef6cfd93 Mon Sep 17 00:00:00 2001 From: Nick Pelly Date: Fri, 10 Aug 2012 15:47:53 -0700 Subject: 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 --- .../java/com/android/internal/location/ProviderRequest.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'location/java/com') 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 locationRequests = null; + public List locationRequests = new ArrayList(); - public ProviderRequest() { - } + public ProviderRequest() { } public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { @@ -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(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 -- cgit v1.1