mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 18:00:02 +01:00
Display caller avatar when showing CallStyle notification.
This commit is contained in:
@@ -35,6 +35,8 @@ import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
|
||||
/**
|
||||
* Provide a foreground service for {@link SignalCallManager} to leverage to run in the background when necessary. Also
|
||||
* provides devices listeners needed for during a call (i.e., bluetooth, power button).
|
||||
@@ -71,7 +73,8 @@ public final class WebRtcCallService extends Service implements SignalAudioManag
|
||||
private SignalAudioManager signalAudioManager;
|
||||
private int lastNotificationId;
|
||||
private Notification lastNotification;
|
||||
private boolean isGroup = true;
|
||||
private boolean isGroup = true;
|
||||
private Disposable notificationDisposable = Disposable.empty();
|
||||
|
||||
public static void update(@NonNull Context context, int type, @NonNull RecipientId recipientId) {
|
||||
Intent intent = new Intent(context, WebRtcCallService.class);
|
||||
@@ -145,6 +148,8 @@ public final class WebRtcCallService extends Service implements SignalAudioManag
|
||||
Log.v(TAG, "onDestroy");
|
||||
super.onDestroy();
|
||||
|
||||
notificationDisposable.dispose();
|
||||
|
||||
if (uncaughtExceptionHandlerManager != null) {
|
||||
uncaughtExceptionHandlerManager.unregister();
|
||||
}
|
||||
@@ -226,10 +231,14 @@ public final class WebRtcCallService extends Service implements SignalAudioManag
|
||||
}
|
||||
|
||||
public void setCallInProgressNotification(int type, @NonNull RecipientId id) {
|
||||
lastNotificationId = CallNotificationBuilder.getNotificationId(type);
|
||||
lastNotification = CallNotificationBuilder.getCallInProgressNotification(this, type, Recipient.resolved(id));
|
||||
notificationDisposable.dispose();
|
||||
notificationDisposable = CallNotificationBuilder.getCallInProgressNotification(this, type, Recipient.resolved(id))
|
||||
.subscribe(notification -> {
|
||||
lastNotificationId = CallNotificationBuilder.getNotificationId(type);
|
||||
lastNotification = notification;
|
||||
|
||||
startForegroundCompat(lastNotificationId, lastNotification);
|
||||
startForegroundCompat(lastNotificationId, lastNotification);
|
||||
});
|
||||
}
|
||||
|
||||
private void startForegroundCompat(int notificationId, Notification notification) {
|
||||
|
||||
Reference in New Issue
Block a user