mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-06-29 18:45:58 +01:00
Always load avatar in the background.
This commit is contained in:
@@ -411,25 +411,23 @@ class ActiveCallManager(
|
||||
val recipient: Recipient = Recipient.resolved(IntentCompat.getParcelableExtra(intent, EXTRA_RECIPIENT_ID, RecipientId::class.java)!!)
|
||||
val isVideoCall = intent.getBooleanExtra(EXTRA_IS_VIDEO_CALL, false)
|
||||
|
||||
if (requiresAsyncNotificationLoad) {
|
||||
if (asyncServiceNotification != null && lastAsyncServiceNotificationType == type) {
|
||||
return asyncServiceNotification!!
|
||||
}
|
||||
|
||||
val requestTime = System.currentTimeMillis()
|
||||
lastAsyncServiceNotificationRequestTime = requestTime
|
||||
notificationDisposable = Single.fromCallable { createNotification(type, recipient, isVideoCall, skipAvatarLoad = false) }
|
||||
.subscribeOn(Schedulers.io())
|
||||
.filter { requestTime == lastAsyncServiceNotificationRequestTime }
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribeBy { notification ->
|
||||
lastAsyncServiceNotificationType = type
|
||||
asyncServiceNotification = notification
|
||||
update(this, type, recipient.id, isVideoCall)
|
||||
}
|
||||
if (asyncServiceNotification != null && lastAsyncServiceNotificationType == type) {
|
||||
return asyncServiceNotification!!
|
||||
}
|
||||
|
||||
return createNotification(type, recipient, isVideoCall, skipAvatarLoad = requiresAsyncNotificationLoad)
|
||||
val requestTime = System.currentTimeMillis()
|
||||
lastAsyncServiceNotificationRequestTime = requestTime
|
||||
notificationDisposable = Single.fromCallable { createNotification(type, recipient, isVideoCall, skipAvatarLoad = false) }
|
||||
.subscribeOn(Schedulers.io())
|
||||
.filter { requestTime == lastAsyncServiceNotificationRequestTime }
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribeBy { notification ->
|
||||
lastAsyncServiceNotificationType = type
|
||||
asyncServiceNotification = notification
|
||||
update(this, type, recipient.id, isVideoCall)
|
||||
}
|
||||
|
||||
return createNotification(type, recipient, isVideoCall, skipAvatarLoad = true)
|
||||
}
|
||||
|
||||
override fun onServiceUpdateCommandReceived(intent: Intent) {
|
||||
|
||||
Reference in New Issue
Block a user