kopia lustrzana https://github.com/ryukoposting/Signal-Android
Update incoming call handling.
* Fix crash with incoming ringer when custom ringtone isn't found. * Stop notification profiles from terminating calls on linked devices.fork-5.53.8
rodzic
5df20d755a
commit
ce93537fee
|
@ -195,7 +195,6 @@ public abstract class WebRtcActionProcessor {
|
|||
NotificationProfile activeProfile = NotificationProfiles.getActiveProfile(SignalDatabase.notificationProfiles().getProfiles());
|
||||
if (activeProfile != null && !(activeProfile.isRecipientAllowed(callMetadata.getRemotePeer().getId()) || activeProfile.getAllowAllCalls())) {
|
||||
Log.w(tag, "Caller is excluded by notification profile.");
|
||||
currentState = currentState.getActionProcessor().handleSendHangup(currentState, callMetadata, WebRtcData.HangupMetadata.fromType(HangupMessage.Type.NORMAL), true);
|
||||
webRtcInteractor.insertMissedCall(callMetadata.getRemotePeer(), receivedOfferMetadata.getServerReceivedTimestamp(), offerMetadata.getOfferType() == OfferMessage.Type.VIDEO_CALL);
|
||||
return currentState;
|
||||
}
|
||||
|
|
|
@ -134,21 +134,19 @@ public class IncomingRinger {
|
|||
MediaPlayer mediaPlayer = new MediaPlayer();
|
||||
mediaPlayer.setDataSource(context, ringtoneUri);
|
||||
return mediaPlayer;
|
||||
} catch (SecurityException e) {
|
||||
} catch (IOException | SecurityException e) {
|
||||
Log.w(TAG, "Failed to create player with ringtone the normal way", e);
|
||||
}
|
||||
|
||||
if (ringtoneUri.equals(Settings.System.DEFAULT_RINGTONE_URI)) {
|
||||
try {
|
||||
Uri defaultRingtoneUri = RingtoneUtil.getActualDefaultRingtoneUri(context);
|
||||
if (defaultRingtoneUri != null) {
|
||||
MediaPlayer mediaPlayer = new MediaPlayer();
|
||||
mediaPlayer.setDataSource(context, defaultRingtoneUri);
|
||||
return mediaPlayer;
|
||||
}
|
||||
} catch (SecurityException e) {
|
||||
Log.w(TAG, "Failed to set default ringtone with fallback approach", e);
|
||||
try {
|
||||
Uri defaultRingtoneUri = RingtoneUtil.getActualDefaultRingtoneUri(context);
|
||||
if (defaultRingtoneUri != null) {
|
||||
MediaPlayer mediaPlayer = new MediaPlayer();
|
||||
mediaPlayer.setDataSource(context, defaultRingtoneUri);
|
||||
return mediaPlayer;
|
||||
}
|
||||
} catch (SecurityException e) {
|
||||
Log.w(TAG, "Failed to set default ringtone with fallback approach", e);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
Ładowanie…
Reference in New Issue