Loading location/java/android/location/GpsMeasurementListenerTransport.java +13 −4 Original line number Diff line number Diff line Loading @@ -26,14 +26,12 @@ import android.os.RemoteException; */ class GpsMeasurementListenerTransport extends LocalListenerHelper<GpsMeasurementsEvent.Listener> { private final Context mContext; private final ILocationManager mLocationManager; private final IGpsMeasurementsListener mListenerTransport = new ListenerTransport(); public GpsMeasurementListenerTransport(Context context, ILocationManager locationManager) { super("GpsMeasurementListenerTransport"); mContext = context; super(context, "GpsMeasurementListenerTransport"); mLocationManager = locationManager; } Loading @@ -41,7 +39,7 @@ class GpsMeasurementListenerTransport protected boolean registerWithServer() throws RemoteException { return mLocationManager.addGpsMeasurementsListener( mListenerTransport, mContext.getPackageName()); getContext().getPackageName()); } @Override Loading @@ -59,7 +57,18 @@ class GpsMeasurementListenerTransport listener.onGpsMeasurementsReceived(event); } }; foreach(operation); } @Override public void onStatusChanged(final int status) { ListenerOperation<GpsMeasurementsEvent.Listener> operation = new ListenerOperation<GpsMeasurementsEvent.Listener>() { @Override public void execute(GpsMeasurementsEvent.Listener listener) throws RemoteException { listener.onStatusChanged(status); } }; foreach(operation); } } Loading location/java/android/location/GpsMeasurementsEvent.java +30 −1 Original line number Diff line number Diff line Loading @@ -32,6 +32,24 @@ import java.util.Collections; * @hide */ public class GpsMeasurementsEvent implements Parcelable { /** * The system does not support tracking of GPS Measurements. This status will not change in the * future. */ public static final int STATUS_NOT_SUPPORTED = 0; /** * GPS Measurements are successfully being tracked, it will receive updates once they are * available. */ public static final int STATUS_READY = 1; /** * GPS provider or Location is disabled, updates will not be received until they are enabled. */ public static final int STATUS_GPS_LOCATION_DISABLED = 2; private final GpsClock mClock; private final Collection<GpsMeasurement> mReadOnlyMeasurements; Loading @@ -43,7 +61,16 @@ public class GpsMeasurementsEvent implements Parcelable { * @hide */ public interface Listener { /** * Returns the latest collected GPS Measurements. */ void onGpsMeasurementsReceived(GpsMeasurementsEvent eventArgs); /** * Returns the latest status of the GPS Measurements sub-system. */ void onStatusChanged(int status); } public GpsMeasurementsEvent(GpsClock clock, GpsMeasurement[] measurements) { Loading Loading @@ -103,7 +130,9 @@ public class GpsMeasurementsEvent implements Parcelable { public void writeToParcel(Parcel parcel, int flags) { parcel.writeParcelable(mClock, flags); GpsMeasurement[] measurementsArray = mReadOnlyMeasurements.toArray(new GpsMeasurement[0]); int measurementsCount = mReadOnlyMeasurements.size(); GpsMeasurement[] measurementsArray = mReadOnlyMeasurements.toArray(new GpsMeasurement[measurementsCount]); parcel.writeInt(measurementsArray.length); parcel.writeTypedArray(measurementsArray, flags); } Loading location/java/android/location/GpsNavigationMessageEvent.java +27 −3 Original line number Diff line number Diff line Loading @@ -21,9 +21,6 @@ import android.os.Parcel; import android.os.Parcelable; import java.security.InvalidParameterException; import java.util.Arrays; import java.util.Collection; import java.util.Collections; /** * A class implementing a container for data associated with a navigation message event. Loading @@ -32,6 +29,24 @@ import java.util.Collections; * @hide */ public class GpsNavigationMessageEvent implements Parcelable { /** * The system does not support tracking of GPS Navigation Messages. This status will not change * in the future. */ public static int STATUS_NOT_SUPPORTED = 0; /** * GPS Navigation Messages are successfully being tracked, it will receive updates once they are * available. */ public static int STATUS_READY = 1; /** * GPS provider or Location is disabled, updated will not be received until they are enabled. */ public static int STATUS_GPS_LOCATION_DISABLED = 2; private final GpsNavigationMessage mNavigationMessage; /** Loading @@ -42,7 +57,16 @@ public class GpsNavigationMessageEvent implements Parcelable { * @hide */ public interface Listener { /** * Returns the latest collected GPS Navigation Message. */ void onGpsNavigationMessageReceived(GpsNavigationMessageEvent event); /** * Returns the latest status of the GPS Navigation Messages sub-system. */ void onStatusChanged(int status); } public GpsNavigationMessageEvent(GpsNavigationMessage message) { Loading location/java/android/location/GpsNavigationMessageListenerTransport.java +14 −4 Original line number Diff line number Diff line Loading @@ -26,7 +26,6 @@ import android.os.RemoteException; */ class GpsNavigationMessageListenerTransport extends LocalListenerHelper<GpsNavigationMessageEvent.Listener> { private final Context mContext; private final ILocationManager mLocationManager; private final IGpsNavigationMessageListener mListenerTransport = new ListenerTransport(); Loading @@ -34,8 +33,7 @@ class GpsNavigationMessageListenerTransport public GpsNavigationMessageListenerTransport( Context context, ILocationManager locationManager) { super("GpsNavigationMessageListenerTransport"); mContext = context; super(context, "GpsNavigationMessageListenerTransport"); mLocationManager = locationManager; } Loading @@ -43,7 +41,7 @@ class GpsNavigationMessageListenerTransport protected boolean registerWithServer() throws RemoteException { return mLocationManager.addGpsNavigationMessageListener( mListenerTransport, mContext.getPackageName()); getContext().getPackageName()); } @Override Loading @@ -62,7 +60,19 @@ class GpsNavigationMessageListenerTransport listener.onGpsNavigationMessageReceived(event); } }; foreach(operation); } @Override public void onStatusChanged(final int status) { ListenerOperation<GpsNavigationMessageEvent.Listener> operation = new ListenerOperation<GpsNavigationMessageEvent.Listener>() { @Override public void execute(GpsNavigationMessageEvent.Listener listener) throws RemoteException { listener.onStatusChanged(status); } }; foreach(operation); } } Loading location/java/android/location/IGpsMeasurementsListener.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -23,4 +23,5 @@ import android.location.GpsMeasurementsEvent; */ oneway interface IGpsMeasurementsListener { void onGpsMeasurementsReceived(in GpsMeasurementsEvent event); void onStatusChanged(in int status); } Loading
location/java/android/location/GpsMeasurementListenerTransport.java +13 −4 Original line number Diff line number Diff line Loading @@ -26,14 +26,12 @@ import android.os.RemoteException; */ class GpsMeasurementListenerTransport extends LocalListenerHelper<GpsMeasurementsEvent.Listener> { private final Context mContext; private final ILocationManager mLocationManager; private final IGpsMeasurementsListener mListenerTransport = new ListenerTransport(); public GpsMeasurementListenerTransport(Context context, ILocationManager locationManager) { super("GpsMeasurementListenerTransport"); mContext = context; super(context, "GpsMeasurementListenerTransport"); mLocationManager = locationManager; } Loading @@ -41,7 +39,7 @@ class GpsMeasurementListenerTransport protected boolean registerWithServer() throws RemoteException { return mLocationManager.addGpsMeasurementsListener( mListenerTransport, mContext.getPackageName()); getContext().getPackageName()); } @Override Loading @@ -59,7 +57,18 @@ class GpsMeasurementListenerTransport listener.onGpsMeasurementsReceived(event); } }; foreach(operation); } @Override public void onStatusChanged(final int status) { ListenerOperation<GpsMeasurementsEvent.Listener> operation = new ListenerOperation<GpsMeasurementsEvent.Listener>() { @Override public void execute(GpsMeasurementsEvent.Listener listener) throws RemoteException { listener.onStatusChanged(status); } }; foreach(operation); } } Loading
location/java/android/location/GpsMeasurementsEvent.java +30 −1 Original line number Diff line number Diff line Loading @@ -32,6 +32,24 @@ import java.util.Collections; * @hide */ public class GpsMeasurementsEvent implements Parcelable { /** * The system does not support tracking of GPS Measurements. This status will not change in the * future. */ public static final int STATUS_NOT_SUPPORTED = 0; /** * GPS Measurements are successfully being tracked, it will receive updates once they are * available. */ public static final int STATUS_READY = 1; /** * GPS provider or Location is disabled, updates will not be received until they are enabled. */ public static final int STATUS_GPS_LOCATION_DISABLED = 2; private final GpsClock mClock; private final Collection<GpsMeasurement> mReadOnlyMeasurements; Loading @@ -43,7 +61,16 @@ public class GpsMeasurementsEvent implements Parcelable { * @hide */ public interface Listener { /** * Returns the latest collected GPS Measurements. */ void onGpsMeasurementsReceived(GpsMeasurementsEvent eventArgs); /** * Returns the latest status of the GPS Measurements sub-system. */ void onStatusChanged(int status); } public GpsMeasurementsEvent(GpsClock clock, GpsMeasurement[] measurements) { Loading Loading @@ -103,7 +130,9 @@ public class GpsMeasurementsEvent implements Parcelable { public void writeToParcel(Parcel parcel, int flags) { parcel.writeParcelable(mClock, flags); GpsMeasurement[] measurementsArray = mReadOnlyMeasurements.toArray(new GpsMeasurement[0]); int measurementsCount = mReadOnlyMeasurements.size(); GpsMeasurement[] measurementsArray = mReadOnlyMeasurements.toArray(new GpsMeasurement[measurementsCount]); parcel.writeInt(measurementsArray.length); parcel.writeTypedArray(measurementsArray, flags); } Loading
location/java/android/location/GpsNavigationMessageEvent.java +27 −3 Original line number Diff line number Diff line Loading @@ -21,9 +21,6 @@ import android.os.Parcel; import android.os.Parcelable; import java.security.InvalidParameterException; import java.util.Arrays; import java.util.Collection; import java.util.Collections; /** * A class implementing a container for data associated with a navigation message event. Loading @@ -32,6 +29,24 @@ import java.util.Collections; * @hide */ public class GpsNavigationMessageEvent implements Parcelable { /** * The system does not support tracking of GPS Navigation Messages. This status will not change * in the future. */ public static int STATUS_NOT_SUPPORTED = 0; /** * GPS Navigation Messages are successfully being tracked, it will receive updates once they are * available. */ public static int STATUS_READY = 1; /** * GPS provider or Location is disabled, updated will not be received until they are enabled. */ public static int STATUS_GPS_LOCATION_DISABLED = 2; private final GpsNavigationMessage mNavigationMessage; /** Loading @@ -42,7 +57,16 @@ public class GpsNavigationMessageEvent implements Parcelable { * @hide */ public interface Listener { /** * Returns the latest collected GPS Navigation Message. */ void onGpsNavigationMessageReceived(GpsNavigationMessageEvent event); /** * Returns the latest status of the GPS Navigation Messages sub-system. */ void onStatusChanged(int status); } public GpsNavigationMessageEvent(GpsNavigationMessage message) { Loading
location/java/android/location/GpsNavigationMessageListenerTransport.java +14 −4 Original line number Diff line number Diff line Loading @@ -26,7 +26,6 @@ import android.os.RemoteException; */ class GpsNavigationMessageListenerTransport extends LocalListenerHelper<GpsNavigationMessageEvent.Listener> { private final Context mContext; private final ILocationManager mLocationManager; private final IGpsNavigationMessageListener mListenerTransport = new ListenerTransport(); Loading @@ -34,8 +33,7 @@ class GpsNavigationMessageListenerTransport public GpsNavigationMessageListenerTransport( Context context, ILocationManager locationManager) { super("GpsNavigationMessageListenerTransport"); mContext = context; super(context, "GpsNavigationMessageListenerTransport"); mLocationManager = locationManager; } Loading @@ -43,7 +41,7 @@ class GpsNavigationMessageListenerTransport protected boolean registerWithServer() throws RemoteException { return mLocationManager.addGpsNavigationMessageListener( mListenerTransport, mContext.getPackageName()); getContext().getPackageName()); } @Override Loading @@ -62,7 +60,19 @@ class GpsNavigationMessageListenerTransport listener.onGpsNavigationMessageReceived(event); } }; foreach(operation); } @Override public void onStatusChanged(final int status) { ListenerOperation<GpsNavigationMessageEvent.Listener> operation = new ListenerOperation<GpsNavigationMessageEvent.Listener>() { @Override public void execute(GpsNavigationMessageEvent.Listener listener) throws RemoteException { listener.onStatusChanged(status); } }; foreach(operation); } } Loading
location/java/android/location/IGpsMeasurementsListener.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -23,4 +23,5 @@ import android.location.GpsMeasurementsEvent; */ oneway interface IGpsMeasurementsListener { void onGpsMeasurementsReceived(in GpsMeasurementsEvent event); void onStatusChanged(in int status); }