Merge "Use <chrono> for injectInputEvent timeout" into rvc-dev am: 9467e10d79
Change-Id: Id4441fd3eb661b25618f4e94cd99a01a432e2eeb
This commit is contained in:
committed by
Automerger Merge Worker
commit
253f1714ef
@@ -1453,9 +1453,13 @@ static jint nativeInjectInputEvent(JNIEnv* env, jclass /* clazz */,
|
|||||||
return INPUT_EVENT_INJECTION_FAILED;
|
return INPUT_EVENT_INJECTION_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (jint) im->getInputManager()->getDispatcher()->injectInputEvent(
|
const int32_t result =
|
||||||
& keyEvent, injectorPid, injectorUid, syncMode, timeoutMillis,
|
im->getInputManager()->getDispatcher()->injectInputEvent(&keyEvent, injectorPid,
|
||||||
|
injectorUid, syncMode,
|
||||||
|
std::chrono::milliseconds(
|
||||||
|
timeoutMillis),
|
||||||
uint32_t(policyFlags));
|
uint32_t(policyFlags));
|
||||||
|
return static_cast<jint>(result);
|
||||||
} else if (env->IsInstanceOf(inputEventObj, gMotionEventClassInfo.clazz)) {
|
} else if (env->IsInstanceOf(inputEventObj, gMotionEventClassInfo.clazz)) {
|
||||||
const MotionEvent* motionEvent = android_view_MotionEvent_getNativePtr(env, inputEventObj);
|
const MotionEvent* motionEvent = android_view_MotionEvent_getNativePtr(env, inputEventObj);
|
||||||
if (!motionEvent) {
|
if (!motionEvent) {
|
||||||
@@ -1463,9 +1467,13 @@ static jint nativeInjectInputEvent(JNIEnv* env, jclass /* clazz */,
|
|||||||
return INPUT_EVENT_INJECTION_FAILED;
|
return INPUT_EVENT_INJECTION_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (jint) im->getInputManager()->getDispatcher()->injectInputEvent(
|
const int32_t result =
|
||||||
motionEvent, injectorPid, injectorUid, syncMode, timeoutMillis,
|
(jint)im->getInputManager()
|
||||||
|
->getDispatcher()
|
||||||
|
->injectInputEvent(motionEvent, injectorPid, injectorUid, syncMode,
|
||||||
|
std::chrono::milliseconds(timeoutMillis),
|
||||||
uint32_t(policyFlags));
|
uint32_t(policyFlags));
|
||||||
|
return static_cast<jint>(result);
|
||||||
} else {
|
} else {
|
||||||
jniThrowRuntimeException(env, "Invalid input event type.");
|
jniThrowRuntimeException(env, "Invalid input event type.");
|
||||||
return INPUT_EVENT_INJECTION_FAILED;
|
return INPUT_EVENT_INJECTION_FAILED;
|
||||||
|
|||||||
Reference in New Issue
Block a user