forked from mirror/monocles_chat_clean
catch rare race conditions when pressing switch to earpiece
(cherry picked from commit 07600c57ea62ce2fe1a43f4ff391af458fa4b053)
This commit is contained in:
parent
e2148c86ab
commit
09505a831d
1 changed files with 12 additions and 4 deletions
|
@ -1304,13 +1304,21 @@ public class RtpSessionActivity extends XmppActivity
|
||||||
}
|
}
|
||||||
|
|
||||||
private void switchToEarpiece(final View view) {
|
private void switchToEarpiece(final View view) {
|
||||||
|
try {
|
||||||
requireCallIntegration().setAudioDevice(CallIntegration.AudioDevice.EARPIECE);
|
requireCallIntegration().setAudioDevice(CallIntegration.AudioDevice.EARPIECE);
|
||||||
acquireProximityWakeLock();
|
acquireProximityWakeLock();
|
||||||
|
} catch (final IllegalStateException e) {
|
||||||
|
Toast.makeText(this, e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void switchToSpeaker(final View view) {
|
private void switchToSpeaker(final View view) {
|
||||||
|
try {
|
||||||
requireCallIntegration().setAudioDevice(CallIntegration.AudioDevice.SPEAKER_PHONE);
|
requireCallIntegration().setAudioDevice(CallIntegration.AudioDevice.SPEAKER_PHONE);
|
||||||
releaseProximityWakeLock();
|
releaseProximityWakeLock();
|
||||||
|
} catch (final IllegalStateException e) {
|
||||||
|
Toast.makeText(this, e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void retry(final View view) {
|
private void retry(final View view) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue