context_android.c 461 B

12345678910111213141516
  1. // Copyright 2016 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. #include <jni.h>
  5. #include "seq_android.h"
  6. #include "_cgo_export.h"
  7. JNIEXPORT void JNICALL
  8. Java_go_Seq_setContext(JNIEnv* env, jclass clazz, jobject ctx) {
  9. JavaVM* vm;
  10. if ((*env)->GetJavaVM(env, &vm) != 0) {
  11. LOG_FATAL("failed to get JavaVM");
  12. }
  13. setContext(vm, (*env)->NewGlobalRef(env, ctx));
  14. }