Loading services/core/jni/com_android_server_input_InputManagerService.cpp +11 −6 Original line number Diff line number Diff line Loading @@ -260,8 +260,7 @@ static std::string getStringElementFromJavaArray(JNIEnv* env, jobjectArray array // --- NativeInputManager --- class NativeInputManager : public virtual RefBase, public virtual InputReaderPolicyInterface, class NativeInputManager : public virtual InputReaderPolicyInterface, public virtual InputDispatcherPolicyInterface, public virtual PointerControllerPolicyInterface { protected: Loading Loading @@ -1520,8 +1519,14 @@ static jlong nativeInit(JNIEnv* env, jclass /* clazz */, jobject serviceObj, return 0; } NativeInputManager* im = new NativeInputManager(serviceObj, messageQueue->getLooper()); im->incStrong(0); static std::once_flag nativeInitialize; NativeInputManager* im = nullptr; std::call_once(nativeInitialize, [&]() { // Create the NativeInputManager, which should not be destroyed or deallocated for the // lifetime of the process. im = new NativeInputManager(serviceObj, messageQueue->getLooper()); }); LOG_ALWAYS_FATAL_IF(im == nullptr, "NativeInputManager was already initialized."); return reinterpret_cast<jlong>(im); } Loading Loading
services/core/jni/com_android_server_input_InputManagerService.cpp +11 −6 Original line number Diff line number Diff line Loading @@ -260,8 +260,7 @@ static std::string getStringElementFromJavaArray(JNIEnv* env, jobjectArray array // --- NativeInputManager --- class NativeInputManager : public virtual RefBase, public virtual InputReaderPolicyInterface, class NativeInputManager : public virtual InputReaderPolicyInterface, public virtual InputDispatcherPolicyInterface, public virtual PointerControllerPolicyInterface { protected: Loading Loading @@ -1520,8 +1519,14 @@ static jlong nativeInit(JNIEnv* env, jclass /* clazz */, jobject serviceObj, return 0; } NativeInputManager* im = new NativeInputManager(serviceObj, messageQueue->getLooper()); im->incStrong(0); static std::once_flag nativeInitialize; NativeInputManager* im = nullptr; std::call_once(nativeInitialize, [&]() { // Create the NativeInputManager, which should not be destroyed or deallocated for the // lifetime of the process. im = new NativeInputManager(serviceObj, messageQueue->getLooper()); }); LOG_ALWAYS_FATAL_IF(im == nullptr, "NativeInputManager was already initialized."); return reinterpret_cast<jlong>(im); } Loading