Spatial Audio: Check if stereo spatialization property is enabled

Stereo spatialization will be enabled per device. Check the property
value along with the feature flag to enable spatialization for stereo
channel mask.

Bug: 323223919
Test: manual - Tested enable/disable behavior on raven and shiba
Test: manual - Playback stereo content with spatial audio enabled
Change-Id: I76255b0d5fb97d5b4d8195460910a32e5c4bcdc5
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp
index ff1b5e0..2bbc48c 100644
--- a/services/audioflinger/Threads.cpp
+++ b/services/audioflinger/Threads.cpp
@@ -3318,7 +3318,11 @@
         return {}; // nothing to do
     }
     StreamOutHalInterface::SourceMetadata metadata;
-    if (com_android_media_audio_stereo_spatialization()) {
+    static const bool stereo_spatialization_property =
+            property_get_bool("ro.audio.stereo_spatialization_enabled", false);
+    const bool stereo_spatialization_enabled =
+            stereo_spatialization_property && com_android_media_audio_stereo_spatialization();
+    if (stereo_spatialization_enabled) {
         std::map<audio_session_t, std::vector<playback_track_metadata_v7_t> >allSessionsMetadata;
         for (const sp<IAfTrack>& track : mActiveTracks) {
             std::vector<playback_track_metadata_v7_t>& sessionMetadata =