diff options
author | Dave Sparks <davidsparks@android.com> | 2009-07-10 16:10:49 -0700 |
---|---|---|
committer | Dave Sparks <davidsparks@android.com> | 2009-07-10 16:10:49 -0700 |
commit | 75acd896483b65ffd6cd445201b9cdcfa201ad78 (patch) | |
tree | ec149e90854a61886d496ec09357dfea4726ce12 /core/jni | |
parent | b1665f2e15439f693b1ef75cb1c07593f99edde7 (diff) | |
download | frameworks_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.cpp | 4 |
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 { |