mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
83 lines
2.2 KiB
Plaintext
83 lines
2.2 KiB
Plaintext
// Copyright 2014 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
// This file is autogenerated by
|
|
// base/android/jni_generator/jni_generator.py
|
|
// For
|
|
// org/chromium/TestJni
|
|
|
|
#ifndef org_chromium_TestJni_JNI
|
|
#define org_chromium_TestJni_JNI
|
|
|
|
#include <jni.h>
|
|
|
|
#include "base/android/jni_generator/jni_generator_helper.h"
|
|
|
|
#include "base/android/jni_int_wrapper.h"
|
|
|
|
// Step 1: forward declarations.
|
|
namespace {
|
|
const char kMyOtherInnerClassClassPath[] =
|
|
"org/chromium/TestJni$MyOtherInnerClass";
|
|
const char kTestJniClassPath[] = "org/chromium/TestJni";
|
|
const char kMyInnerClassClassPath[] = "org/chromium/TestJni$MyInnerClass";
|
|
// Leaking this jclass as we cannot use LazyInstance from some threads.
|
|
jclass g_TestJni_clazz = NULL;
|
|
#define TestJni_clazz(env) g_TestJni_clazz
|
|
|
|
} // namespace
|
|
|
|
static jint Init(JNIEnv* env, jobject jcaller);
|
|
|
|
static jint Init(JNIEnv* env, jobject jcaller);
|
|
|
|
// Step 2: method stubs.
|
|
|
|
// Step 3: RegisterNatives.
|
|
|
|
static const JNINativeMethod kMethodsMyOtherInnerClass[] = {
|
|
{ "nativeInit",
|
|
"("
|
|
")"
|
|
"I", reinterpret_cast<void*>(Init) },
|
|
};
|
|
|
|
static const JNINativeMethod kMethodsMyInnerClass[] = {
|
|
{ "nativeInit",
|
|
"("
|
|
")"
|
|
"I", reinterpret_cast<void*>(Init) },
|
|
};
|
|
|
|
static bool RegisterNativesImpl(JNIEnv* env) {
|
|
|
|
g_TestJni_clazz = reinterpret_cast<jclass>(env->NewGlobalRef(
|
|
base::android::GetClass(env, kTestJniClassPath).obj()));
|
|
|
|
const int kMethodsMyOtherInnerClassSize =
|
|
arraysize(kMethodsMyOtherInnerClass);
|
|
|
|
if (env->RegisterNatives(MyOtherInnerClass_clazz(env),
|
|
kMethodsMyOtherInnerClass,
|
|
kMethodsMyOtherInnerClassSize) < 0) {
|
|
jni_generator::HandleRegistrationError(
|
|
env, MyOtherInnerClass_clazz(env), __FILE__);
|
|
return false;
|
|
}
|
|
|
|
const int kMethodsMyInnerClassSize = arraysize(kMethodsMyInnerClass);
|
|
|
|
if (env->RegisterNatives(MyInnerClass_clazz(env),
|
|
kMethodsMyInnerClass,
|
|
kMethodsMyInnerClassSize) < 0) {
|
|
jni_generator::HandleRegistrationError(
|
|
env, MyInnerClass_clazz(env), __FILE__);
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
#endif // org_chromium_TestJni_JNI
|