srctree

Robin Linden parent 5a2dc111 398cf02d
Remove pending calls when the notification is swiped away

inlinesplit
atox/src/main/kotlin/ActionReceiver.kt added: 13, removed: 2, total 11
@@ -95,6 +95,7 @@ class ActionReceiver : BroadcastReceiver() {
callManager.endCall(pk)
notificationHelper.dismissCallNotification(pk)
}
"ignore" -> callManager.removePendingCall(pk)
}
}
}
 
atox/src/main/kotlin/ui/NotificationHelper.kt added: 13, removed: 2, total 11
@@ -272,6 +272,16 @@ class NotificationHelper @Inject constructor(
)
.build()
)
.setDeleteIntent(
PendingIntentCompat.getBroadcast(
context,
"${c.publicKey}_ignore_call".hashCode(),
Intent(context, ActionReceiver::class.java)
.putExtra(KEY_CONTACT_PK, c.publicKey)
.putExtra(KEY_CALL, "ignore"),
PendingIntent.FLAG_UPDATE_CURRENT
)
)
 
notifier.notify(c.publicKey.hashCode() + CALL.hashCode(), notificationBuilder.build())
}