aaudio: convert I16 input to float
This allows an app that requests a LOW_LATENCY FLOAT INPUT stream
to get a FAST track when using Legacy mode.
This is needed because Legacy AudioRecord does not allow FAST for FLOAT
streams.
Bug: 38268031
Test: adb shell input_monitor -m1 -pl -f2
Test: adb shell input_monitor_callback -m1 -pl -f2
Test: On Pixel phones you should get actual performanceMode=12
Change-Id: Ia5879ff4904f50bbb5009a3fc058800e53770710
diff --git a/media/libaaudio/src/legacy/AudioStreamTrack.cpp b/media/libaaudio/src/legacy/AudioStreamTrack.cpp
index 023e8af..9653601 100644
--- a/media/libaaudio/src/legacy/AudioStreamTrack.cpp
+++ b/media/libaaudio/src/legacy/AudioStreamTrack.cpp
@@ -181,6 +181,7 @@
aaudio_format_t aaudioFormat =
AAudioConvert_androidToAAudioDataFormat(mAudioTrack->format());
setFormat(aaudioFormat);
+ setDeviceFormat(aaudioFormat);
int32_t actualSampleRate = mAudioTrack->getSampleRate();
ALOGW_IF(actualSampleRate != getSampleRate(),