Fix hack to workaround Galaxy S speaker/mic issue.

This commit is contained in:
Guillaume Beraudo 2011-08-05 16:15:59 +02:00
parent 8432509fae
commit 54ef1fce4a
2 changed files with 16 additions and 14 deletions

View file

@ -144,15 +144,12 @@ public final class LinphoneManager implements LinphoneCoreListener {
private BroadcastReceiver mKeepAliveReceiver = new KeepAliveReceiver();
private synchronized void routeAudioToSpeakerHelper(boolean speakerOn) {
LinphoneCall call = mLc.getCurrentCall();
boolean paused = false;
if (call != null && call.getState() == State.StreamsRunning && Hacks.needPausingCallForSpeakers()) {
Log.d("Hack pausing call to have speaker=",speakerOn);
mLc.pauseCall(call);
paused = true;
}
private native void hackSpeakerState(boolean speakerOn);
@SuppressWarnings("unused")
private static void sRouteAudioToSpeakerHelperHelper(boolean speakerOn) {
getInstance().routeAudioToSpeakerHelperHelper(speakerOn);
}
private void routeAudioToSpeakerHelperHelper(boolean speakerOn) {
if (Hacks.needGalaxySAudioHack() || lpm.useGalaxySHack())
setAudioModeIncallForGalaxyS();
@ -167,13 +164,18 @@ public final class LinphoneManager implements LinphoneCoreListener {
} else {
mAudioManager.setSpeakerphoneOn(speakerOn);
}
if (paused) {
Log.d("Hack resuming call to have speaker=",speakerOn);
mLc.resumeCall(call);
}
private 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");
hackSpeakerState(speakerOn);
} else {
routeAudioToSpeakerHelperHelper(speakerOn);
}
}
public void routeAudioToSpeaker() {
routeAudioToSpeakerHelper(true);
if (mLc.isIncall()) {

@ -1 +1 @@
Subproject commit 743ef7d0cf511161ff4c2300315df775e601bae3
Subproject commit 68df42b2924930043bbf466b0c6eab1409fb6c3e