java/syncbase: Add Cloud support in Android HLAPI
Init now uses an Options Builder that allow you to go the cloud-
supported route or the offline route.
This also carries through the logLevel changes from v.io/c/23754
Also
- removes sUserdataCollection in favor of accessing it via
sDatabase.
- Calls the loginCallback.onSuccess() via executor.
- Adds the proxy flag (-v23.proxy=proxy) to allow devices to
communicate across networks and with the cloud.
MultiPart: 1/2
Change-Id: I8cc27b3301844b4082d1612047a8f105b6da23a0
diff --git a/services/syncbase/bridge/cgo/impl.go b/services/syncbase/bridge/cgo/impl.go
index 8131637..6fd4f6c 100644
--- a/services/syncbase/bridge/cgo/impl.go
+++ b/services/syncbase/bridge/cgo/impl.go
@@ -147,6 +147,7 @@
// Strip all flags beyond the binary name; otherwise, v23.Init will fail when it encounters
// unknown flags passed by Xcode, e.g. NSTreatUnknownArgumentsAsOpen.
os.Args = os.Args[:1]
+ os.Args = append(os.Args, "-v23.proxy=proxy")
// Prepare the principal.
rootDir = opts.rootDir
diff --git a/services/syncbase/bridge/cgo/jni.go b/services/syncbase/bridge/cgo/jni.go
index c7f042c..12f2cae 100644
--- a/services/syncbase/bridge/cgo/jni.go
+++ b/services/syncbase/bridge/cgo/jni.go
@@ -121,14 +121,14 @@
}
//export Java_io_v_syncbase_internal_Service_Init
-func Java_io_v_syncbase_internal_Service_Init(env *C.JNIEnv, cls C.jclass, initRoot C.jstring, testLogin C.jboolean) {
+func Java_io_v_syncbase_internal_Service_Init(env *C.JNIEnv, cls C.jclass, initRoot C.jstring, testLogin C.jboolean, logLevel C.jint) {
cInitRoot := newVStringFromJava(env, initRoot)
var cInitOpts C.v23_syncbase_InitOpts
(&cInitOpts).init(initOpts{
clientUnderstandsVOM: true,
rootDir: cInitRoot.extract(),
testLogin: int(testLogin) != 0,
- verboseLevel: 0,
+ verboseLevel: int(logLevel),
})
v23_syncbase_Init(cInitOpts)
}