blob: b34f7c04dd676a923968268491aa3c25db0b7ae7 [file] [log] [blame]
// Copyright 2015 The Vanadium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build android
package jni
import (
jutil "v.io/x/jni/util"
"v.io/x/jni/libs/discovery"
"v.io/x/ref/runtime/factories/android"
)
// #include "jni.h"
import "C"
var (
// Global reference for io.v.android.libs.discovery.ble.BlePlugin
jBlePlugin jutil.Class
// Global reference for io.v.v23.context.CancelableVContext class.
jCancelableVContextClass jutil.Class
// Global reference for java.jutil.concurrent.CountDownLatch class.
jCountDownLatchClass jutil.Class
)
//export Java_io_v_v23_V_nativeInit
func Java_io_v_v23_V_nativeInit(jenv *C.JNIEnv, jVRuntimeClass C.jclass, androidCtx C.jobject) {
env := jutil.Env(uintptr(unsafe.Pointer(jenv)))
setupUtil(env)
err := discovery.Init(env)
if err != nil {
return
}
android.SetBleCreator(discovery.NewBleCreator(env, androidCtx))
setupV23(env)
}
func main() {
}