Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

libhardware_legacy: Use direct output only for voip call

Voip session is getting opened instead of recording session
for some applications as it selects direct output device.
Avoid this by adding a check so that direct output device
is elected only when phone state is set to voip call mode

(cherry picked from commit 7c3da2e)

Change-Id: I7ecf326b80a3a92d2107c55bad5f5a666beb5079
CRs-Fixed: 345217
  • Loading branch information...
commit dbd180ebbce1a32c205daa08918e58801f9c6235 1 parent 5cc3a8a
Sriranjan Srikantam authored Kali- committed

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. +1 1  audio/AudioPolicyManagerBase.cpp
2  audio/AudioPolicyManagerBase.cpp
@@ -2304,7 +2304,7 @@ bool AudioPolicyManagerBase::needsDirectOuput(AudioSystem::stream_type stream,
2304 2304 return ((flags & AudioSystem::OUTPUT_FLAG_DIRECT) ||
2305 2305 (format !=0 && !AudioSystem::isLinearPCM(format)) ||
2306 2306 ((stream == AudioSystem::VOICE_CALL) && (channels == AudioSystem::CHANNEL_OUT_MONO)
2307   - && ((samplingRate == 8000 )||(samplingRate == 16000 ))));
  2307 + && ((samplingRate == 8000 )||(samplingRate == 16000 )) && (mPhoneState == AudioSystem::MODE_IN_COMMUNICATION)));
2308 2308 #else
2309 2309 return ((flags & AudioSystem::OUTPUT_FLAG_DIRECT) ||
2310 2310 (format !=0 && !AudioSystem::isLinearPCM(format)));

0 comments on commit dbd180e

Please sign in to comment.
Something went wrong with that request. Please try again.