When passing a byte array from Java to Go, Seq.writeByteArray JNI
call encodes only the array size and the pointer to the array.
Go-side receives the (size, ptr) pair info during the subsequent
Seq.send JNI call, and copies the elements into a Go byte slice.
We must pin the array elements until Go-side completes copying
so that they are not moved or collected by Java runtime.
This change keeps track of the pinned array info in a 'pinned' linked
list, and unpin them as the Seq memory is freed. The jbyteArray
argument passed to Seq.writeByteArray is needed to release the pinned
byte array elements, but that is a "local reference". It is not
guaranteed that the reference is valid after the method returns. Thus,
we stash its global reference in the 'pinned' list and delete it later
as well.
A similar problem can occur on the byte slice returned from a Go function.
This change does not address the case yet.
Fixesgolang/go#9486
Change-Id: I1255aefbc80b21ccbe9b2bf37699faaf0c5f0bae
Reviewed-on: https://go-review.googlesource.com/2586
Reviewed-by: David Crawshaw <crawshaw@golang.org>
If the volume is not accessible or -v option is not given,
docker run golang/mobile will fail with an error like:
finalize namespace chdir to /src/golang.org/x/mobile no such file or directory2015/01/13 20:14:19 Error response from daemon: Cannot start container dfe1dbc2bac3ea939e154eee13d20ecae4c473a595dbc1e6a0e5cf0be3963909: finalize namespace chdir to /src/golang.org/x/mobile no such file or directory
Change-Id: I4d56c044e9c7682e63da7170a546522230237b18
Reviewed-on: https://go-review.googlesource.com/2780
Reviewed-by: Burcu Dogan <jbd@google.com>
Change-Id: Ieac721b486155679f3de2baa13c69d50d63dce3b
Reviewed-on: https://go-review.googlesource.com/2652
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
This initially supports reading two common system fonts. At some point
there should be a more general Open function, but first I need to work
out how to to turn font names into android file names.
Fixesgolang/go#9419.
Change-Id: I8321df873315a5222c39dccf961f742f2e2a7a4c
Reviewed-on: https://go-review.googlesource.com/2059
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
This change makes gobind to generate proper Go-side proxy code to
handle interface methods that have parameters and return values.
It allows gobind to accept struct pointer types as parameters
or a return value of a method.
Fixesgolang/go#9487, golang/go#9488.
Change-Id: Id243c42ee0701d40e3871e392140368c2f8f9bc6
Reviewed-on: https://go-review.googlesource.com/2348
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Otherwise, successive adb installs will require the existing apk to be
removed. If no android.keystore is generated during docker build, one
will be generated by the NDK toolchain during docker run.
It will end up the applications are being signed with different
certificates on each docker run.
Fixes#9498.
Change-Id: Ibac202b828224287ec6fdc3eaff659de5fce61c3
Reviewed-on: https://go-review.googlesource.com/2266
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Add necessary files to build and run example/sprite.
Change main.go to get image from assets.
Change-Id: Ic3065aab97f59c34f2c0446ab4b46840305b5864
Reviewed-on: https://go-review.googlesource.com/1882
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Add windows batch files to build and run examples
Change-Id: I9102ceb5c47f692730a8b024648b1d10ff49b624
Reviewed-on: https://go-review.googlesource.com/1622
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Android delivers events in a batch. Previously, only the first event of the batch was passed to the Go callback, resulting in many events (typically corresponding to non-primary touches) being dropped.
Change-Id: I4b01bb6c4d1c88dec6c8fa379875043dfc0e9986
Reviewed-on: https://go-review.googlesource.com/1894
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Still working on how/when to call Stop.
Change-Id: Ice56c4c71ba351765657bb86dc01649c8238859e
Reviewed-on: https://go-review.googlesource.com/1885
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Change-Id: If8ea6aaf2fb2c62eaf4119526a8bb46b8a84b982
Reviewed-on: https://go-review.googlesource.com/1881
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
android device.
It assumes it runs in golang.org/x/mobile repository.
This script copies the repository source tree into the connected device
and invokes go test that runs using the binary compiled from
go_android_exec.go. go_android_exec arranges to push and run the test
binary to the right place in the android device.
Change-Id: I4ac24bcfd8e26e01cccd3d7c2dddaf6b3c14951e
Reviewed-on: https://go-review.googlesource.com/1680
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Change-Id: I90a813c0823498297ff0bb7718bee6cd61b87581
Reviewed-on: https://go-review.googlesource.com/1517
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Change-Id: I73a6d37ecc1827fa65c94cd6d743874785f7e93a
Reviewed-on: https://go-review.googlesource.com/1374
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
The new testLongString triggers the bug without this change.
Fixesgolang/go#9251.
Change-Id: I463e2897b5b08f53801f151c7311d591546c0719
Reviewed-on: https://go-review.googlesource.com/1373
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Change-Id: I4bf795cfe76daae9a922c671722db3e2fa44a0c0
Reviewed-on: https://go-review.googlesource.com/1320
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Change-Id: Ibfdd36f306d9a52f226904aa99653dc1b932410b
Reviewed-on: https://go-review.googlesource.com/1289
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Some Android systems cannot read from /proc/self/auxv. Work around
this by creating a minimal fake auxv for the Go runtime.
Fixes#9229
Change-Id: Id2d743f43d91be23006aac708a5b5b5cd60a6dca
Reviewed-on: https://go-review.googlesource.com/1284
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Change-Id: Icad6cb694b31924164483609e0fd9c7cce8e3f0d
Reviewed-on: https://go-review.googlesource.com/1185
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
C changes the types silently, so there's no need for the code to be
different (beyond the standard header ifdef boilerplate).
Change-Id: I0eddb5fa050c083cdac9db499634bf3d1bb9bb04
Reviewed-on: https://go-review.googlesource.com/1184
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Change-Id: I2ff85d2b4529fc12e08404c93266b827dd88b8ef
Reviewed-on: https://go-review.googlesource.com/1183
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Moved to github.com/crawshaw/gopher3d for now, to simplify
the licensing story for the go.mobile subprepository.
LGTM=hyangah
R=hyangah
CC=golang-codereviews
https://golang.org/cl/182550043
Leave this up to the apps. Right now the current face culling
direction does not match glimage.
LGTM=nigeltao
R=hyangah, nigeltao
CC=golang-codereviews
https://golang.org/cl/185870043