|
|
|
@ -186,24 +186,27 @@ CPhoneDevice::CPhoneDevice(JavaVM* vm, jobject service, const std::string& appPa
|
|
|
|
|
{
|
|
|
|
|
ALOGE("Failed to get JNI Env");
|
|
|
|
|
}
|
|
|
|
|
m_javaService = env->NewGlobalRef(service);
|
|
|
|
|
if (service != NULL)
|
|
|
|
|
{
|
|
|
|
|
m_javaService = env->NewGlobalRef(service);
|
|
|
|
|
|
|
|
|
|
jclass classService = env->GetObjectClass(m_javaService);
|
|
|
|
|
mRegisterHeartbeatMid = env->GetMethodID(classService, "registerHeartbeatTimer", "(IJ)V");
|
|
|
|
|
mUpdateTimeMid = env->GetMethodID(classService, "updateTime", "(J)Z");
|
|
|
|
|
mUpdateCaptureScheduleMid = env->GetMethodID(classService, "updateCaptureSchedule", "(J)Z");
|
|
|
|
|
mStartRecordingMid = env->GetMethodID(classService, "startRecording", "(IJIIIIILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
|
|
|
|
|
jclass classService = env->GetObjectClass(m_javaService);
|
|
|
|
|
mRegisterHeartbeatMid = env->GetMethodID(classService, "registerHeartbeatTimer", "(IJ)V");
|
|
|
|
|
mUpdateTimeMid = env->GetMethodID(classService, "updateTime", "(J)Z");
|
|
|
|
|
mUpdateCaptureScheduleMid = env->GetMethodID(classService, "updateCaptureSchedule", "(J)Z");
|
|
|
|
|
mStartRecordingMid = env->GetMethodID(classService, "startRecording", "(IJIIIIILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
|
|
|
|
|
|
|
|
|
|
mRequestWakelockMid = env->GetMethodID(classService, "requestWakelock", "(Ljava/lang/String;J)V");
|
|
|
|
|
mReleaseWakelockMid = env->GetMethodID(classService, "releaseWakelock", "(Ljava/lang/String;)V");
|
|
|
|
|
mRequestWakelockMid = env->GetMethodID(classService, "requestWakelock", "(Ljava/lang/String;J)V");
|
|
|
|
|
mReleaseWakelockMid = env->GetMethodID(classService, "releaseWakelock", "(Ljava/lang/String;)V");
|
|
|
|
|
|
|
|
|
|
mGetSystemInfoMid = env->GetMethodID(classService, "getSystemInfo", "()Ljava/lang/String;");
|
|
|
|
|
mInstallAppMid = env->GetMethodID(classService, "installApp", "(Ljava/lang/String;J)Z");
|
|
|
|
|
mRebootMid = env->GetMethodID(classService, "reboot", "(IJ)V");
|
|
|
|
|
mEnableGpsMid = env->GetMethodID(classService, "enableGps", "(Z)V");
|
|
|
|
|
mRequestPositionMid = env->GetMethodID(classService, "requestPosition", "()Z");
|
|
|
|
|
mGetSystemInfoMid = env->GetMethodID(classService, "getSystemInfo", "()Ljava/lang/String;");
|
|
|
|
|
mInstallAppMid = env->GetMethodID(classService, "installApp", "(Ljava/lang/String;J)Z");
|
|
|
|
|
mRebootMid = env->GetMethodID(classService, "reboot", "(IJ)V");
|
|
|
|
|
mEnableGpsMid = env->GetMethodID(classService, "enableGps", "(Z)V");
|
|
|
|
|
mRequestPositionMid = env->GetMethodID(classService, "requestPosition", "()Z");
|
|
|
|
|
|
|
|
|
|
env->DeleteLocalRef(classService);
|
|
|
|
|
env->DeleteLocalRef(classService);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (didAttachThread)
|
|
|
|
|
{
|
|
|
|
@ -1591,7 +1594,7 @@ bool CPhoneDevice::OnImageReady(cv::Mat& mat)
|
|
|
|
|
params.push_back(mPhotoInfo.quality);
|
|
|
|
|
|
|
|
|
|
bool res = false;
|
|
|
|
|
std::string fullPath = mPath + CTerminal::BuildPhotoFileName(mPhotoInfo);
|
|
|
|
|
std::string fullPath = endsWith(mPath, ".jpg") ? mPath : (mPath + CTerminal::BuildPhotoFileName(mPhotoInfo));
|
|
|
|
|
if (!std::filesystem::exists(std::filesystem::path(fullPath)))
|
|
|
|
|
{
|
|
|
|
|
bool res = cv::imwrite(fullPath.c_str(), mat, params);
|
|
|
|
|