You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
NoitficationManager: implement cancel
This commit is contained in:
@@ -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));
|
||||
|
||||
@@ -31,6 +31,14 @@ JNIEXPORT void JNICALL Java_android_app_NotificationManager_nativeAddAction
|
||||
JNIEXPORT void JNICALL Java_android_app_NotificationManager_nativeShowNotification
|
||||
(JNIEnv *, jobject, jlong, jint, jstring, jstring, jstring, jboolean, jint, jstring, jstring);
|
||||
|
||||
/*
|
||||
* Class: android_app_NotificationManager
|
||||
* Method: nativeCancel
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_android_app_NotificationManager_nativeCancel
|
||||
(JNIEnv *, jobject, jint);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user