Merge "Add optional logging of input and output streams to the submix HAL."
diff --git a/include/hardware/activity_recognition.h b/include/hardware/activity_recognition.h
index ecac856..6ae90b7 100644
--- a/include/hardware/activity_recognition.h
+++ b/include/hardware/activity_recognition.h
@@ -44,19 +44,19 @@
*/
/* Reserved. get_supported_activities_list() should not return this activity. */
-#define DETECTED_ACTIVITY_RESERVED (0)
+#define ACTIVITY_RESERVED (0)
-#define DETECTED_ACTIVITY_IN_VEHICLE (1)
+#define ACTIVITY_IN_VEHICLE (1)
-#define DETECTED_ACTIVITY_ON_BICYCLE (2)
+#define ACTIVITY_ON_BICYCLE (2)
-#define DETECTED_ACTIVITY_WALKING (3)
+#define ACTIVITY_WALKING (3)
-#define DETECTED_ACTIVITY_RUNNING (4)
+#define ACTIVITY_RUNNING (4)
-#define DETECTED_ACTIVITY_STILL (5)
+#define ACTIVITY_STILL (5)
-#define DETECTED_ACTIVITY_TILTING (6)
+#define ACTIVITY_TILTING (6)
/* Values for activity_event.event_types. */
enum {
@@ -70,7 +70,7 @@
*
* A flush complete event should have the following parameters set.
* activity_event_t.event_type = ACTIVITY_EVENT_TYPE_FLUSH_COMPLETE
- * activity_event_t.detected_activity = DETECTED_ACTIVITY_RESERVED
+ * activity_event_t.activity = ACTIVITY_RESERVED
* activity_event_t.timestamp = 0
* activity_event_t.reserved = 0
* See (*flush)() for more details.
@@ -86,14 +86,14 @@
/*
* Each event is a separate activity with event_type indicating whether this activity has started
- * or ended. Eg event: (event_type="enter", detected_activity="ON_FOOT", timestamp)
+ * or ended. Eg event: (event_type="enter", activity="ON_FOOT", timestamp)
*/
typedef struct activity_event {
/* One of the ACTIVITY_EVENT_TYPE_* constants defined above. */
uint32_t event_type;
- /* Detected Activity. One of DETECTED_ACTIVITY_TYPE_* constants defined above. */
- int32_t detected_activity;
+ /* One of ACTIVITY_* constants defined above. */
+ uint32_t activity;
/* Time at which the transition/event has occurred in nanoseconds using elapsedRealTimeNano. */
int64_t timestamp;
@@ -113,7 +113,7 @@
/*
* List of all activities supported by this module. Each activity is represented as an integer.
- * Each value in the list is one of the DETECTED_ACTIVITY_* constants defined above. Return
+ * Each value in the list is one of the ACTIVITY_* constants defined above. Return
* value is the size of this list.
*/
int (*get_supported_activities_list)(struct activity_recognition_module* module,
@@ -127,7 +127,7 @@
// Memory allocated for the events can be reused after this method returns.
// events - Array of activity_event_t s that are reported.
// count - size of the array.
- void (*activity_callback)(const struct activity_recognition_device* dev,
+ void (*activity_callback)(const struct activity_recognition_callback_procs* procs,
const activity_event_t* events, int count);
} activity_recognition_callback_procs_t;
@@ -148,27 +148,31 @@
const activity_recognition_callback_procs_t* callback);
/*
- * Activates and deactivates monitoring of activity transitions. Activities need not be reported
- * as soon as they are detected. The detected activities are stored in a FIFO and reported in
- * batches when the "max_batch_report_latency" expires or when the batch FIFO is full. The
- * implementation should allow the AP to go into suspend mode while the activities are detected
- * and stored in the batch FIFO. Whenever events need to be reported (like when the FIFO is full
- * or when the max_batch_report_latency has expired for an activity, event pair), it should
- * wake_up the AP so that no events are lost. Activities are stored as transitions and they are
- * allowed to overlap with each other.
- * detected_activity - The specific activity that needs to be monitored.
- * event_type - Specific transition of the activity that needs to be monitored.
- * enabled - Enable/Disable detection of an (detected_activity, event_type) pair. Each
- * pair can be activated or deactivated independently of the other. The HAL
- * implementation needs to keep track of which pairs are currently active
- * and needs to detect only those activities.
- * max_batch_report_latency - a transition can be delayed by at most
- * “max_batch_report_latency” nanoseconds.
+ * Activates monitoring of activity transitions. Activities need not be reported as soon as they
+ * are detected. The detected activities are stored in a FIFO and reported in batches when the
+ * "max_batch_report_latency" expires or when the batch FIFO is full. The implementation should
+ * allow the AP to go into suspend mode while the activities are detected and stored in the
+ * batch FIFO. Whenever events need to be reported (like when the FIFO is full or when the
+ * max_batch_report_latency has expired for an activity, event pair), it should wake_up the AP
+ * so that no events are lost. Activities are stored as transitions and they are allowed to
+ * overlap with each other. Each (activity, event_type) pair can be activated or deactivated
+ * independently of the other. The HAL implementation needs to keep track of which pairs are
+ * currently active and needs to detect only those pairs.
+ *
+ * activity - The specific activity that needs to be detected.
+ * event_type - Specific transition of the activity that needs to be detected.
+ * max_batch_report_latency_ns - a transition can be delayed by at most
+ * “max_batch_report_latency” nanoseconds.
* Return 0 on success, negative errno code otherwise.
*/
- int (*monitor_activity_event)(const struct activity_recognition_device* dev,
- int32_t detected_activity, int32_t event_type, int64_t max_batch_report_latency_ns,
- int32_t enabled);
+ int (*enable_activity_event)(const struct activity_recognition_device* dev,
+ uint32_t activity, uint32_t event_type, int64_t max_batch_report_latency_ns);
+
+ /*
+ * Disables detection of a specific (activity, event_type) pair.
+ */
+ int (*disable_activity_event)(const struct activity_recognition_device* dev,
+ uint32_t activity, uint32_t event_type);
/*
* Flush all the batch FIFOs. Report all the activities that were stored in the FIFO so far as
@@ -180,7 +184,7 @@
int (*flush)(const struct activity_recognition_device* dev);
// Must be set to NULL.
- void (*reserved_procs[4])(void);
+ void (*reserved_procs[16 - 4])(void);
} activity_recognition_device_t;
static inline int activity_recognition_open(const hw_module_t* module,
diff --git a/include/hardware/fingerprint.h b/include/hardware/fingerprint.h
index c1e29ef..7f6fa28 100644
--- a/include/hardware/fingerprint.h
+++ b/include/hardware/fingerprint.h
@@ -37,11 +37,24 @@
typedef struct fingerprint_enroll {
uint32_t id;
/* samples_remaining goes from N (no data collected, but N scans needed)
- * to 0 (no more data is needed to build a template)
- * If HAL fails to decrement samples_remaining between calls the client
- * will declare template collection a failure and should abort the operation
- * by calling module->common.methods->close() */
- uint32_t samples_remaining;
+ * to 0 (no more data is needed to build a template).
+ * The progress indication may be augmented by a bitmap encoded indication
+ * of finger area that needs to be presented by the user.
+ * Bit numbers mapped to physical location:
+ *
+ * distal
+ * +-+-+-+
+ * |2|1|0|
+ * |5|4|3|
+ * medial |8|7|6| lateral
+ * |b|a|9|
+ * |e|d|c|
+ * +-+-+-+
+ * proximal
+ *
+ */
+ uint16_t data_collected_bmp;
+ uint16_t samples_remaining;
} fingerprint_enroll_t;
typedef struct fingerprint_removed {
@@ -50,7 +63,6 @@
typedef struct fingerprint_scanned {
uint32_t id; /* 0 is a special id and means no match */
- uint32_t confidence; /* Goes form 0 (no match) to 0xffffFFFF (100% sure) */
} fingerprint_scanned_t;
typedef struct fingerprint_msg {
@@ -92,6 +104,18 @@
int (*enroll)(struct fingerprint_device *dev, uint32_t timeout_sec);
/*
+ * Cancel fingerprint enroll request:
+ * Switches the HAL state machine back to accept a fingerprint scan mode.
+ * (fingerprint_msg.type == FINGERPRINT_TEMPLATE_ENROLLING &&
+ * fingerprint_msg.data.enroll.samples_remaining == 0)
+ * will indicate switch back to the scan mode.
+ *
+ * Function return: 0 if cancel request is accepted
+ * -1 otherwise.
+ */
+ int (*enroll_cancel)(struct fingerprint_device *dev);
+
+ /*
* Fingerprint remove request:
* deletes a fingerprint template.
* If the fingerprint id is 0 the entire template database will be removed.