audio policy: fix volume control regression
commit 28d09f064 introduced regressions in volume control resulting
in changing some device/stream volumes unexpectedly.
The problem was in the logic consisting in considering streams equivalent for
volume control based on their associated strategy: The rule is wrong because it
causes a volume change on a given stream to cause the same change on all streams
sharing the same strategy. For instance stream SYSTEM and MUSIC share the same
strategy and changing SYSTEM stream volume would change MUSIC volume.
The new rule just considers the stream type when deciding if two stream share the
same volume control.
Also fixed possible calls to getStrategy() with stream PATCH causing asserts.
Bug: 27586382
Author: Eric Laurent <elaurent@google.com>
Date: Tue Mar 8 10:43:05 2016 -0800
audio policy: improve accessibility volume
Change-Id: I3fe2a25767319800b0db5fd1ed7c1bd751b04732
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.h b/services/audiopolicy/managerdefault/AudioPolicyManager.h
index d6e48ab..1ef896f 100644
--- a/services/audiopolicy/managerdefault/AudioPolicyManager.h
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.h
@@ -506,8 +506,8 @@
void clearAudioSources(uid_t uid);
- static bool strategiesMatchForvolume(routing_strategy strategy1,
- routing_strategy strategy2);
+ static bool streamsMatchForvolume(audio_stream_type_t stream1,
+ audio_stream_type_t stream2);
uid_t mUidCached;
AudioPolicyClientInterface *mpClientInterface; // audio policy client interface