Loading core/jni/android_view_InputChannel.cpp +7 −3 Original line number Diff line number Diff line Loading @@ -203,8 +203,10 @@ static jlong android_view_InputChannel_nativeReadFromParcel(JNIEnv* env, jobject if (parcel) { bool isInitialized = parcel->readInt32(); if (isInitialized) { std::unique_ptr<InputChannel> inputChannel = std::make_unique<InputChannel>(); inputChannel->readFromParcel(parcel); android::os::InputChannelCore parcelableChannel; parcelableChannel.readFromParcel(parcel); std::unique_ptr<InputChannel> inputChannel = InputChannel::create(std::move(parcelableChannel)); NativeInputChannel* nativeInputChannel = new NativeInputChannel(std::move(inputChannel)); return reinterpret_cast<jlong>(nativeInputChannel); Loading @@ -228,7 +230,9 @@ static void android_view_InputChannel_nativeWriteToParcel(JNIEnv* env, jobject o return; } parcel->writeInt32(1); // initialized nativeInputChannel->getInputChannel()->writeToParcel(parcel); android::os::InputChannelCore parcelableChannel; nativeInputChannel->getInputChannel()->copyTo(parcelableChannel); parcelableChannel.writeToParcel(parcel); } static jstring android_view_InputChannel_nativeGetName(JNIEnv* env, jobject obj, jlong channel) { Loading core/jni/android_view_InputEventReceiver.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -189,11 +189,11 @@ status_t NativeInputEventReceiver::reportTimeline(int32_t inputEventId, nsecs_t void NativeInputEventReceiver::setFdEvents(int events) { if (mFdEvents != events) { mFdEvents = events; auto&& fd = mInputConsumer.getChannel()->getFd(); const int fd = mInputConsumer.getChannel()->getFd(); if (events) { mMessageQueue->getLooper()->addFd(fd.get(), 0, events, this, nullptr); mMessageQueue->getLooper()->addFd(fd, 0, events, this, nullptr); } else { mMessageQueue->getLooper()->removeFd(fd.get()); mMessageQueue->getLooper()->removeFd(fd); } } } Loading core/jni/android_view_InputEventSender.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -102,8 +102,8 @@ NativeInputEventSender::~NativeInputEventSender() { } status_t NativeInputEventSender::initialize() { auto&& receiveFd = mInputPublisher.getChannel()->getFd(); mMessageQueue->getLooper()->addFd(receiveFd.get(), 0, ALOOPER_EVENT_INPUT, this, NULL); const int receiveFd = mInputPublisher.getChannel()->getFd(); mMessageQueue->getLooper()->addFd(receiveFd, 0, ALOOPER_EVENT_INPUT, this, NULL); return OK; } Loading @@ -112,7 +112,7 @@ void NativeInputEventSender::dispose() { LOG(DEBUG) << "channel '" << getInputChannelName() << "' ~ Disposing input event sender."; } mMessageQueue->getLooper()->removeFd(mInputPublisher.getChannel()->getFd().get()); mMessageQueue->getLooper()->removeFd(mInputPublisher.getChannel()->getFd()); } status_t NativeInputEventSender::sendKeyEvent(uint32_t seq, const KeyEvent* event) { Loading Loading
core/jni/android_view_InputChannel.cpp +7 −3 Original line number Diff line number Diff line Loading @@ -203,8 +203,10 @@ static jlong android_view_InputChannel_nativeReadFromParcel(JNIEnv* env, jobject if (parcel) { bool isInitialized = parcel->readInt32(); if (isInitialized) { std::unique_ptr<InputChannel> inputChannel = std::make_unique<InputChannel>(); inputChannel->readFromParcel(parcel); android::os::InputChannelCore parcelableChannel; parcelableChannel.readFromParcel(parcel); std::unique_ptr<InputChannel> inputChannel = InputChannel::create(std::move(parcelableChannel)); NativeInputChannel* nativeInputChannel = new NativeInputChannel(std::move(inputChannel)); return reinterpret_cast<jlong>(nativeInputChannel); Loading @@ -228,7 +230,9 @@ static void android_view_InputChannel_nativeWriteToParcel(JNIEnv* env, jobject o return; } parcel->writeInt32(1); // initialized nativeInputChannel->getInputChannel()->writeToParcel(parcel); android::os::InputChannelCore parcelableChannel; nativeInputChannel->getInputChannel()->copyTo(parcelableChannel); parcelableChannel.writeToParcel(parcel); } static jstring android_view_InputChannel_nativeGetName(JNIEnv* env, jobject obj, jlong channel) { Loading
core/jni/android_view_InputEventReceiver.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -189,11 +189,11 @@ status_t NativeInputEventReceiver::reportTimeline(int32_t inputEventId, nsecs_t void NativeInputEventReceiver::setFdEvents(int events) { if (mFdEvents != events) { mFdEvents = events; auto&& fd = mInputConsumer.getChannel()->getFd(); const int fd = mInputConsumer.getChannel()->getFd(); if (events) { mMessageQueue->getLooper()->addFd(fd.get(), 0, events, this, nullptr); mMessageQueue->getLooper()->addFd(fd, 0, events, this, nullptr); } else { mMessageQueue->getLooper()->removeFd(fd.get()); mMessageQueue->getLooper()->removeFd(fd); } } } Loading
core/jni/android_view_InputEventSender.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -102,8 +102,8 @@ NativeInputEventSender::~NativeInputEventSender() { } status_t NativeInputEventSender::initialize() { auto&& receiveFd = mInputPublisher.getChannel()->getFd(); mMessageQueue->getLooper()->addFd(receiveFd.get(), 0, ALOOPER_EVENT_INPUT, this, NULL); const int receiveFd = mInputPublisher.getChannel()->getFd(); mMessageQueue->getLooper()->addFd(receiveFd, 0, ALOOPER_EVENT_INPUT, this, NULL); return OK; } Loading @@ -112,7 +112,7 @@ void NativeInputEventSender::dispose() { LOG(DEBUG) << "channel '" << getInputChannelName() << "' ~ Disposing input event sender."; } mMessageQueue->getLooper()->removeFd(mInputPublisher.getChannel()->getFd().get()); mMessageQueue->getLooper()->removeFd(mInputPublisher.getChannel()->getFd()); } status_t NativeInputEventSender::sendKeyEvent(uint32_t seq, const KeyEvent* event) { Loading