* Initiate a Camera Run-time usage request to Java side implementation * [ The request result will be passed back in function * notifyCameraPermission()] */
| 122 | * notifyCameraPermission()] |
| 123 | */ |
| 124 | void CameraEngine::RequestCameraPermission() { |
| 125 | if (!app_) return; |
| 126 | |
| 127 | JNIEnv* env; |
| 128 | ANativeActivity* activity = app_->activity; |
| 129 | activity->vm->GetEnv((void**)&env, JNI_VERSION_1_6); |
| 130 | |
| 131 | activity->vm->AttachCurrentThread(&env, NULL); |
| 132 | |
| 133 | jobject activityObj = env->NewGlobalRef(activity->clazz); |
| 134 | jclass clz = env->GetObjectClass(activityObj); |
| 135 | env->CallVoidMethod(activityObj, |
| 136 | env->GetMethodID(clz, "RequestCamera", "()V")); |
| 137 | env->DeleteGlobalRef(activityObj); |
| 138 | |
| 139 | activity->vm->DetachCurrentThread(); |
| 140 | } |
| 141 | /** |
| 142 | * Process to user's sensitivity and exposure value change |
| 143 | * all values are represented in int64_t even exposure is just int32_t |
nothing calls this directly
no test coverage detected