mirror of
https://github.com/oxen-io/session-android.git
synced 2025-10-25 13:58:40 +00:00
Refactor webrtc audio management
Attempts to: 1) Successfully play ringtone through speaker instead of earpiece when possible. 2) Manage bluetooth headset connectivity as well as possible 3) Eliminate notification sounds while in-call when possible 4) Make sure audio is correctly setup when receiving calls Fixes #6271 Fixes #6248 Fixes #6238 Fixes #6184 Fixes #6169 // FREEBIE
This commit is contained in:
@@ -32,19 +32,30 @@ public class WebRtcViewModel {
|
||||
private final boolean remoteVideoEnabled;
|
||||
private final boolean localVideoEnabled;
|
||||
|
||||
public WebRtcViewModel(@NonNull State state, @NonNull Recipient recipient, boolean localVideoEnabled, boolean remoteVideoEnabled) {
|
||||
this(state, recipient, null, localVideoEnabled, remoteVideoEnabled);
|
||||
private final boolean isBluetoothAvailable;
|
||||
private final boolean isMicrophoneEnabled;
|
||||
|
||||
public WebRtcViewModel(@NonNull State state, @NonNull Recipient recipient,
|
||||
boolean localVideoEnabled, boolean remoteVideoEnabled,
|
||||
boolean isBluetoothAvailable, boolean isMicrophoneEnabled)
|
||||
{
|
||||
this(state, recipient, null,
|
||||
localVideoEnabled, remoteVideoEnabled,
|
||||
isBluetoothAvailable, isMicrophoneEnabled);
|
||||
}
|
||||
|
||||
public WebRtcViewModel(@NonNull State state, @NonNull Recipient recipient,
|
||||
@Nullable IdentityKey identityKey,
|
||||
boolean localVideoEnabled, boolean remoteVideoEnabled)
|
||||
boolean localVideoEnabled, boolean remoteVideoEnabled,
|
||||
boolean isBluetoothAvailable, boolean isMicrophoneEnabled)
|
||||
{
|
||||
this.state = state;
|
||||
this.recipient = recipient;
|
||||
this.identityKey = identityKey;
|
||||
this.localVideoEnabled = localVideoEnabled;
|
||||
this.remoteVideoEnabled = remoteVideoEnabled;
|
||||
this.state = state;
|
||||
this.recipient = recipient;
|
||||
this.identityKey = identityKey;
|
||||
this.localVideoEnabled = localVideoEnabled;
|
||||
this.remoteVideoEnabled = remoteVideoEnabled;
|
||||
this.isBluetoothAvailable = isBluetoothAvailable;
|
||||
this.isMicrophoneEnabled = isMicrophoneEnabled;
|
||||
}
|
||||
|
||||
public @NonNull State getState() {
|
||||
@@ -68,6 +79,14 @@ public class WebRtcViewModel {
|
||||
return localVideoEnabled;
|
||||
}
|
||||
|
||||
public boolean isBluetoothAvailable() {
|
||||
return isBluetoothAvailable;
|
||||
}
|
||||
|
||||
public boolean isMicrophoneEnabled() {
|
||||
return isMicrophoneEnabled;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "[State: " + state + ", recipient: " + recipient.getNumber() + ", identity: " + identityKey + ", remoteVideo: " + remoteVideoEnabled + ", localVideo: " + localVideoEnabled + "]";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user