Merge "Camera3: Document behavior of flush() corner cases." into mnc-dev
diff --git a/include/hardware/fingerprint.h b/include/hardware/fingerprint.h
index 1fb803a..fd0d8f3 100644
--- a/include/hardware/fingerprint.h
+++ b/include/hardware/fingerprint.h
@@ -89,7 +89,7 @@
 } fingerprint_msg_t;
 
 /* Callback function type */
-typedef void (*fingerprint_notify_t)(fingerprint_msg_t msg);
+typedef void (*fingerprint_notify_t)(const fingerprint_msg_t *msg);
 
 /* Synchronous operation */
 typedef struct fingerprint_device {
@@ -174,16 +174,16 @@
 
     /*
      * Fingerprint remove request:
-     * deletes a fingerprint template or a previously selected group.
-     * If the fingerprint id is 0 then the entire group is removed.
-     * notify() will be called for each template deleted with
+     * Deletes a fingerprint template.
+     * Works only within a path set by set_active_group().
+     * notify() will be called with details on the template deleted.
      * fingerprint_msg.type == FINGERPRINT_TEMPLATE_REMOVED and
-     * fingerprint_msg.data.removed.id indicating each template id removed.
+     * fingerprint_msg.data.removed.id indicating the template id removed.
      *
      * Function return: 0 if fingerprint template(s) can be successfully deleted
      *                 -1 otherwise.
      */
-    int (*remove)(struct fingerprint_device *dev, fingerprint_finger_id_t finger);
+    int (*remove)(struct fingerprint_device *dev, uint32_t gid, uint32_t fid);
 
     /*
      * Restricts the HAL operation to a set of fingerprints belonging to a
diff --git a/modules/fingerprint/fingerprint.c b/modules/fingerprint/fingerprint.c
index e81b182..08b112b 100644
--- a/modules/fingerprint/fingerprint.c
+++ b/modules/fingerprint/fingerprint.c
@@ -53,7 +53,7 @@
 }
 
 static int fingerprint_remove(struct fingerprint_device __unused *dev,
-                                fingerprint_finger_id_t __unused fingerprint_id) {
+                                uint32_t __unused gid, uint32_t __unused fid) {
     return FINGERPRINT_ERROR;
 }
 
diff --git a/modules/usbaudio/audio_hal.c b/modules/usbaudio/audio_hal.c
index 5431476..872fa93 100644
--- a/modules/usbaudio/audio_hal.c
+++ b/modules/usbaudio/audio_hal.c
@@ -55,6 +55,8 @@
 
 #define DEFAULT_INPUT_BUFFER_SIZE_MS 20
 
+// stereo channel count
+#define FCC_2 2
 // fixed channel count of 8 limitation (for data processing in AudioFlinger)
 #define FCC_8 8
 
@@ -528,10 +530,14 @@
         proposed_channel_count =  profile_get_default_channel_count(out->profile);
     }
     if (proposed_channel_count != 0) {
-        config->channel_mask = audio_channel_out_mask_from_count(proposed_channel_count);
-        if (config->channel_mask == AUDIO_CHANNEL_INVALID)
+        if (proposed_channel_count <= FCC_2) {
+            // use channel position mask for mono and stereo
+            config->channel_mask = audio_channel_out_mask_from_count(proposed_channel_count);
+        } else {
+            // use channel index mask for multichannel
             config->channel_mask =
                     audio_channel_mask_for_index_assignment_from_count(proposed_channel_count);
+        }
         out->hal_channel_count = proposed_channel_count;
     } else {
         out->hal_channel_count = audio_channel_count_from_out_mask(config->channel_mask);