diff options
author | Jean-Michel Trivi <jmtrivi@google.com> | 2010-11-15 12:11:32 -0800 |
---|---|---|
committer | Jean-Michel Trivi <jmtrivi@google.com> | 2011-01-26 11:20:01 -0800 |
commit | 2ba92c71b5684dce700cf848bf157153c156df1d (patch) | |
tree | 4a5fd1c92f47a6557552adbb65898c35866d9662 /telephony/java | |
parent | 138757db4f19cb626ef5c1d371d4fca004304a08 (diff) | |
download | frameworks_base-2ba92c71b5684dce700cf848bf157153c156df1d.zip frameworks_base-2ba92c71b5684dce700cf848bf157153c156df1d.tar.gz frameworks_base-2ba92c71b5684dce700cf848bf157153c156df1d.tar.bz2 |
do not merge bug 3370834 Cherrypick from master
Cherripick from master CL 79833, 79417, 78864, 80332, 87500
Add new audio mode and recording source for audio communications
other than telelphony.
The audio mode MODE_IN_CALL signals the system the device a phone
call is currently underway. There was no way for audio video
chat or VoIP applications to signal a call is underway, but not
using the telephony resources. This change introduces a new mode
to address this. Changes in other parts of the system (java
and native) are required to take this new mode into account.
The generic AudioPolicyManager is updated to not use its phone
state variable directly, but to use two new convenience methods,
isInCall() and isStateInCall(int) instead.
Add a recording source used to designate a recording stream for
voice communications such as VoIP.
Update the platform-independent audio policy manager to pass the
nature of the audio recording source to the audio policy client
interface through the AudioPolicyClientInterface::setParameters()
method.
SIP calls should set the audio mode to MODE_IN_COMMUNICATION,
Audio mode MODE_IN_CALL is reserved for telephony.
SIP: Enable built-in echo canceler if available.
1. Always initialize AudioRecord with VOICE_COMMUNICATION.
2. If echo canceler is available, disable our echo suppressor.
Note that this CL is intentionally not correcting the
getAudioSourceMax() return value in MediaRecorder.java as the
new source is hidden here.
Change-Id: Ie68cd03c50553101aa2ad838fe9459b2cf151bc8
Diffstat (limited to 'telephony/java')
-rw-r--r-- | telephony/java/com/android/internal/telephony/CallManager.java | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/telephony/java/com/android/internal/telephony/CallManager.java b/telephony/java/com/android/internal/telephony/CallManager.java index 0335ca2..b89058f 100644 --- a/telephony/java/com/android/internal/telephony/CallManager.java +++ b/telephony/java/com/android/internal/telephony/CallManager.java @@ -380,12 +380,17 @@ public final class CallManager { break; case OFFHOOK: Phone fgPhone = getFgPhone(); - // Enable IN_CALL mode while foreground call is in DIALING, - // ALERTING, ACTIVE and DISCONNECTING state and not from sipPhone + // While foreground call is in DIALING, + // ALERTING, ACTIVE and DISCONNECTING state if (getActiveFgCallState() != Call.State.IDLE - && getActiveFgCallState() != Call.State.DISCONNECTED - && !(fgPhone instanceof SipPhone)) { - mode = AudioManager.MODE_IN_CALL; + && getActiveFgCallState() != Call.State.DISCONNECTED) { + if (fgPhone instanceof SipPhone) { + // enable IN_COMMUNICATION audio mode for sipPhone + mode = AudioManager.MODE_IN_COMMUNICATION; + } else { + // enable IN_CALL audio mode for telephony + mode = AudioManager.MODE_IN_CALL; + } } break; } |