forked from mirror/monocles_chat_clean
pass selected audio device to proximity sensor toggle
(cherry picked from commit 1f77d5e1152976321a3bdbe8843992f8cb061bb1)
This commit is contained in:
parent
58f1aebb9d
commit
80b943c1e3
1 changed files with 4 additions and 4 deletions
|
@ -283,9 +283,9 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe
|
|||
this.mProximityWakeLock = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void putProximityWakeLockInProperState() {
|
||||
if (requireRtpConnection().getAudioManager().getSelectedAudioDevice() == AppRTCAudioManager.AudioDevice.EARPIECE) {
|
||||
|
||||
private void putProximityWakeLockInProperState(final AppRTCAudioManager.AudioDevice audioDevice) {
|
||||
if (audioDevice == AppRTCAudioManager.AudioDevice.EARPIECE) {
|
||||
acquireProximityWakeLock();
|
||||
} else {
|
||||
releaseProximityWakeLock();
|
||||
|
@ -1065,7 +1065,7 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe
|
|||
} else if (END_CARD.contains(endUserState)) {
|
||||
Log.d(Config.LOGTAG, "onAudioDeviceChanged() nothing to do because end card has been reached");
|
||||
} else {
|
||||
putProximityWakeLockInProperState();
|
||||
putProximityWakeLockInProperState(selectedAudioDevice);
|
||||
}
|
||||
} catch (IllegalStateException e) {
|
||||
Log.d(Config.LOGTAG, "RTP connection was not available when audio device changed");
|
||||
|
|
Loading…
Add table
Reference in a new issue