Fix Galaxy S audio issue
This commit is contained in:
parent
63c5cf01f5
commit
9313994e38
2 changed files with 11 additions and 2 deletions
|
@ -868,6 +868,14 @@ public class InCallActivity extends FragmentActivity implements
|
||||||
if (isVideoEnabledInCall != isVideoEnabled) {
|
if (isVideoEnabledInCall != isVideoEnabled) {
|
||||||
isVideoEnabled = isVideoEnabledInCall;
|
isVideoEnabled = isVideoEnabledInCall;
|
||||||
switchVideo(isVideoEnabled);
|
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();
|
isMicMuted = LinphoneManager.getLc().isMicMuted();
|
||||||
|
|
|
@ -204,7 +204,7 @@ public final class LinphoneManager implements LinphoneCoreListener {
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
private void routeAudioToSpeakerHelperHelper(boolean speakerOn) {
|
private void routeAudioToSpeakerHelperHelper(boolean speakerOn) {
|
||||||
boolean different = isSpeakerOn() ^ speakerOn;
|
boolean different = isSpeakerOn() ^ speakerOn;
|
||||||
if (!different) {
|
if (!different && !Hacks.needGalaxySAudioHack()) {
|
||||||
Log.d("Skipping change audio route by the same route ",
|
Log.d("Skipping change audio route by the same route ",
|
||||||
speakerOn ? "speaker" : "earpiece");
|
speakerOn ? "speaker" : "earpiece");
|
||||||
return;
|
return;
|
||||||
|
@ -227,7 +227,8 @@ public final class LinphoneManager implements LinphoneCoreListener {
|
||||||
listener.onAudioStateChanged(speakerOn ? AudioState.SPEAKER : AudioState.EARPIECE);
|
listener.onAudioStateChanged(speakerOn ? AudioState.SPEAKER : AudioState.EARPIECE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private synchronized void routeAudioToSpeakerHelper(boolean speakerOn) {
|
|
||||||
|
public synchronized void routeAudioToSpeakerHelper(boolean speakerOn) {
|
||||||
final LinphoneCall call = mLc.getCurrentCall();
|
final LinphoneCall call = mLc.getCurrentCall();
|
||||||
if (call != null && call.getState() == State.StreamsRunning && Hacks.needPausingCallForSpeakers()) {
|
if (call != null && call.getState() == State.StreamsRunning && Hacks.needPausingCallForSpeakers()) {
|
||||||
Log.d("Hack to have speaker=",speakerOn," while on call");
|
Log.d("Hack to have speaker=",speakerOn," while on call");
|
||||||
|
|
Loading…
Reference in a new issue