Merge "Use requested sample rate when it matches device sample rate." am: c0a81b9dc6 am: 17c0d514dc am: 0ce9f75613 am: 2849bf8c2b am: 4f9f42113c am: 6fbde4bf3a

Original change: https://android-review.googlesource.com/c/platform/hardware/libhardware/+/2592208

Change-Id: I6f715776dd46ab67a25fea0dc7dcf10e963c0f5b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/modules/usbaudio/audio_hal.c b/modules/usbaudio/audio_hal.c
index 16065e2..57f523b 100644
--- a/modules/usbaudio/audio_hal.c
+++ b/modules/usbaudio/audio_hal.c
@@ -1514,6 +1514,8 @@
                     ret = 0;
                 }
             }
+        } else if (profile_is_sample_rate_valid(&device_info->profile, config->sample_rate)) {
+            in->config.rate = config->sample_rate;
         }
     } else if (profile_is_sample_rate_valid(&device_info->profile, config->sample_rate)) {
         in->config.rate = config->sample_rate;