blob: f4b384e2a807ef73144d1ea1a0753fcb0a7db851 [file] [log] [blame]
// 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__ctor = NULL;
FFI_PLUGIN_EXPORT
JniResult Notifications__ctor() {
load_env();
load_class_gr(&_c_Notifications,
"com/example/notification_plugin/Notifications");
if (_c_Notifications == NULL)
return (JniResult){.result = {.j = 0}, .exception = check_exception()};
load_method(_c_Notifications, &_m_Notifications__ctor, "<init>", "()V");
if (_m_Notifications__ctor == NULL)
return (JniResult){.result = {.j = 0}, .exception = check_exception()};
jobject _result =
(*jniEnv)->NewObject(jniEnv, _c_Notifications, _m_Notifications__ctor);
return (JniResult){.result = {.l = to_global_ref(_result)},
.exception = check_exception()};
}
jmethodID _m_Notifications__showNotification = NULL;
FFI_PLUGIN_EXPORT
JniResult Notifications__showNotification(jobject context,
int32_t notificationID,
jobject title,
jobject text) {
load_env();
load_class_gr(&_c_Notifications,
"com/example/notification_plugin/Notifications");
if (_c_Notifications == NULL)
return (JniResult){.result = {.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){.result = {.j = 0}, .exception = check_exception()};
(*jniEnv)->CallStaticVoidMethod(jniEnv, _c_Notifications,
_m_Notifications__showNotification, context,
notificationID, title, text);
return (JniResult){.result = {.j = 0}, .exception = check_exception()};
}