Fix Galaxy S audio issue

This commit is contained in:
Sylvain Berfini 2012-09-28 10:10:21 +02:00
parent 63c5cf01f5
commit 9313994e38
2 changed files with 11 additions and 2 deletions

View file

@ -868,6 +868,14 @@ public class InCallActivity extends FragmentActivity implements
if (isVideoEnabledInCall != isVideoEnabled) {
isVideoEnabled = isVideoEnabledInCall;
switchVideo(isVideoEnabled);
} else {
//Hack to fix Galaxy S issue
if (isSpeakerEnabled) {
LinphoneManager.getInstance().routeAudioToSpeaker();
} else {
LinphoneManager.getInstance().routeAudioToReceiver();
}
LinphoneManager.getLc().enableSpeaker(isSpeakerEnabled);
}
isMicMuted = LinphoneManager.getLc().isMicMuted();

View file

@ -204,7 +204,7 @@ public final class LinphoneManager implements LinphoneCoreListener {
@SuppressWarnings("deprecation")
private void routeAudioToSpeakerHelperHelper(boolean speakerOn) {
boolean different = isSpeakerOn() ^ speakerOn;
if (!different) {
if (!different && !Hacks.needGalaxySAudioHack()) {
Log.d("Skipping change audio route by the same route ",
speakerOn ? "speaker" : "earpiece");
return;
@ -227,7 +227,8 @@ public final class LinphoneManager implements LinphoneCoreListener {
listener.onAudioStateChanged(speakerOn ? AudioState.SPEAKER : AudioState.EARPIECE);
}
}
private synchronized void routeAudioToSpeakerHelper(boolean speakerOn) {
public synchronized void routeAudioToSpeakerHelper(boolean speakerOn) {
final LinphoneCall call = mLc.getCurrentCall();
if (call != null && call.getState() == State.StreamsRunning && Hacks.needPausingCallForSpeakers()) {
Log.d("Hack to have speaker=",speakerOn," while on call");