Added JNI hack to support JNI hack

Some of our graphics code wants to get a pointer, release it, and then
continue to use it.  The "forcecopy" mode of CheckJNI was designed
to find any code that does this.  It succeeded.

To support the behavior, we provide a JNI helper function that does
the dirty work.  It passes a magic value into the Get and Release calls
that causes "forcecopy" to skip the copy.  When forcecopy is not
enabled, the values are simply ignored.

To avoid any possibility of the function getting published in the NDK,
the function is not described in JNIHelp.h.

Bug 3409356

Change-Id: Ibd20d12ba6d3d3236ebf5760f7ccaa8c557e3774
2 files changed