NoitficationManager: implement cancel

This commit is contained in:
Julian Winkler
2024-03-18 18:13:56 +01:00
parent cdcc3411aa
commit 50fa760c63
3 changed files with 32 additions and 1 deletions

View File

@@ -117,6 +117,14 @@ JNIEXPORT void JNICALL Java_android_app_NotificationManager_nativeShowNotificati
g_hash_table_add(ongoing_notifications, GINT_TO_POINTER(id));
}
JNIEXPORT void JNICALL Java_android_app_NotificationManager_nativeCancel(JNIEnv *env, jobject this, jint id)
{
char *id_string = g_strdup_printf("%d", id);
if (portal)
xdp_portal_remove_notification(portal, id_string);
g_free(id_string);
}
static void remove_ongoing_notification(gpointer key, gpointer value, gpointer user_data)
{
char *id_string = g_strdup_printf("%d", GPOINTER_TO_INT(key));