audioflinger: remove obsolete stream volume management
Remove the ability to change stream volume globally (on all outputs)
in audio flinger as this doesn't make sense when stream volume is
managed per device.
Also, do not store stream volumes globally in audio flinger and apply
them when a new output is opened. The ground truth for stream volume is
in audio policy so make sure stream volumes are systematically applied
by audio policy when an output is opened according to the selected device.
Bug: 70332110
Test: audio smoke tests
Change-Id: I7180a428af53aafdee82aadbcaf284c028ac5554
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp
index d6021b3..4b6263a 100644
--- a/services/audioflinger/Threads.cpp
+++ b/services/audioflinger/Threads.cpp
@@ -1702,11 +1702,14 @@
readOutputParameters_l();
// ++ operator does not compile
- for (audio_stream_type_t stream = AUDIO_STREAM_MIN; stream < AUDIO_STREAM_CNT;
+ for (audio_stream_type_t stream = AUDIO_STREAM_MIN; stream < AUDIO_STREAM_FOR_POLICY_CNT;
stream = (audio_stream_type_t) (stream + 1)) {
- mStreamTypes[stream].volume = mAudioFlinger->streamVolume_l(stream);
+ mStreamTypes[stream].volume = 0.0f;
mStreamTypes[stream].mute = mAudioFlinger->streamMute_l(stream);
}
+ // Audio patch volume is always max
+ mStreamTypes[AUDIO_STREAM_PATCH].volume = 1.0f;
+ mStreamTypes[AUDIO_STREAM_PATCH].mute = false;
}
AudioFlinger::PlaybackThread::~PlaybackThread()