Flutter Engine
library_loader.cc File Reference
#include "flutter/fml/platform/android/jni_util.h"
#include "flutter/shell/platform/android/android_image_generator.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 12 of file library_loader.cc.

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

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