diff options
author | Eric Laurent <elaurent@google.com> | 2014-09-14 18:47:10 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-09-14 18:47:10 +0000 |
commit | 2b9530a7287f4f470d5f2aecea4da043b7af98a7 (patch) | |
tree | 9bd0606a04177676748a775f750400dd563012d1 /services | |
parent | f0b31e6333839972afb2e374f6d8824180d29fc2 (diff) | |
parent | 966095ea014bc0f6ae9f523ee7f37f2fed2faeb5 (diff) | |
download | frameworks_av-2b9530a7287f4f470d5f2aecea4da043b7af98a7.zip frameworks_av-2b9530a7287f4f470d5f2aecea4da043b7af98a7.tar.gz frameworks_av-2b9530a7287f4f470d5f2aecea4da043b7af98a7.tar.bz2 |
Merge "audio policy: fix relative priorities of PHONE and ENFORCED_AUDIBLE" into lmp-dev
Diffstat (limited to 'services')
-rw-r--r-- | services/audiopolicy/AudioPolicyManager.cpp | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/services/audiopolicy/AudioPolicyManager.cpp b/services/audiopolicy/AudioPolicyManager.cpp index abdbc5c..d5f6c1e 100644 --- a/services/audiopolicy/AudioPolicyManager.cpp +++ b/services/audiopolicy/AudioPolicyManager.cpp @@ -3670,8 +3670,11 @@ void AudioPolicyManager::checkOutputForStrategy(routing_strategy strategy) void AudioPolicyManager::checkOutputForAllStrategies() { - checkOutputForStrategy(STRATEGY_ENFORCED_AUDIBLE); + if (mForceUse[AUDIO_POLICY_FORCE_FOR_SYSTEM] == AUDIO_POLICY_FORCE_SYSTEM_ENFORCED) + checkOutputForStrategy(STRATEGY_ENFORCED_AUDIBLE); checkOutputForStrategy(STRATEGY_PHONE); + if (mForceUse[AUDIO_POLICY_FORCE_FOR_SYSTEM] != AUDIO_POLICY_FORCE_SYSTEM_ENFORCED) + checkOutputForStrategy(STRATEGY_ENFORCED_AUDIBLE); checkOutputForStrategy(STRATEGY_SONIFICATION); checkOutputForStrategy(STRATEGY_SONIFICATION_RESPECTFUL); checkOutputForStrategy(STRATEGY_MEDIA); @@ -3752,23 +3755,28 @@ audio_devices_t AudioPolicyManager::getNewOutputDevice(audio_io_handle_t output, } // check the following by order of priority to request a routing change if necessary: - // 1: the strategy enforced audible is active on the output: + // 1: the strategy enforced audible is active and enforced on the output: // use device for strategy enforced audible // 2: we are in call or the strategy phone is active on the output: // use device for strategy phone - // 3: the strategy sonification is active on the output: + // 3: the strategy for enforced audible is active but not enforced on the output: + // use the device for strategy enforced audible + // 4: the strategy sonification is active on the output: // use device for strategy sonification - // 4: the strategy "respectful" sonification is active on the output: + // 5: the strategy "respectful" sonification is active on the output: // use device for strategy "respectful" sonification - // 5: the strategy media is active on the output: + // 6: the strategy media is active on the output: // use device for strategy media - // 6: the strategy DTMF is active on the output: + // 7: the strategy DTMF is active on the output: // use device for strategy DTMF - if (outputDesc->isStrategyActive(STRATEGY_ENFORCED_AUDIBLE)) { + if (outputDesc->isStrategyActive(STRATEGY_ENFORCED_AUDIBLE) && + mForceUse[AUDIO_POLICY_FORCE_FOR_SYSTEM] == AUDIO_POLICY_FORCE_SYSTEM_ENFORCED) { device = getDeviceForStrategy(STRATEGY_ENFORCED_AUDIBLE, fromCache); } else if (isInCall() || outputDesc->isStrategyActive(STRATEGY_PHONE)) { device = getDeviceForStrategy(STRATEGY_PHONE, fromCache); + } else if (outputDesc->isStrategyActive(STRATEGY_ENFORCED_AUDIBLE)) { + device = getDeviceForStrategy(STRATEGY_ENFORCED_AUDIBLE, fromCache); } else if (outputDesc->isStrategyActive(STRATEGY_SONIFICATION)) { device = getDeviceForStrategy(STRATEGY_SONIFICATION, fromCache); } else if (outputDesc->isStrategyActive(STRATEGY_SONIFICATION_RESPECTFUL)) { |