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/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index 7f0fc1f..1419008 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -1166,6 +1166,9 @@
 
         output.afFrameCount = thread->frameCount();
         output.afSampleRate = thread->sampleRate();
+        output.afChannelMask = static_cast<audio_channel_mask_t>(thread->channelMask() |
+                                                                 thread->hapticChannelMask());
+        output.afFormat = thread->format();
         output.afLatencyMs = thread->latency();
         output.portId = portId;
 
@@ -2403,6 +2406,12 @@
             };
         }
 
+        output.halConfig = {
+                thread->sampleRate(),
+                thread->channelMask(),
+                thread->format()
+        };
+
         // Check if one effect chain was awaiting for an AudioRecord to be created on this
         // session and move it to this thread.
         sp<EffectChain> chain = getOrphanEffectChain_l(sessionId);