AAudio: Add AAudioStream_getHardware* functions
Add new methods to AAudioStream that allow for queries on the hardware
aspects of streams.
These will allow developers understand the hardware limitations of their
Android devices after they create AAudio streams.
Bug: 245412674
Test: atest AAudioTests
Change-Id: I104a738df89ab22aba9e0658b43402ddf053b887
diff --git a/services/oboeservice/AAudioServiceEndpointMMAP.cpp b/services/oboeservice/AAudioServiceEndpointMMAP.cpp
index 133b9b4..e03fba0 100644
--- a/services/oboeservice/AAudioServiceEndpointMMAP.cpp
+++ b/services/oboeservice/AAudioServiceEndpointMMAP.cpp
@@ -227,6 +227,9 @@
setFormat(config.format);
setSampleRate(config.sample_rate);
+ setHardwareSampleRate(getSampleRate());
+ setHardwareFormat(getFormat());
+ setHardwareSamplesPerFrame(AAudioConvert_channelMaskToCount(getChannelMask()));
// If the position is not updated while the timestamp is updated for more than a certain amount,
// the timestamp reported from the HAL may not be accurate. Here, a timestamp grace period is