Gnss Hal Minor Cleanup
Enum sizes and names cleaned up, fixed errors in comments,
cleaned up some variable names.
Also removed AGnssRefLocation since it appears to be unused.
Bug:31974439
Test: mm
Change-Id: I88f43caac5ce9c7137e28b29ba55ea330786745f
diff --git a/gnss/1.0/IAGnss.hal b/gnss/1.0/IAGnss.hal
index a3172f3..2cce519 100644
--- a/gnss/1.0/IAGnss.hal
+++ b/gnss/1.0/IAGnss.hal
@@ -22,7 +22,7 @@
* Extended interface for AGNSS support.
*/
interface IAGnss {
- enum ApnIpType : uint16_t {
+ enum ApnIpType : uint8_t {
INVALID = 0,
IPV4 = 1,
IPV6 = 2,
@@ -72,6 +72,6 @@
*
* @return success True if the operation is successful.
*/
- dataConnOpenWithApnIpType(string apn, ApnIpType apnIpType)
+ dataConnOpen(string apn, ApnIpType apnIpType)
generates (bool success);
};
diff --git a/gnss/1.0/IAGnssCallback.hal b/gnss/1.0/IAGnssCallback.hal
index 46641be..1984725 100644
--- a/gnss/1.0/IAGnssCallback.hal
+++ b/gnss/1.0/IAGnssCallback.hal
@@ -19,12 +19,12 @@
/** Callback structure for the AGNSS interface. */
interface IAGnssCallback {
/** AGNSS type **/
- enum AGnssType : uint16_t {
+ enum AGnssType : uint8_t {
TYPE_SUPL = 1,
TYPE_C2K = 2
};
- enum AGnssStatusValue : uint16_t {
+ enum AGnssStatusValue : uint8_t {
/** GNSS requests data connection for AGNSS. */
REQUEST_AGNSS_DATA_CONN = 1,
/** GNSS releases the AGNSS data connection. */
diff --git a/gnss/1.0/IAGnssRil.hal b/gnss/1.0/IAGnssRil.hal
index 7363d46..499b874 100644
--- a/gnss/1.0/IAGnssRil.hal
+++ b/gnss/1.0/IAGnssRil.hal
@@ -25,13 +25,13 @@
* location, unique subscriber ID, phone number string and network availability changes.
*/
interface IAGnssRil {
- enum SetIDType : uint16_t {
+ enum SetIDType : uint8_t {
NONE = 0,
IMSI = 1,
MSISDM = 2
};
- enum NetworkType : int32_t {
+ enum NetworkType : uint8_t {
MOBILE = 0,
WIFI = 1,
MMS = 2,
@@ -41,10 +41,9 @@
WIMAX = 6,
};
- enum AGnssRefLocationType : int32_t {
+ enum AGnssRefLocationType : uint8_t {
GSM_CELLID = 1,
UMTS_CELLID = 2,
- MAC = 3,
LTE_CELLID = 4,
};
@@ -75,20 +74,11 @@
uint16_t pcid;
};
- struct AGnssRefLocationMac {
- uint8_t[6] mac;
- };
-
/* Represents ref locations */
struct AGnssRefLocation {
AGnssRefLocationType type;
- union RefLoc {
- AGnssRefLocationCellID cellID;
- AGnssRefLocationMac mac;
- };
-
- RefLoc refLocVal;
+ AGnssRefLocationCellID cellID;
};
/*
@@ -102,7 +92,7 @@
/*
* Sets the reference location.
*
- * @param agnssReflocation AGNSS reference location CellID/MAC.
+ * @param agnssReflocation AGNSS reference location CellID.
*/
setRefLocation(AGnssRefLocation agnssReflocation);
diff --git a/gnss/1.0/IAGnssRilCallback.hal b/gnss/1.0/IAGnssRilCallback.hal
index 6f29820..17122b2 100644
--- a/gnss/1.0/IAGnssRilCallback.hal
+++ b/gnss/1.0/IAGnssRilCallback.hal
@@ -27,12 +27,6 @@
MSISDN = 1 << 1L,
};
- /* Kinds of reference location that can be requested. */
- enum RefLoc : uint32_t {
- CELLID = 1 << 0L,
- MAC = 1 << 1L
- };
-
/*
* The Hal uses this API to request a SET ID.
*
@@ -43,9 +37,7 @@
/*
* The Hal uses this API to request a reference location.
*
- * @param refLocflag Specifies the kind of reference location that is required
- * by the HAL.
*/
- requestRefLocCb(RefLoc refLocflag);
+ requestRefLocCb();
};
diff --git a/gnss/1.0/IGnss.hal b/gnss/1.0/IGnss.hal
index bc19e78..026cabd 100644
--- a/gnss/1.0/IGnss.hal
+++ b/gnss/1.0/IGnss.hal
@@ -29,7 +29,7 @@
/* Represents the standard GNSS interface. */
interface IGnss {
/* Requested operational mode for GNSS operation. */
- enum GnssPositionMode : uint32_t {
+ enum GnssPositionMode : uint8_t {
/** Mode for running GNSS standalone (no assistance). */
STANDALONE = 0,
/** AGNSS MS-Based mode. */
@@ -110,7 +110,7 @@
* time. Represented in milliseconds.
*
* @return success Returns true if the operation is successful.
- *
+ */
injectTime(GnssUtcTime timeMs, int64_t timeReferenceMs, int32_t uncertaintyMs)
generates (bool success);
@@ -137,6 +137,9 @@
deleteAidingData(GnssAidingData aidingDataFlags);
/*
+ * Sets the GnssPositionMode parameter,its associated recurrence value,
+ * the time between fixes,requested fix accuracy and time to first fix.
+ *
* @param mode Parameter must be one of MS_BASED or STANDALONE.
* It is allowed by the platform (and it is recommended) to fallback to
* MS_BASED if MS_ASSISTED is passed in, and MS_BASED is supported.
@@ -155,56 +158,56 @@
/*
* This method returns the IAGnssRil Interface.
*
- * @return infc Handle to the IAGnssRil interface.
+ * @return aGnssRilIface Handle to the IAGnssRil interface.
*/
- getExtensionAGnssRil() generates (IAGnssRil infc);
+ getExtensionAGnssRil() generates (IAGnssRil aGnssRilIface);
/*
* This method returns the IGnssGeofencing Interface.
*
- * @return infc Handle to the IGnssGeofencing interface.
+ * @return gnssGeofencingIface Handle to the IGnssGeofencing interface.
*/
- getExtensionGnssGeofencing() generates(IGnssGeofencing infc);
+ getExtensionGnssGeofencing() generates(IGnssGeofencing gnssGeofencingIface);
/*
* This method returns the IAGnss Interface.
*
- * @return infc Handle to the IAGnss interface.
+ * @return aGnssIface Handle to the IAGnss interface.
*/
- getExtensionAGnss() generates (IAGnss infc);
+ getExtensionAGnss() generates (IAGnss aGnssIface);
/*
* This method returns the IGnssNi interface.
*
- * @return infc Handle to the IGnssNi interface.
+ * @return gnssNiIface Handle to the IGnssNi interface.
*/
- getExtensionGnssNi() generates (IGnssNi infc);
+ getExtensionGnssNi() generates (IGnssNi gnssNiIface);
/*
* This method returns the IGnssMeasurement interface.
*
- * @return infc Handle to the IGnssMeasurement interface.
+ * @return gnssMeasurementIface Handle to the IGnssMeasurement interface.
*/
- getExtensionGnssMeasurement() generates (IGnssMeasurement infc);
+ getExtensionGnssMeasurement() generates (IGnssMeasurement gnssMeasurementIface);
/*
* This method returns the IGnssNavigationMessage interface.
*
- * @return infc Handle to the IGnssNavigationMessage interface.
+ * @return gnssNavigationIface gnssNavigationIface to the IGnssNavigationMessage interface.
*/
- getExtensionGnssNavigationMessage() generates (IGnssNavigationMessage infc);
+ getExtensionGnssNavigationMessage() generates (IGnssNavigationMessage gnssNavigationIface);
/*
* This method returns the IGnssXtra interface.
*
- * @return infc Handle to the IGnssXtra interface.
+ * @return xtraIface Handle to the IGnssXtra interface.
*/
- getExtensionXtra() generates (IGnssXtra infc);
+ getExtensionXtra() generates (IGnssXtra xtraIface);
/*
* This method returns the IGnssDebug interface.
*
- * @return infc Handle to the IGnssDebug interface.
+ * @return debugIface Handle to the IGnssDebug interface.
*/
- getExtensionGnssDebug() generates (IGnssDebug infc);
+ getExtensionGnssDebug() generates (IGnssDebug debugIface);
};
diff --git a/gnss/1.0/IGnssCallback.hal b/gnss/1.0/IGnssCallback.hal
index 5234688..041f949 100644
--- a/gnss/1.0/IGnssCallback.hal
+++ b/gnss/1.0/IGnssCallback.hal
@@ -47,9 +47,9 @@
};
/* GNSS status event values. */
- enum GnssStatusValue : uint16_t {
+ enum GnssStatusValue : uint8_t {
/** GNSS status unknown. */
- STATUS_NONE = 0,
+ NONE = 0,
/** GNSS has begun navigating. */
SESSION_BEGIN = 1,
/** GNSS has stopped navigating. */
@@ -64,7 +64,7 @@
* Flags that indicate information about the satellite
*/
enum GnssSvFlags : uint8_t {
- FLAGS_NONE = 0,
+ NONE = 0,
HAS_EPHEMERIS_DATA = 1 << 0,
HAS_ALMANAC_DATA = 1 << 1,
USED_IN_FIX = 1 << 2
@@ -121,13 +121,13 @@
/*
* Number of GNSS SVs currently visible, refers to the SVs stored in sv_list
*/
- int32_t numSvs;
+ uint32_t numSvs;
/*
* Pointer to an array of SVs information for all GNSS constellations,
* except GNSS, which is reported using svList
*/
- GnssSvInfo[ConstS32:GNSS_MAX_SVS] gnssSvList;
+ GnssSvInfo[GnssMax:SVS_COUNT] gnssSvList;
};
diff --git a/gnss/1.0/IGnssDebug.hal b/gnss/1.0/IGnssDebug.hal
index b0ac69d..ff9ea9f 100644
--- a/gnss/1.0/IGnssDebug.hal
+++ b/gnss/1.0/IGnssDebug.hal
@@ -2,7 +2,7 @@
/* Extended interface for DEBUG support. */
interface IGnssDebug {
- enum SatelliteEphemerisType : uint32_t {
+ enum SatelliteEphemerisType : uint8_t {
/* no information is known to the gnss hardware, about this satellite */
UNKNOWN,
/* this satellite is known to exist */
@@ -37,14 +37,14 @@
/*
* Validity of the data in this struct. False only if no
* latitude/longitude information is known.
- * /
+ */
bool valid;
/* Latitude expressed in degrees */
double latitudeDegrees;
/* Longitude expressed in degrees */
double longitudeDegrees;
/* Altitude above ellipsoid expressed in meters */
- float altitudeDegrees;
+ float altitudeMeters;
/*
* estimated horizontal accuracy of position expressed in meters, radial,
* 68% confidence.
diff --git a/gnss/1.0/IGnssGeofenceCallback.hal b/gnss/1.0/IGnssGeofenceCallback.hal
index 06eb62a..5c70c5e 100644
--- a/gnss/1.0/IGnssGeofenceCallback.hal
+++ b/gnss/1.0/IGnssGeofenceCallback.hal
@@ -69,7 +69,7 @@
* addGeofenceArea method.
*
* Even though the diagram and explanation talks about states and transitions,
- * the callee is only interested in the transistions. The states are mentioned
+ * the callee is only interested in the transitions. The states are mentioned
* here for illustrative purposes.
*
* Startup Scenario: When the device boots up, if an application adds geofences,
diff --git a/gnss/1.0/IGnssGeofencing.hal b/gnss/1.0/IGnssGeofencing.hal
index 89301f4..8417333 100644
--- a/gnss/1.0/IGnssGeofencing.hal
+++ b/gnss/1.0/IGnssGeofencing.hal
@@ -53,7 +53,7 @@
* @param unknownTimerMs - The time limit after which the UNCERTAIN transition
* must be triggered. This parameter is defined in milliseconds.
*/
- addGeofenceArea(int32_t geofenceId, double latitudeDegrees, double longitudeDegrees,
+ addGeofence(int32_t geofenceId, double latitudeDegrees, double longitudeDegrees,
double radiusMeters, GeofenceTransition lastTransition,
int32_t monitorTransitions, uint32_t notificationResponsivenessMs,
uint32_t unknownTimerMs);
@@ -82,5 +82,5 @@
*
* @param geofenceId The id of the geofence.
*/
- removeGeofenceArea(int32_t geofenceId);
+ removeGeofence(int32_t geofenceId);
};
diff --git a/gnss/1.0/IGnssMeasurement.hal b/gnss/1.0/IGnssMeasurement.hal
index 5156b32..5174273 100644
--- a/gnss/1.0/IGnssMeasurement.hal
+++ b/gnss/1.0/IGnssMeasurement.hal
@@ -43,7 +43,7 @@
* Returns ERROR_GENERIC for any other error. The HAL must
* not generate any other updates upon returning this error code.
*/
- setCallback(IGnssMeasurementCallback callback) generates (int32_t initRet);
+ setCallback(IGnssMeasurementCallback callback) generates (GnssMeasurementStatus initRet);
/*
* Stops updates from the HAL, and unregisters the callback routines.
diff --git a/gnss/1.0/IGnssMeasurementCallback.hal b/gnss/1.0/IGnssMeasurementCallback.hal
index 3650892..cc34c91 100644
--- a/gnss/1.0/IGnssMeasurementCallback.hal
+++ b/gnss/1.0/IGnssMeasurementCallback.hal
@@ -539,7 +539,7 @@
uint32_t measurementCount;
/* The array of measurements. */
- GnssMeasurement[ConstS32:GNSS_MAX_MEASUREMENT] measurements;
+ GnssMeasurement[GnssMax:SVS_COUNT] measurements;
/** The GNSS clock time reading. */
GnssClock clock;
diff --git a/gnss/1.0/IGnssNavigationMessage.hal b/gnss/1.0/IGnssNavigationMessage.hal
index d59b538..11f2096 100644
--- a/gnss/1.0/IGnssNavigationMessage.hal
+++ b/gnss/1.0/IGnssNavigationMessage.hal
@@ -42,7 +42,7 @@
* expected that the HAL will not generate any updates upon returning
* this error code.
*/
- setCallback(IGnssNavigationMessageCallback callback) generates (int32_t initRet);
+ setCallback(IGnssNavigationMessageCallback callback) generates (GnssNavigationMessageStatus initRet);
/*
* Stops updates from the HAL, and unregisters the callback routines.
diff --git a/gnss/1.0/IGnssNavigationMessageCallback.hal b/gnss/1.0/IGnssNavigationMessageCallback.hal
index a714fd7..6988c9a 100644
--- a/gnss/1.0/IGnssNavigationMessageCallback.hal
+++ b/gnss/1.0/IGnssNavigationMessageCallback.hal
@@ -26,7 +26,7 @@
* is typically transmitted.
*/
enum GnssNavigationMessageType : int16_t {
- TYPE_UNKNOWN = 0,
+ UNKNOWN = 0,
/** GNSS L1 C/A message contained in the structure. */
GNSS_L1CA = 0x0101,
/** GNSS L2-CNAV message contained in the structure. */
@@ -59,7 +59,7 @@
enum NavigationMessageStatus : uint16_t {
PARITY_PASSED = (1 << 0),
PARITY_REBUILT = (1 << 1),
- STATUS_UNKOWN = 0
+ UNKNOWN = 0
};
struct GnssNavigationMessage {
diff --git a/gnss/1.0/IGnssNiCallback.hal b/gnss/1.0/IGnssNiCallback.hal
index c696a92..f23b354 100644
--- a/gnss/1.0/IGnssNiCallback.hal
+++ b/gnss/1.0/IGnssNiCallback.hal
@@ -21,7 +21,7 @@
/*
* GnssNiType constants
*/
- enum GnssNiType : uint32_t {
+ enum GnssNiType : uint8_t {
VOICE = 1,
UMTS_SUPL = 2,
UMTS_CTRL_PLANE = 3
@@ -43,7 +43,7 @@
* GNSS NI responses, used to define the response in
* NI structures
*/
- enum GnssUserResponseType : int32_t {
+ enum GnssUserResponseType : uint8_t {
RESPONSE_ACCEPT = 1,
RESPONSE_DENY = 2,
RESPONSE_NORESP = 3,
diff --git a/gnss/1.0/types.hal b/gnss/1.0/types.hal
index 3120648..ee35ca4 100644
--- a/gnss/1.0/types.hal
+++ b/gnss/1.0/types.hal
@@ -16,12 +16,9 @@
package android.hardware.gnss@1.0;
-enum ConstS32 : int32_t {
+enum GnssMax : uint32_t {
/** Maximum number of SVs for gnssSvStatusCb(). */
- GNSS_MAX_SVS = 64,
-
-/* Maximum number of Measurements in gnssMeasurementCb(). */
- GNSS_MAX_MEASUREMENT = 64,
+ SVS_COUNT = 64,
};
/* Milliseconds since January 1, 1970 */
@@ -32,7 +29,7 @@
*/
enum GnssConstellationType : uint8_t {
UNKNOWN = 0,
- GNSS = 1,
+ GPS = 1,
SBAS = 2,
GLONASS = 3,
QZSS = 4,
@@ -46,18 +43,18 @@
uint16_t gnssLocationFlags;
/* Represents latitude in degrees. */
- double latitude;
+ double latitudeDegrees;
/* Represents longitude in degrees. */
- double longitude;
+ double longitudeDegrees;
/*
* Represents altitude in meters above the WGS 84 reference ellipsoid.
*/
- double altitude;
+ double altitudeMeters;
/* Represents speed in meters per second. */
- float speedMetersperSec;
+ float speedMetersPerSec;
/* Represents heading in degrees. */
float bearingDegrees;