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());
|
NotificationProfile activeProfile = NotificationProfiles.getActiveProfile(SignalDatabase.notificationProfiles().getProfiles());
|
||||||
if (activeProfile != null && !(activeProfile.isRecipientAllowed(callMetadata.getRemotePeer().getId()) || activeProfile.getAllowAllCalls())) {
|
if (activeProfile != null && !(activeProfile.isRecipientAllowed(callMetadata.getRemotePeer().getId()) || activeProfile.getAllowAllCalls())) {
|
||||||
Log.w(tag, "Caller is excluded by notification profile.");
|
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);
|
webRtcInteractor.insertMissedCall(callMetadata.getRemotePeer(), receivedOfferMetadata.getServerReceivedTimestamp(), offerMetadata.getOfferType() == OfferMessage.Type.VIDEO_CALL);
|
||||||
return currentState;
|
return currentState;
|
||||||
}
|
}
|
||||||
|
|
|
@ -134,21 +134,19 @@ public class IncomingRinger {
|
||||||
MediaPlayer mediaPlayer = new MediaPlayer();
|
MediaPlayer mediaPlayer = new MediaPlayer();
|
||||||
mediaPlayer.setDataSource(context, ringtoneUri);
|
mediaPlayer.setDataSource(context, ringtoneUri);
|
||||||
return mediaPlayer;
|
return mediaPlayer;
|
||||||
} catch (SecurityException e) {
|
} catch (IOException | SecurityException e) {
|
||||||
Log.w(TAG, "Failed to create player with ringtone the normal way", e);
|
Log.w(TAG, "Failed to create player with ringtone the normal way", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ringtoneUri.equals(Settings.System.DEFAULT_RINGTONE_URI)) {
|
try {
|
||||||
try {
|
Uri defaultRingtoneUri = RingtoneUtil.getActualDefaultRingtoneUri(context);
|
||||||
Uri defaultRingtoneUri = RingtoneUtil.getActualDefaultRingtoneUri(context);
|
if (defaultRingtoneUri != null) {
|
||||||
if (defaultRingtoneUri != null) {
|
MediaPlayer mediaPlayer = new MediaPlayer();
|
||||||
MediaPlayer mediaPlayer = new MediaPlayer();
|
mediaPlayer.setDataSource(context, defaultRingtoneUri);
|
||||||
mediaPlayer.setDataSource(context, defaultRingtoneUri);
|
return mediaPlayer;
|
||||||
return mediaPlayer;
|
|
||||||
}
|
|
||||||
} catch (SecurityException e) {
|
|
||||||
Log.w(TAG, "Failed to set default ringtone with fallback approach", e);
|
|
||||||
}
|
}
|
||||||
|
} catch (SecurityException e) {
|
||||||
|
Log.w(TAG, "Failed to set default ringtone with fallback approach", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|
Ładowanie…
Reference in New Issue