Add parameters validation on AAudio MMap server
Bug: 63384314
Test: adb shell /system/bin/write_sine -m -pl -n4 \
&& adb shell /system/bin/write_sine -pl -n4 \
&& adb shell /system/bin/write_sine_callback -m -pl -n4 \
&& adb shell /system/bin/write_sine_callback -pl -n4 \
&& adb shell /system/bin/CtsNativeMediaAAudioTestCases32
Change-Id: I462f956e8fc25eb583699af6389e0f299243eafb
diff --git a/services/oboeservice/AAudioServiceStreamShared.cpp b/services/oboeservice/AAudioServiceStreamShared.cpp
index fe488cb..5654113 100644
--- a/services/oboeservice/AAudioServiceStreamShared.cpp
+++ b/services/oboeservice/AAudioServiceStreamShared.cpp
@@ -112,7 +112,7 @@
}
// Is the request compatible with the shared endpoint?
- mAudioFormat = configurationInput.getAudioFormat();
+ mAudioFormat = configurationInput.getFormat();
if (mAudioFormat == AAUDIO_FORMAT_UNSPECIFIED) {
mAudioFormat = AAUDIO_FORMAT_PCM_FLOAT;
} else if (mAudioFormat != AAUDIO_FORMAT_PCM_FLOAT) {
@@ -169,7 +169,7 @@
// Fill in configuration for client.
configurationOutput.setSampleRate(mSampleRate);
configurationOutput.setSamplesPerFrame(mSamplesPerFrame);
- configurationOutput.setAudioFormat(mAudioFormat);
+ configurationOutput.setFormat(mAudioFormat);
configurationOutput.setDeviceId(mServiceEndpoint->getDeviceId());
result = mServiceEndpoint->registerStream(keep);