* Retrieve current rotation from Java side * * @return current rotation angle */
| 26 | * @return current rotation angle |
| 27 | */ |
| 28 | int CameraEngine::GetDisplayRotation() { |
| 29 | ASSERT(app_, "Application is not initialized"); |
| 30 | |
| 31 | JNIEnv* env; |
| 32 | ANativeActivity* activity = app_->activity; |
| 33 | activity->vm->GetEnv((void**)&env, JNI_VERSION_1_6); |
| 34 | |
| 35 | activity->vm->AttachCurrentThread(&env, NULL); |
| 36 | |
| 37 | jobject activityObj = env->NewGlobalRef(activity->clazz); |
| 38 | jclass clz = env->GetObjectClass(activityObj); |
| 39 | jint newOrientation = env->CallIntMethod( |
| 40 | activityObj, env->GetMethodID(clz, "getRotationDegree", "()I")); |
| 41 | env->DeleteGlobalRef(activityObj); |
| 42 | |
| 43 | activity->vm->DetachCurrentThread(); |
| 44 | return newOrientation; |
| 45 | } |
| 46 | |
| 47 | /** |
| 48 | * Initializate UI on Java side. The 2 seekBars' values are passed in |
nothing calls this directly
no test coverage detected