mirror of
https://github.com/oxen-io/session-android.git
synced 2025-08-26 12:47:35 +00:00
Show calling foreground notification on all OS versions.
Fixes #9516 Fixes #9414
This commit is contained in:
@@ -583,9 +583,8 @@ public class WebRtcCallService extends Service implements CallManager.Observer,
|
|||||||
audioManager.startOutgoingRinger(OutgoingRinger.Type.RINGING);
|
audioManager.startOutgoingRinger(OutgoingRinger.Type.RINGING);
|
||||||
bluetoothStateManager.setWantsConnection(true);
|
bluetoothStateManager.setWantsConnection(true);
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
setCallInProgressNotification(TYPE_OUTGOING_RINGING, activePeer);
|
||||||
setCallInProgressNotification(TYPE_OUTGOING_RINGING, activePeer);
|
|
||||||
}
|
|
||||||
DatabaseFactory.getSmsDatabase(this).insertOutgoingCall(activePeer.getId());
|
DatabaseFactory.getSmsDatabase(this).insertOutgoingCall(activePeer.getId());
|
||||||
|
|
||||||
retrieveTurnServers().addListener(new SuccessOnlyListener<List<PeerConnection.IceServer>>(this.activePeer.getState(), this.activePeer.getCallId()) {
|
retrieveTurnServers().addListener(new SuccessOnlyListener<List<PeerConnection.IceServer>>(this.activePeer.getState(), this.activePeer.getCallId()) {
|
||||||
@@ -629,9 +628,8 @@ public class WebRtcCallService extends Service implements CallManager.Observer,
|
|||||||
|
|
||||||
initializeVideo();
|
initializeVideo();
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
setCallInProgressNotification(TYPE_INCOMING_CONNECTING, activePeer);
|
||||||
setCallInProgressNotification(TYPE_INCOMING_CONNECTING, activePeer);
|
|
||||||
}
|
|
||||||
retrieveTurnServers().addListener(new SuccessOnlyListener<List<PeerConnection.IceServer>>(this.activePeer.getState(), this.activePeer.getCallId()) {
|
retrieveTurnServers().addListener(new SuccessOnlyListener<List<PeerConnection.IceServer>>(this.activePeer.getState(), this.activePeer.getCallId()) {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccessContinue(List<PeerConnection.IceServer> iceServers) {
|
public void onSuccessContinue(List<PeerConnection.IceServer> iceServers) {
|
||||||
@@ -857,9 +855,7 @@ public class WebRtcCallService extends Service implements CallManager.Observer,
|
|||||||
}
|
}
|
||||||
|
|
||||||
registerPowerButtonReceiver();
|
registerPowerButtonReceiver();
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
setCallInProgressNotification(TYPE_INCOMING_RINGING, activePeer);
|
||||||
setCallInProgressNotification(TYPE_INCOMING_RINGING, activePeer);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleRemoteRinging(Intent intent) {
|
private void handleRemoteRinging(Intent intent) {
|
||||||
@@ -902,9 +898,7 @@ public class WebRtcCallService extends Service implements CallManager.Observer,
|
|||||||
|
|
||||||
unregisterPowerButtonReceiver();
|
unregisterPowerButtonReceiver();
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
setCallInProgressNotification(TYPE_ESTABLISHED, activePeer);
|
||||||
setCallInProgressNotification(TYPE_ESTABLISHED, activePeer);
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
callManager.setCommunicationMode();
|
callManager.setCommunicationMode();
|
||||||
@@ -1012,16 +1006,14 @@ public class WebRtcCallService extends Service implements CallManager.Observer,
|
|||||||
RemotePeer remotePeer = getRemotePeer(intent);
|
RemotePeer remotePeer = getRemotePeer(intent);
|
||||||
|
|
||||||
Log.i(TAG, "handleEndedReceivedOfferWhileActive(): call_id: " + remotePeer.getCallId());
|
Log.i(TAG, "handleEndedReceivedOfferWhileActive(): call_id: " + remotePeer.getCallId());
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
switch (activePeer.getState()) {
|
||||||
switch (activePeer.getState()) {
|
case DIALING:
|
||||||
case DIALING:
|
case REMOTE_RINGING: setCallInProgressNotification(TYPE_OUTGOING_RINGING, activePeer); break;
|
||||||
case REMOTE_RINGING: setCallInProgressNotification(TYPE_OUTGOING_RINGING, activePeer); break;
|
case IDLE: setCallInProgressNotification(TYPE_INCOMING_CONNECTING, activePeer); break;
|
||||||
case IDLE: setCallInProgressNotification(TYPE_INCOMING_CONNECTING, activePeer); break;
|
case ANSWERING: setCallInProgressNotification(TYPE_INCOMING_CONNECTING, activePeer); break;
|
||||||
case ANSWERING: setCallInProgressNotification(TYPE_INCOMING_CONNECTING, activePeer); break;
|
case LOCAL_RINGING: setCallInProgressNotification(TYPE_INCOMING_RINGING, activePeer); break;
|
||||||
case LOCAL_RINGING: setCallInProgressNotification(TYPE_INCOMING_RINGING, activePeer); break;
|
case CONNECTED: setCallInProgressNotification(TYPE_ESTABLISHED, activePeer); break;
|
||||||
case CONNECTED: setCallInProgressNotification(TYPE_ESTABLISHED, activePeer); break;
|
default: throw new IllegalStateException();
|
||||||
default: throw new IllegalStateException();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (activePeer.getState() == CallState.IDLE) {
|
if (activePeer.getState() == CallState.IDLE) {
|
||||||
|
Reference in New Issue
Block a user