mirror of
https://codeberg.org/monocles/monocles_chat.git
synced 2025-01-16 06:32:22 +01:00
catch rare race conditions when pressing switch to earpiece
(cherry picked from commit 07600c57ea62ce2fe1a43f4ff391af458fa4b053)
This commit is contained in:
parent
bacf61fe0f
commit
f34fb1b153
1 changed files with 12 additions and 4 deletions
|
@ -1304,13 +1304,21 @@ public class RtpSessionActivity extends XmppActivity
|
|||
}
|
||||
|
||||
private void switchToEarpiece(final View view) {
|
||||
try {
|
||||
requireCallIntegration().setAudioDevice(CallIntegration.AudioDevice.EARPIECE);
|
||||
acquireProximityWakeLock();
|
||||
} catch (final IllegalStateException e) {
|
||||
Toast.makeText(this, e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
private void switchToSpeaker(final View view) {
|
||||
try {
|
||||
requireCallIntegration().setAudioDevice(CallIntegration.AudioDevice.SPEAKER_PHONE);
|
||||
releaseProximityWakeLock();
|
||||
} catch (final IllegalStateException e) {
|
||||
Toast.makeText(this, e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
private void retry(final View view) {
|
||||
|
|
Loading…
Reference in a new issue