Add support for GPS measurement/navigation message capabilities.

b/16727892
b/16815124

The listeners are changed to receive statuses asynchronously, this is required because GPS HAL,
requires time to be notified of the capabilities it supports.

Change-Id: Ie69fdd629d8680341386a2c736bc851632dd2bda
This commit is contained in:
destradaa
2014-10-27 12:47:41 -07:00
parent b9eabc5c2b
commit 6568d709e7
15 changed files with 459 additions and 154 deletions

View File

@@ -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.
@@ -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;
/**
@@ -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) {