Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0e94797b authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Move createKeyEvent to a static function"

parents 5a67ed3e 2e2ea99e
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -445,6 +445,14 @@ static sp<IPlatformCompatNative> getCompatService() {
    return interface_cast<IPlatformCompatNative>(service);
}

static KeyEvent createKeyEvent(const KeyEntry& entry) {
    KeyEvent event;
    event.initialize(entry.id, entry.deviceId, entry.source, entry.displayId, INVALID_HMAC,
                     entry.action, entry.flags, entry.keyCode, entry.scanCode, entry.metaState,
                     entry.repeatCount, entry.downTime, entry.eventTime);
    return event;
}

// --- InputDispatcher ---

InputDispatcher::InputDispatcher(const sp<InputDispatcherPolicyInterface>& policy)
@@ -3217,8 +3225,8 @@ int InputDispatcher::handleReceiveCallback(int fd, int events, void* data) {

void InputDispatcher::synthesizeCancelationEventsForAllConnectionsLocked(
        const CancelationOptions& options) {
    for (const auto& pair : mConnectionsByFd) {
        synthesizeCancelationEventsForConnectionLocked(pair.second, options);
    for (const auto& [fd, connection] : mConnectionsByFd) {
        synthesizeCancelationEventsForConnectionLocked(connection, options);
    }
}

@@ -5651,14 +5659,6 @@ void InputDispatcher::doPokeUserActivityLockedInterruptible(CommandEntry* comman
    mLock.lock();
}

KeyEvent InputDispatcher::createKeyEvent(const KeyEntry& entry) {
    KeyEvent event;
    event.initialize(entry.id, entry.deviceId, entry.source, entry.displayId, INVALID_HMAC,
                     entry.action, entry.flags, entry.keyCode, entry.scanCode, entry.metaState,
                     entry.repeatCount, entry.downTime, entry.eventTime);
    return event;
}

void InputDispatcher::reportDispatchStatistics(std::chrono::nanoseconds eventDuration,
                                               const Connection& connection, bool handled) {
    // TODO Write some statistics about how long we spend waiting.
+0 −1
Original line number Diff line number Diff line
@@ -610,7 +610,6 @@ private:
                                             DispatchEntry* dispatchEntry, MotionEntry& motionEntry,
                                             bool handled) REQUIRES(mLock);
    void doPokeUserActivityLockedInterruptible(CommandEntry* commandEntry) REQUIRES(mLock);
    KeyEvent createKeyEvent(const KeyEntry& entry);
    void doOnPointerDownOutsideFocusLockedInterruptible(CommandEntry* commandEntry) REQUIRES(mLock);

    // Statistics gathering.