Update location framework to accept raw data from GPS HAL.
Change-Id: Ib4feca004b53fa89dcece4299974ab08913455a0
This commit is contained in:
@@ -16,25 +16,23 @@
|
||||
|
||||
package android.location;
|
||||
|
||||
import com.android.internal.location.ProviderProperties;
|
||||
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Looper;
|
||||
import android.os.RemoteException;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.Message;
|
||||
import android.os.RemoteException;
|
||||
import android.util.Log;
|
||||
|
||||
|
||||
import java.lang.SecurityException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import com.android.internal.location.ProviderProperties;
|
||||
|
||||
/**
|
||||
* This class provides access to the system location services. These
|
||||
* services allow applications to obtain periodic updates of the
|
||||
@@ -60,6 +58,7 @@ public class LocationManager {
|
||||
|
||||
private final Context mContext;
|
||||
private final ILocationManager mService;
|
||||
private final GpsMeasurementListenerTransport mGpsMeasurementListenerTransport;
|
||||
private final HashMap<GpsStatus.Listener, GpsStatusListenerTransport> mGpsStatusListeners =
|
||||
new HashMap<GpsStatus.Listener, GpsStatusListenerTransport>();
|
||||
private final HashMap<GpsStatus.NmeaListener, GpsStatusListenerTransport> mNmeaListeners =
|
||||
@@ -310,6 +309,7 @@ public class LocationManager {
|
||||
public LocationManager(Context context, ILocationManager service) {
|
||||
mService = service;
|
||||
mContext = context;
|
||||
mGpsMeasurementListenerTransport = new GpsMeasurementListenerTransport(mContext, mService);
|
||||
}
|
||||
|
||||
private LocationProvider createProvider(String name, ProviderProperties properties) {
|
||||
@@ -1570,6 +1570,29 @@ public class LocationManager {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a GPS Measurement listener.
|
||||
*
|
||||
* @param listener a {@link android.location.GpsMeasurementsEvent.Listener} object to register.
|
||||
* @return {@code true} if the listener was successfully registered, {@code false} otherwise.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public boolean addGpsMeasurementListener(GpsMeasurementsEvent.Listener listener) {
|
||||
return mGpsMeasurementListenerTransport.add(listener);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a GPS Measurement listener.
|
||||
*
|
||||
* @param listener a {@link GpsMeasurementsEvent.Listener} object to remove.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public void removeGpsMeasurementListener(GpsMeasurementsEvent.Listener listener) {
|
||||
mGpsMeasurementListenerTransport.remove(listener);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves information about the current status of the GPS engine.
|
||||
* This should only be called from the {@link GpsStatus.Listener#onGpsStatusChanged}
|
||||
|
||||
Reference in New Issue
Block a user