diff --git a/app/src/main/cpp/PhoneDevice.cpp b/app/src/main/cpp/PhoneDevice.cpp index 44527c82..d413109d 100644 --- a/app/src/main/cpp/PhoneDevice.cpp +++ b/app/src/main/cpp/PhoneDevice.cpp @@ -775,9 +775,10 @@ bool CPhoneDevice::TakePhoto(const IDevice::PHOTO_INFO& photoInfo, const vector< params.orientation = mPhotoInfo.orientation; // GpioControl::EnableGpio(CMD_SET_CAM_3V3_EN_STATE, true); + bool res = false; JNIEnv* env = NULL; bool didAttachThread = false; - bool res = GetJniEnv(m_vm, &env, didAttachThread); + res = GetJniEnv(m_vm, &env, didAttachThread); if (!res) { ALOGE("Failed to get JNI Env"); @@ -790,7 +791,6 @@ bool CPhoneDevice::TakePhoto(const IDevice::PHOTO_INFO& photoInfo, const vector< } TurnOnCameraPower(env); - res = true; if (mPhotoInfo.mediaType == 0) {