Send the Audio Usage down from AudioPolicyManager

Store audioUsgae in AudioAttributes and send it down to
AudioFlinger::openOutput_l. Then extract audioUsage and store in
SourceMetadata to pass it down to the HAL layer.

Bug: 297875432
Test: Add a fake audio usage in attribute in AudioFlinger::openoutput(), then test by checking the log message. The fake usage does get pass down to the DeviceHalAidl::openOutputStream().
Flag: EXEMPT bugfix
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:f6e304f9c5066ae829a91dcd98bc6045a13a8b30)
Merged-In: Ic9a739f1de50485304187be5c4b603955afabbf8
Change-Id: Ic9a739f1de50485304187be5c4b603955afabbf8
diff --git a/services/audioflinger/datapath/AudioStreamOut.cpp b/services/audioflinger/datapath/AudioStreamOut.cpp
index a686ff6..c65373e 100644
--- a/services/audioflinger/datapath/AudioStreamOut.cpp
+++ b/services/audioflinger/datapath/AudioStreamOut.cpp
@@ -93,7 +93,8 @@
         audio_io_handle_t handle,
         audio_devices_t deviceType,
         struct audio_config *config,
-        const char *address)
+        const char *address,
+        const std::vector<playback_track_metadata_v7_t>& sourceMetadata)
 {
     sp<StreamOutHalInterface> outStream;
 
@@ -107,7 +108,8 @@
             customFlags,
             config,
             address,
-            &outStream);
+            &outStream,
+            sourceMetadata);
     ALOGV("AudioStreamOut::open(), HAL returned stream %p, sampleRate %d, format %#x,"
             " channelMask %#x, status %d", outStream.get(), config->sample_rate, config->format,
             config->channel_mask, status);
@@ -124,7 +126,8 @@
                 customFlags,
                 &customConfig,
                 address,
-                &outStream);
+                &outStream,
+                sourceMetadata);
         ALOGV("AudioStreamOut::open(), treat IEC61937 as PCM, status = %d", status);
     }