MCPcopy Create free account
hub / github.com/android/ndk-samples / GetJniEnv

Method GetJniEnv

endless-tunnel/app/src/main/cpp/native_engine.cpp:122–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120}
121
122JNIEnv* NativeEngine::GetJniEnv() {
123 if (!mJniEnv) {
124 LOGD("Attaching current thread to JNI.");
125 if (0 != mApp->activity->vm->AttachCurrentThread(&mJniEnv, NULL)) {
126 LOGE("*** FATAL ERROR: Failed to attach thread to JNI.");
127 ABORT_GAME;
128 }
129 MY_ASSERT(mJniEnv != NULL);
130 LOGD("Attached current thread to JNI, %p", mJniEnv);
131 }
132
133 return mJniEnv;
134}
135
136void NativeEngine::HandleCommand(int32_t cmd) {
137 SceneManager* mgr = SceneManager::GetInstance();

Callers 1

GetJNISetupFunction · 0.80

Calls 1

AttachCurrentThreadMethod · 0.80

Tested by

no test coverage detected