summaryrefslogtreecommitdiffstats
path: root/core/jni
diff options
context:
space:
mode:
authorDave Sparks <davidsparks@android.com>2009-07-10 16:10:49 -0700
committerDave Sparks <davidsparks@android.com>2009-07-10 16:10:49 -0700
commit75acd896483b65ffd6cd445201b9cdcfa201ad78 (patch)
treeec149e90854a61886d496ec09357dfea4726ce12 /core/jni
parentb1665f2e15439f693b1ef75cb1c07593f99edde7 (diff)
downloadframeworks_base-75acd896483b65ffd6cd445201b9cdcfa201ad78.zip
frameworks_base-75acd896483b65ffd6cd445201b9cdcfa201ad78.tar.gz
frameworks_base-75acd896483b65ffd6cd445201b9cdcfa201ad78.tar.bz2
Avoid memcpy's by using GetPrimitiveArrayCritical.
Diffstat (limited to 'core/jni')
-rw-r--r--core/jni/android_hardware_Camera.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/jni/android_hardware_Camera.cpp b/core/jni/android_hardware_Camera.cpp
index 57b5aa6..b841076 100644
--- a/core/jni/android_hardware_Camera.cpp
+++ b/core/jni/android_hardware_Camera.cpp
@@ -143,9 +143,9 @@ void JNICameraContext::copyAndPost(JNIEnv* env, const sp<IMemory>& dataPtr, int
LOGE("Couldn't allocate byte array for JPEG data");
env->ExceptionClear();
} else {
- jbyte *bytes = env->GetByteArrayElements(obj, NULL);
+ jbyte *bytes = static_cast<jbyte*>(env->GetPrimitiveArrayCritical(obj, NULL));
memcpy(bytes, data, size);
- env->ReleaseByteArrayElements(obj, bytes, 0);
+ env->ReleasePrimitiveArrayCritical(obj, bytes, 0);
}
} else {