MCPcopy Create free account
hub / github.com/Snapchat/Valdi / getEnv

Function getEnv

libs/utils/src/utils/platform/JvmUtils.cpp:100–105  ·  view source on GitHub ↗

Return a |JNIEnv*| usable on this thread or NULL if this thread is detached.

Source from the content-addressed store, hash-verified

98
99// Return a |JNIEnv*| usable on this thread or NULL if this thread is detached.
100JNIEnv* getEnv() {
101 void* env = nullptr;
102 [[maybe_unused]] jint status = gJvm->GetEnv(&env, JNI_VERSION_1_6);
103 assert(((env != nullptr) && (status == JNI_OK)) || ((env == nullptr) && (status == JNI_EDETACHED)));
104 return reinterpret_cast<JNIEnv*>(env);
105}
106
107bool attachThreadIfNeeded(const char* threadName) {
108 // check if already attached

Callers 3

threadDestructorFunction · 0.70
attachThreadIfNeededFunction · 0.70
getDeviceModelFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected