Add annotations to create gnss-base.h
This is required to make sure that the constants in gps.h does not
ever go out of sync with the enums created out of them in the HAL
interface definition.
Test: mm
Change-Id: I103cf46d198e9f5de9e0cfd64f2795f0094ecb39
diff --git a/gnss/1.0/IAGnss.hal b/gnss/1.0/IAGnss.hal
index 2cce519..b8f5746 100644
--- a/gnss/1.0/IAGnss.hal
+++ b/gnss/1.0/IAGnss.hal
@@ -22,6 +22,7 @@
* Extended interface for AGNSS support.
*/
interface IAGnss {
+ @export(name="", value_prefix="APN_IP_")
enum ApnIpType : uint8_t {
INVALID = 0,
IPV4 = 1,
diff --git a/gnss/1.0/IAGnssCallback.hal b/gnss/1.0/IAGnssCallback.hal
index 1984725..fe2e101 100644
--- a/gnss/1.0/IAGnssCallback.hal
+++ b/gnss/1.0/IAGnssCallback.hal
@@ -19,11 +19,13 @@
/** Callback structure for the AGNSS interface. */
interface IAGnssCallback {
/** AGNSS type **/
+ @export(name="", value_prefix="AGPS_")
enum AGnssType : uint8_t {
TYPE_SUPL = 1,
TYPE_C2K = 2
};
+ @export(name="", value_prefix="GNSS_")
enum AGnssStatusValue : uint8_t {
/** GNSS requests data connection for AGNSS. */
REQUEST_AGNSS_DATA_CONN = 1,
@@ -40,6 +42,7 @@
/*
* Represents the status of AGNSS augmented to support IPv4.
*/
+ @export(name="", value_prefix="GPS_")
struct AGnssStatusIpV4 {
AGnssType type;
AGnssStatusValue status;
diff --git a/gnss/1.0/IAGnssRil.hal b/gnss/1.0/IAGnssRil.hal
index 499b874..6292273 100644
--- a/gnss/1.0/IAGnssRil.hal
+++ b/gnss/1.0/IAGnssRil.hal
@@ -25,12 +25,14 @@
* location, unique subscriber ID, phone number string and network availability changes.
*/
interface IAGnssRil {
+ @export(name="", value_prefix="AGPS_SETID_TYPE_")
enum SetIDType : uint8_t {
NONE = 0,
IMSI = 1,
MSISDM = 2
};
+ @export(name="", value_prefix="AGPS_RIL_NETWORK_TYPE_")
enum NetworkType : uint8_t {
MOBILE = 0,
WIFI = 1,
@@ -41,6 +43,7 @@
WIMAX = 6,
};
+ @export(name="", value_prefix="AGPS_REF_LOCATION_TYPE_")
enum AGnssRefLocationType : uint8_t {
GSM_CELLID = 1,
UMTS_CELLID = 2,
diff --git a/gnss/1.0/IAGnssRilCallback.hal b/gnss/1.0/IAGnssRilCallback.hal
index ba29bd0..2d64e54 100644
--- a/gnss/1.0/IAGnssRilCallback.hal
+++ b/gnss/1.0/IAGnssRilCallback.hal
@@ -22,6 +22,7 @@
*/
interface IAGnssRilCallback {
/* Kinds of SET ID that can be requested */
+ @export(name="", value_prefix="AGPS_RIL_REQUEST_SETID_")
enum ID : uint32_t {
IMSI = 1 << 0L,
MSISDN = 1 << 1L,
diff --git a/gnss/1.0/IGnss.hal b/gnss/1.0/IGnss.hal
index 24a5371..5cde79e 100644
--- a/gnss/1.0/IGnss.hal
+++ b/gnss/1.0/IGnss.hal
@@ -28,9 +28,10 @@
import IGnssNi;
import IGnssXtra;
-/* Represents the standard GNSS interface. */
+/* Represents the standard GNSS (Global Navigation Satellite System) interface. */
interface IGnss {
/* Requested operational mode for GNSS operation. */
+ @export(name="", value_prefix="GPS_POSITION_MODE_")
enum GnssPositionMode : uint8_t {
/** Mode for running GNSS standalone (no assistance). */
STANDALONE = 0,
@@ -44,6 +45,7 @@
};
/* Requested recurrence mode for GNSS operation. */
+ @export(name="", value_prefix="GPS_POSITION_")
enum GnssPositionRecurrence : uint32_t {
/** Receive GNSS fixes on a recurring basis at a specified period. */
RECURRENCE_PERIODIC = 0,
@@ -55,6 +57,7 @@
* Flags used to specify which aiding data to delete when calling
* deleteAidingData().
*/
+ @export(name="", value_prefix="GPS_")
enum GnssAidingData : uint16_t {
DELETE_EPHEMERIS = 0x0001,
DELETE_ALMANAC = 0x0002,
diff --git a/gnss/1.0/IGnssBatching.hal b/gnss/1.0/IGnssBatching.hal
index 4f0695d..4d5affa 100644
--- a/gnss/1.0/IGnssBatching.hal
+++ b/gnss/1.0/IGnssBatching.hal
@@ -42,6 +42,7 @@
/*
* Enum which holds the bit masks for batching control.
*/
+ @export(name="", value_prefix="FLP_BATCH_")
enum Flag : uint8_t {
/*
* If this flag is set, the hardware implementation
diff --git a/gnss/1.0/IGnssCallback.hal b/gnss/1.0/IGnssCallback.hal
index eb66d78..1fe48f1 100644
--- a/gnss/1.0/IGnssCallback.hal
+++ b/gnss/1.0/IGnssCallback.hal
@@ -23,6 +23,7 @@
*/
interface IGnssCallback {
/* Flags for the gnssSetCapabilities callback. */
+ @export(name="", value_prefix="GPS_CAPABILITY_")
enum Capabilities : uint32_t {
/*
* GNSS HAL schedules fixes for RECURRENCE_PERIODIC mode.
@@ -47,6 +48,7 @@
};
/* GNSS status event values. */
+ @export(name="", value_prefix="GPS_STATUS_")
enum GnssStatusValue : uint8_t {
/** GNSS status unknown. */
NONE = 0,
@@ -63,6 +65,7 @@
/*
* Flags that indicate information about the satellite
*/
+ @export(name="", value_prefix="GNSS_SV_FLAGS_")
enum GnssSvFlags : uint8_t {
NONE = 0,
HAS_EPHEMERIS_DATA = 1 << 0,
diff --git a/gnss/1.0/IGnssGeofenceCallback.hal b/gnss/1.0/IGnssGeofenceCallback.hal
index 5c70c5e..722317e 100644
--- a/gnss/1.0/IGnssGeofenceCallback.hal
+++ b/gnss/1.0/IGnssGeofenceCallback.hal
@@ -91,17 +91,20 @@
*/
interface IGnssGeofenceCallback {
+ @export(name="", value_prefix="GPS_GEOFENCE_")
enum GeofenceTransition : int32_t {
ENTERED = (1 << 0L),
EXITED = (1 << 1L),
UNCERTAIN = (1 << 2L),
};
+ @export(name="", value_prefix="GPS_GEOFENCE_")
enum GeofenceAvailability : int32_t {
UNAVAILABLE = (1 << 0L),
AVAILABLE = (1 << 1L),
};
+ @export(name="", value_prefix="GPS_GEOFENCE_")
enum GeofenceStatus : int32_t {
OPERATION_SUCCESS = 0,
ERROR_TOO_MANY_GEOFENCES = -100,
diff --git a/gnss/1.0/IGnssMeasurement.hal b/gnss/1.0/IGnssMeasurement.hal
index 5174273..8329442 100644
--- a/gnss/1.0/IGnssMeasurement.hal
+++ b/gnss/1.0/IGnssMeasurement.hal
@@ -22,6 +22,7 @@
* Extended interface for GNSS Measurements support.
*/
interface IGnssMeasurement {
+ @export(name="", value_prefix="GPS_MEASUREMENT_")
enum GnssMeasurementStatus : int32_t {
SUCCESS = 0,
ERROR_ALREADY_INIT = -100,
diff --git a/gnss/1.0/IGnssMeasurementCallback.hal b/gnss/1.0/IGnssMeasurementCallback.hal
index de640ae..472583a 100644
--- a/gnss/1.0/IGnssMeasurementCallback.hal
+++ b/gnss/1.0/IGnssMeasurementCallback.hal
@@ -21,6 +21,7 @@
/*
* Flags to indicate what fields in GnssClock are valid.
*/
+ @export(name="", value_prefix="GNSS_CLOCK_")
enum GnssClockFlags : uint16_t {
/** A valid 'leap second' is stored in the data structure. */
HAS_LEAP_SECOND = 1 << 0,
@@ -41,6 +42,7 @@
/*
* Flags to indicate what fields in GnssMeasurement are valid.
*/
+ @export(name="", value_prefix="GNSS_MEASUREMENT_")
enum GnssMeasurementFlags : uint32_t {
/** A valid 'snr' is stored in the data structure. */
HAS_SNR = 1 << 0,
@@ -60,6 +62,7 @@
* Enumeration of available values for the GNSS Measurement's multipath
* indicator.
*/
+ @export(name="", value_prefix="GNSS_MULTIPATH_")
enum GnssMultipathIndicator : uint8_t {
/** The indicator is not available or unknown. */
INDICATOR_UNKNOWN = 0,
@@ -82,6 +85,7 @@
* If GNSS is still searching for a satellite, the corresponding state must be
* set to STATE_UNKNOWN(0).
*/
+ @export(name="", value_prefix="GNSS_MEASUREMENT_")
enum GnssMeasurementState : uint32_t {
STATE_UNKNOWN = 0,
STATE_CODE_LOCK = 1 << 0,
@@ -105,6 +109,7 @@
/*
* Flags indicating the Accumulated Delta Range's states.
*/
+ @export(name="", value_prefix="GNSS_")
enum GnssAccumulatedDeltaRangeState : uint16_t {
ADR_STATE_UNKNOWN = 0,
ADR_STATE_VALID = 1 << 0,
diff --git a/gnss/1.0/IGnssNavigationMessage.hal b/gnss/1.0/IGnssNavigationMessage.hal
index 11f2096..ddd9169 100644
--- a/gnss/1.0/IGnssNavigationMessage.hal
+++ b/gnss/1.0/IGnssNavigationMessage.hal
@@ -22,6 +22,7 @@
* Extended interface for GNSS navigation message reporting support.
*/
interface IGnssNavigationMessage {
+ @export(name="", value_prefix="GPS_NAVIGATION_MESSAGE_")
enum GnssNavigationMessageStatus : int32_t {
SUCCESS = 0,
ERROR_ALREADY_INIT = -100,
diff --git a/gnss/1.0/IGnssNavigationMessageCallback.hal b/gnss/1.0/IGnssNavigationMessageCallback.hal
index 0cffa67..2e6b853 100644
--- a/gnss/1.0/IGnssNavigationMessageCallback.hal
+++ b/gnss/1.0/IGnssNavigationMessageCallback.hal
@@ -25,6 +25,7 @@
* For convenience, first byte is the GnssConstellationType on which that signal
* is typically transmitted.
*/
+ @export(name="", value_prefix="GNSS_NAVIGATION_MESSAGE_TYPE_")
enum GnssNavigationMessageType : int16_t {
UNKNOWN = 0,
/** GNSS L1 C/A message contained in the structure. */
@@ -56,6 +57,7 @@
* No need to send any navigation message that contains words with parity error
* and cannot be corrected.
*/
+ @export(name="navigation_message_status", value_prefix="NAV_MESSAGE_STATUS_")
enum NavigationMessageStatus : uint16_t {
PARITY_PASSED = (1 << 0),
PARITY_REBUILT = (1 << 1),
diff --git a/gnss/1.0/IGnssNiCallback.hal b/gnss/1.0/IGnssNiCallback.hal
index a7abad9..c5fb223 100644
--- a/gnss/1.0/IGnssNiCallback.hal
+++ b/gnss/1.0/IGnssNiCallback.hal
@@ -21,6 +21,7 @@
/*
* GnssNiType constants
*/
+ @export(name="", value_prefix="GPS_NI_TYPE_")
enum GnssNiType : uint8_t {
VOICE = 1,
UMTS_SUPL = 2,
@@ -30,6 +31,7 @@
/*
* GnssNiNotifyFlags constants
*/
+ @export(name="", value_prefix="GPS_NI_")
enum GnssNiNotifyFlags : uint32_t {
/** NI requires notification */
NEED_NOTIFY = 0x0001,
@@ -43,6 +45,7 @@
* GNSS NI responses, used to define the response in
* NI structures
*/
+ @export(name="", value_prefix="GPS_NI_")
enum GnssUserResponseType : uint8_t {
RESPONSE_ACCEPT = 1,
RESPONSE_DENY = 2,
@@ -52,6 +55,7 @@
/*
* NI data encoding scheme
*/
+ @export(name="", value_prefix="GPS_")
enum GnssNiEncodingType : int32_t {
ENC_NONE = 0,
ENC_SUPL_GSM_DEFAULT = 1,
diff --git a/gnss/1.0/types.hal b/gnss/1.0/types.hal
index 2721d44..d5e0e9b 100644
--- a/gnss/1.0/types.hal
+++ b/gnss/1.0/types.hal
@@ -16,6 +16,7 @@
package android.hardware.gnss@1.0;
+@export(name="", value_prefix="GNSS_MAX_")
enum GnssMax : uint32_t {
/** Maximum number of SVs for gnssSvStatusCb(). */
SVS_COUNT = 64,
@@ -27,6 +28,8 @@
/*
* Constellation type of GnssSvInfo
*/
+
+@export(name="", value_prefix="GNSS_CONSTELLATION_")
enum GnssConstellationType : uint8_t {
UNKNOWN = 0,
GPS = 1,
@@ -38,6 +41,7 @@
};
/** Bit mask to indicate which values are valid in a GnssLocation object. */
+@export(name="", value_prefix="GPS_LOCATION_")
enum GnssLocationFlags : uint16_t {
/** GnssLocation has valid latitude and longitude. */
HAS_LAT_LONG = 0x0001,
diff --git a/update-base-files.sh b/update-base-files.sh
index e2331f5..1eb6b51 100755
--- a/update-base-files.sh
+++ b/update-base-files.sh
@@ -25,6 +25,9 @@
hidl-gen $options \
-o hardware/libhardware/include/hardware/nfc-base.h \
android.hardware.nfc@1.0
+hidl-gen $options \
+ -o hardware/libhardware/include/hardware/gnss-base.h \
+ android.hardware.gnss@1.0
# system/core
hidl-gen $options \