Merge "Camera2/3 HAL test: cleanup deprecated keys" into lmp-mr1-dev
diff --git a/include/hardware/gps.h b/include/hardware/gps.h
index fff6402..e264cf5 100644
--- a/include/hardware/gps.h
+++ b/include/hardware/gps.h
@@ -318,6 +318,12 @@
/**
* Flags indicating the GPS measurement state.
+ * The expected behavior here is for GPS HAL to set all the flags that applies. For
+ * example, if the state for a satellite is only C/A code locked and bit synchronized,
+ * and there is still millisecond ambiguity, the state should be set as:
+ * GPS_MEASUREMENT_STATE_CODE_LOCK|GPS_MEASUREMENT_STATE_BIT_SYNC|GPS_MEASUREMENT_STATE_MSEC_AMBIGUOUS
+ * If GPS is still searching for a satellite, the corresponding state should be set to
+ * GPS_MEASUREMENT_STATE_UNKNOWN(0).
*/
typedef uint16_t GpsMeasurementState;
#define GPS_MEASUREMENT_STATE_UNKNOWN 0
@@ -325,6 +331,7 @@
#define GPS_MEASUREMENT_STATE_BIT_SYNC (1<<1)
#define GPS_MEASUREMENT_STATE_SUBFRAME_SYNC (1<<2)
#define GPS_MEASUREMENT_STATE_TOW_DECODED (1<<3)
+#define GPS_MEASUREMENT_STATE_MSEC_AMBIGUOUS (1<<4)
/**
* Flags indicating the Accumulated Delta Range's states.
@@ -336,7 +343,7 @@
#define GPS_ADR_STATE_CYCLE_SLIP (1<<2)
/**
- * Enumeration of available values to indicate the available GPS Natigation message types.
+ * Enumeration of available values to indicate the available GPS Navigation message types.
*/
typedef uint8_t GpsNavigationMessageType;
/** The message type is unknown. */
@@ -350,6 +357,19 @@
/** CNAV-2 message contained in the structure. */
#define GPS_NAVIGATION_MESSAGE_TYPE_CNAV2 4
+/**
+ * Status of Navigation Message
+ * When a message is received properly without any parity error in its navigation words, the
+ * status should be set to NAV_MESSAGE_STATUS_PARITY_PASSED. But if a message is received
+ * with words that failed parity check, but GPS is able to correct those words, the status
+ * should be set to NAV_MESSAGE_STATUS_PARITY_REBUILT.
+ * No need to send any navigation message that contains words with parity error and cannot be
+ * corrected.
+ */
+typedef uint16_t NavigationMessageStatus;
+#define NAV_MESSAGE_STATUS_UNKONW 0
+#define NAV_MESSAGE_STATUS_PARITY_PASSED (1<<0)
+#define NAV_MESSAGE_STATUS_PARITY_REBUILT (1<<1)
/**
* Name for the GPS XTRA interface.
@@ -1386,12 +1406,16 @@
* Received GPS Time-of-Week at the measurement time, in nanoseconds.
* The value is relative to the beginning of the current GPS week.
*
- * Given the sync state of GPS receiver, per each satellite, valid range for this field can be:
- * Searching : [ 0 ] : GPS_MEASUREMENT_STATE_UNKNOWN
- * Ranging code lock : [ 0 1ms ] : GPS_MEASUREMENT_STATE_CODE_LOCK is set
- * Bit sync : [ 0 20ms ] : GPS_MEASUREMENT_STATE_BIT_SYNC is set
- * Subframe sync : [ 0 6ms ] : GPS_MEASUREMENT_STATE_SUBFRAME_SYNC is set
- * TOW decoded : [ 0 1week ] : GPS_MEASUREMENT_STATE_TOW_DECODED is set
+ * Given the highest sync state that can be achieved, per each satellite, valid range for
+ * this field can be:
+ * Searching : [ 0 ] : GPS_MEASUREMENT_STATE_UNKNOWN
+ * C/A code lock : [ 0 1ms ] : GPS_MEASUREMENT_STATE_CODE_LOCK is set
+ * Bit sync : [ 0 20ms ] : GPS_MEASUREMENT_STATE_BIT_SYNC is set
+ * Subframe sync : [ 0 6s ] : GPS_MEASUREMENT_STATE_SUBFRAME_SYNC is set
+ * TOW decoded : [ 0 1week ] : GPS_MEASUREMENT_STATE_TOW_DECODED is set
+ *
+ * However, if there is any ambiguity in integer millisecond,
+ * GPS_MEASUREMENT_STATE_MSEC_AMBIGUOUS should be set accordingly, in the 'state' field.
*/
int64_t received_gps_tow_ns;
@@ -1681,6 +1705,13 @@
GpsNavigationMessageType type;
/**
+ * The status of the received navigation message.
+ * No need to send any navigation message that contains words with parity error and cannot be
+ * corrected.
+ */
+ NavigationMessageStatus status;
+
+ /**
* Message identifier.
* It provides an index so the complete Navigation Message can be assembled. i.e. fo L1 C/A
* subframe 4 and 5, this value corresponds to the 'frame id' of the navigation message.
diff --git a/include/hardware/power.h b/include/hardware/power.h
index dc33705..af7799e 100644
--- a/include/hardware/power.h
+++ b/include/hardware/power.h
@@ -27,6 +27,7 @@
#define POWER_MODULE_API_VERSION_0_1 HARDWARE_MODULE_API_VERSION(0, 1)
#define POWER_MODULE_API_VERSION_0_2 HARDWARE_MODULE_API_VERSION(0, 2)
+#define POWER_MODULE_API_VERSION_0_3 HARDWARE_MODULE_API_VERSION(0, 3)
/**
* The id of this module
@@ -48,6 +49,10 @@
POWER_HINT_LOW_POWER = 0x00000005
} power_hint_t;
+typedef enum {
+ POWER_FEATURE_DOUBLE_TAP_TO_WAKE = 0x00000001
+} feature_t;
+
/**
* Every hardware module must have a data structure named HAL_MODULE_INFO_SYM
* and the fields of this data structure must begin with hw_module_t
@@ -127,6 +132,21 @@
*/
void (*powerHint)(struct power_module *module, power_hint_t hint,
void *data);
+
+ /*
+ * (*setFeature) is called to turn on or off a particular feature
+ * depending on the state parameter. The possible features are:
+ *
+ * FEATURE_DOUBLE_TAP_TO_WAKE
+ *
+ * Enabling/Disabling this feature will allow/disallow the system
+ * to wake up by tapping the screen twice.
+ *
+ * availability: version 0.3
+ *
+ */
+ void (*setFeature)(struct power_module *module, feature_t feature, int state);
+
} power_module_t;