summaryrefslogtreecommitdiffstats
path: root/services/audiopolicy/common
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2015-07-09 14:52:47 -0700
committerEric Laurent <elaurent@google.com>2015-07-10 10:58:41 -0700
commit7c1ec5f038e63a5eb8b04434577c25bc23f5f410 (patch)
treef6b8feda43ba0bb6666171b57318ad3cea48a45e /services/audiopolicy/common
parent54c0659b9efa72d11997c590c4d377c44789c7fd (diff)
downloadframeworks_av-7c1ec5f038e63a5eb8b04434577c25bc23f5f410.zip
frameworks_av-7c1ec5f038e63a5eb8b04434577c25bc23f5f410.tar.gz
frameworks_av-7c1ec5f038e63a5eb8b04434577c25bc23f5f410.tar.bz2
audio: several fixes in audio routing callbacks
- audio policy: Force device change to ensure new audio patch creation upon first track activity on a given output. Fix function device_distinguishes_on_address() which could mistake some output device with remote submix input device. - audio flinger: Reduce number of binder calls upon new client registration by only sending ioConfigChanged() callbacks to newly registered client. Fix first patch after output thread creation not triggering an ioConfigChanged() callback. -audio system: Force client registration upon routing callback installation to force new ioConfigChanged() callback from audio flinger. Bug: 22381136. Change-Id: Ieb0d9f92f563a40552eb31bc0499c8ac65f78ce4
Diffstat (limited to 'services/audiopolicy/common')
-rwxr-xr-xservices/audiopolicy/common/include/policy.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/services/audiopolicy/common/include/policy.h b/services/audiopolicy/common/include/policy.h
index 4eef02f..4b73e3c 100755
--- a/services/audiopolicy/common/include/policy.h
+++ b/services/audiopolicy/common/include/policy.h
@@ -37,8 +37,9 @@
* A device mask for all audio input and output devices where matching inputs/outputs on device
* type alone is not enough: the address must match too
*/
-#define APM_AUDIO_DEVICE_MATCH_ADDRESS_ALL (AUDIO_DEVICE_IN_REMOTE_SUBMIX | \
- AUDIO_DEVICE_OUT_REMOTE_SUBMIX)
+#define APM_AUDIO_DEVICE_OUT_MATCH_ADDRESS_ALL (AUDIO_DEVICE_OUT_REMOTE_SUBMIX)
+
+#define APM_AUDIO_DEVICE_IN_MATCH_ADDRESS_ALL (AUDIO_DEVICE_IN_REMOTE_SUBMIX)
/**
* Check if the state given correspond to an in call state.
@@ -80,5 +81,8 @@ static inline bool is_virtual_input_device(audio_devices_t device)
*/
static inline bool device_distinguishes_on_address(audio_devices_t device)
{
- return ((device & APM_AUDIO_DEVICE_MATCH_ADDRESS_ALL & ~AUDIO_DEVICE_BIT_IN) != 0);
+ return (((device & AUDIO_DEVICE_BIT_IN) != 0) &&
+ ((~AUDIO_DEVICE_BIT_IN & device & APM_AUDIO_DEVICE_IN_MATCH_ADDRESS_ALL) != 0)) ||
+ (((device & AUDIO_DEVICE_BIT_IN) == 0) &&
+ ((device & APM_AUDIO_DEVICE_OUT_MATCH_ADDRESS_ALL) != 0));
}