Flutter Engine
The Flutter Engine
shell
platform
android
library_loader.cc
Go to the documentation of this file.
1
// Copyright 2013 The Flutter Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
#include "flutter/fml/platform/android/jni_util.h"
6
#include "flutter/shell/platform/android/android_image_generator.h"
7
#include "flutter/shell/platform/android/flutter_main.h"
8
#include "flutter/shell/platform/android/platform_view_android.h"
9
#include "flutter/shell/platform/android/vsync_waiter_android.h"
10
11
// This is called by the VM when the shared library is first loaded.
12
JNIEXPORT jint
JNI_OnLoad
(JavaVM* vm,
void
* reserved) {
13
// Initialize the Java VM.
14
fml::jni::InitJavaVM
(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
24
result
=
flutter::PlatformViewAndroid::Register
(
env
);
25
FML_CHECK
(
result
);
26
27
// Register VSyncWaiter.
28
result
=
flutter::VsyncWaiterAndroid::Register
(
env
);
29
FML_CHECK
(
result
);
30
31
// Register AndroidImageDecoder.
32
result
=
flutter::AndroidImageGenerator::Register
(
env
);
33
FML_CHECK
(
result
);
34
35
return
JNI_VERSION_1_4;
36
}
flutter::AndroidImageGenerator::Register
static bool Register(JNIEnv *env)
Definition:
android_image_generator.cc:149
flutter::FlutterMain::Register
static bool Register(JNIEnv *env)
Definition:
flutter_main.cc:209
flutter::PlatformViewAndroid::Register
static bool Register(JNIEnv *env)
Definition:
platform_view_android_jni_impl.cc:1027
flutter::VsyncWaiterAndroid::Register
static bool Register(JNIEnv *env)
Definition:
vsync_waiter_android.cc:122
result
GAsyncResult * result
Definition:
fl_text_input_plugin.cc:106
FML_CHECK
#define FML_CHECK(condition)
Definition:
logging.h:85
JNI_OnLoad
JNIEXPORT jint JNI_OnLoad(JavaVM *vm, void *reserved)
Definition:
library_loader.cc:12
env
Definition:
__init__.py:1
fml::jni::AttachCurrentThread
JNIEnv * AttachCurrentThread()
Definition:
jni_util.cc:34
fml::jni::InitJavaVM
void InitJavaVM(JavaVM *vm)
Definition:
jni_util.cc:29
Generated on Sun Jun 23 2024 21:55:10 for Flutter Engine by
1.9.4