blob: 9f1e5774513ab7e037e30ca1da7faed3ce3eb0ee [file] [log] [blame] [edit]
// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Autogenerated by jnigen. DO NOT EDIT!
#include <stdint.h>
#include "dartjni.h"
#include "jni.h"
thread_local JNIEnv* jniEnv;
JniContext* jni;
JniContext* (*context_getter)(void);
JNIEnv* (*env_getter)(void);
void setJniGetters(JniContext* (*cg)(void), JNIEnv* (*eg)(void)) {
context_getter = cg;
env_getter = eg;
}
// com.example.notification_plugin.Notifications
jclass _c_Notifications = NULL;
jmethodID _m_Notifications__new0 = NULL;
FFI_PLUGIN_EXPORT
JniResult Notifications__new0() {
load_env();
load_class_global_ref(&_c_Notifications,
"com/example/notification_plugin/Notifications");
if (_c_Notifications == NULL)
return (JniResult){.value = {.j = 0}, .exception = check_exception()};
load_method(_c_Notifications, &_m_Notifications__new0, "<init>", "()V");
if (_m_Notifications__new0 == NULL)
return (JniResult){.value = {.j = 0}, .exception = check_exception()};
jobject _result =
(*jniEnv)->NewObject(jniEnv, _c_Notifications, _m_Notifications__new0);
return to_global_ref_result(_result);
}
jmethodID _m_Notifications__showNotification = NULL;
FFI_PLUGIN_EXPORT
JniResult Notifications__showNotification(jobject context,
int32_t notificationID,
jobject title,
jobject text) {
load_env();
load_class_global_ref(&_c_Notifications,
"com/example/notification_plugin/Notifications");
if (_c_Notifications == NULL)
return (JniResult){.value = {.j = 0}, .exception = check_exception()};
load_static_method(
_c_Notifications, &_m_Notifications__showNotification, "showNotification",
"(Landroid/content/Context;ILjava/lang/String;Ljava/lang/String;)V");
if (_m_Notifications__showNotification == NULL)
return (JniResult){.value = {.j = 0}, .exception = check_exception()};
(*jniEnv)->CallStaticVoidMethod(jniEnv, _c_Notifications,
_m_Notifications__showNotification, context,
notificationID, title, text);
return (JniResult){.value = {.j = 0}, .exception = check_exception()};
}