summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavan Chikkala <pavanc@codeaurora.org>2014-03-19 21:16:27 +0530
committerLorDClockaN <davor@losinj.com>2014-10-06 15:12:57 +0200
commit5621bf910fc76eaf993bff959d6fadcbc689c0d2 (patch)
treeffada68213b60bf2dfb8ded3f1aa98ff47aefec2
parentd887dee691204f1cdb92aa33c0f234ca80251c29 (diff)
audio: primary desc check for sonificationHEADkitkat
- Audio glitches on alarm expiry if alarm starts on screen lock/standby mode - On alarm expiry alarm tone will start play on combo device &screen unlock tone try to play on headset which results multiple device switch, as a result audio glitches are audible - If sonfication strategy is used by primary desc , we will treat all non music streams with sonfication stragey which will avoid device switch Change-Id: Id7d8dfa75f8d881549d57f01e3bb1025135d4b2c CRs-Fixed: 514467 CRs-Fixed: 657274
-rw-r--r--audio/AudioPolicyManagerBase.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/audio/AudioPolicyManagerBase.cpp b/audio/AudioPolicyManagerBase.cpp
index df754a0..355fe2f 100644
--- a/audio/AudioPolicyManagerBase.cpp
+++ b/audio/AudioPolicyManagerBase.cpp
@@ -2298,6 +2298,7 @@ audio_devices_t AudioPolicyManagerBase::getNewDevice(audio_io_handle_t output, b
audio_devices_t device = AUDIO_DEVICE_NONE;
AudioOutputDescriptor *outputDesc = mOutputs.valueFor(output);
+ AudioOutputDescriptor *primaryOutputDesc = mOutputs.valueFor(mPrimaryOutput);
// check the following by order of priority to request a routing change if necessary:
// 1: the strategy enforced audible is active on the output:
// use device for strategy enforced audible
@@ -2316,7 +2317,8 @@ audio_devices_t AudioPolicyManagerBase::getNewDevice(audio_io_handle_t output, b
} else if (isInCall() ||
outputDesc->isStrategyActive(STRATEGY_PHONE)) {
device = getDeviceForStrategy(STRATEGY_PHONE, fromCache);
- } else if (outputDesc->isStrategyActive(STRATEGY_SONIFICATION)) {
+ } else if (outputDesc->isStrategyActive(STRATEGY_SONIFICATION)||
+ (primaryOutputDesc->isStrategyActive(STRATEGY_SONIFICATION)&& !primaryOutputDesc->isStrategyActive(STRATEGY_MEDIA))){
device = getDeviceForStrategy(STRATEGY_SONIFICATION, fromCache);
} else if (outputDesc->isStrategyActive(STRATEGY_SONIFICATION_RESPECTFUL)) {
device = getDeviceForStrategy(STRATEGY_SONIFICATION_RESPECTFUL, fromCache);