summaryrefslogtreecommitdiffstats
path: root/voip
diff options
context:
space:
mode:
authorChung-yih Wang <cywang@google.com>2010-08-16 17:44:36 +0800
committerChung-yih Wang <cywang@google.com>2010-08-16 18:02:31 +0800
commitcfd15dd3c8554cbbcb5822a0fdf6ca31d6b28acf (patch)
tree83cd8138d75dfb4b81b7596a305029e17668093c /voip
parent567722eee190f7cf88dc7ea95167db76d5514842 (diff)
downloadframeworks_base-cfd15dd3c8554cbbcb5822a0fdf6ca31d6b28acf.zip
frameworks_base-cfd15dd3c8554cbbcb5822a0fdf6ca31d6b28acf.tar.gz
frameworks_base-cfd15dd3c8554cbbcb5822a0fdf6ca31d6b28acf.tar.bz2
Fix the IN_CALL mode issue.
If the sip call is on-holding, we should not set the audio to MODE_NORMAL, or it will affect the audio if there is an active pstn call. Change-Id: If1bcba952617bf8427bc9e2d64d483ba1ee37370
Diffstat (limited to 'voip')
-rw-r--r--voip/java/android/net/sip/SipAudioCall.java5
-rw-r--r--voip/java/android/net/sip/SipAudioCallImpl.java21
2 files changed, 11 insertions, 15 deletions
diff --git a/voip/java/android/net/sip/SipAudioCall.java b/voip/java/android/net/sip/SipAudioCall.java
index abdc9d7..f4be839 100644
--- a/voip/java/android/net/sip/SipAudioCall.java
+++ b/voip/java/android/net/sip/SipAudioCall.java
@@ -191,11 +191,8 @@ public interface SipAudioCall {
*/
void continueCall() throws SipException;
- /** Puts the device to in-call mode. */
- void setInCallMode();
-
/** Puts the device to speaker mode. */
- void setSpeakerMode();
+ void setSpeakerMode(boolean speakerMode);
/** Toggles mute. */
void toggleMute();
diff --git a/voip/java/android/net/sip/SipAudioCallImpl.java b/voip/java/android/net/sip/SipAudioCallImpl.java
index 474bc4b..7161309 100644
--- a/voip/java/android/net/sip/SipAudioCallImpl.java
+++ b/voip/java/android/net/sip/SipAudioCallImpl.java
@@ -485,16 +485,9 @@ public class SipAudioCallImpl extends SipSessionAdapter
return mMuted;
}
- public synchronized void setInCallMode() {
+ public synchronized void setSpeakerMode(boolean speakerMode) {
((AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE))
- .setSpeakerphoneOn(false);
- ((AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE))
- .setMode(AudioManager.MODE_NORMAL);
- }
-
- public synchronized void setSpeakerMode() {
- ((AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE))
- .setSpeakerphoneOn(true);
+ .setSpeakerphoneOn(speakerMode);
}
public void sendDtmf(int code) {
@@ -587,8 +580,15 @@ public class SipAudioCallImpl extends SipSessionAdapter
Log.d(TAG, " not sending");
audioStream.setMode(RtpStream.MODE_RECEIVE_ONLY);
}
+ } else {
+ /* The recorder volume will be very low if the device is in
+ * IN_CALL mode. Therefore, we have to set the mode to NORMAL
+ * in order to have the normal microphone level.
+ */
+ ((AudioManager) mContext.getSystemService
+ (Context.AUDIO_SERVICE))
+ .setMode(AudioManager.MODE_NORMAL);
}
- setInCallMode();
AudioGroup audioGroup = new AudioGroup();
audioStream.join(audioGroup);
@@ -614,7 +614,6 @@ public class SipAudioCallImpl extends SipSessionAdapter
mRtpSession = null;
}
}
- setInCallMode();
}
private int getLocalMediaPort() {