Flutter Engine
library_loader.cc File Reference
#include "flutter/fml/platform/android/jni_util.h"
#include "flutter/shell/platform/android/flutter_main.h"
#include "flutter/shell/platform/android/platform_view_android.h"
#include "flutter/shell/platform/android/vsync_waiter_android.h"

Go to the source code of this file.

Functions

JNIEXPORT jint JNI_OnLoad (JavaVM *vm, void *reserved)
 

Function Documentation

◆ JNI_OnLoad()

JNIEXPORT jint JNI_OnLoad ( JavaVM *  vm,
void *  reserved 
)

Definition at line 11 of file library_loader.cc.

References fml::jni::AttachCurrentThread(), FML_CHECK, fml::jni::InitJavaVM(), flutter::VsyncWaiterAndroid::Register(), flutter::FlutterMain::Register(), and flutter::PlatformViewAndroid::Register().

11  {
12  // Initialize the Java VM.
14 
15  JNIEnv* env = fml::jni::AttachCurrentThread();
16  bool result = false;
17 
18  // Register FlutterMain.
19  result = flutter::FlutterMain::Register(env);
20  FML_CHECK(result);
21 
22  // Register PlatformView
24  FML_CHECK(result);
25 
26  // Register VSyncWaiter.
28  FML_CHECK(result);
29 
30  return JNI_VERSION_1_4;
31 }
void InitJavaVM(JavaVM *vm)
Definition: jni_util.cc:21
static bool Register(JNIEnv *env)
static bool Register(JNIEnv *env)
#define FML_CHECK(condition)
Definition: logging.h:68
JNIEnv * AttachCurrentThread()
Definition: jni_util.cc:26