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

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

Merge "Return early in doDispatchCycleFinishedLockedInterruptible"

parents d82627cd 4e68fbfe
Loading
Loading
Loading
Loading
+42 −40
Original line number Diff line number Diff line
@@ -4237,13 +4237,16 @@ void InputDispatcher::doOnPointerDownOutsideFocusLockedInterruptible(CommandEntr
void InputDispatcher::doDispatchCycleFinishedLockedInterruptible(
        CommandEntry* commandEntry) {
    sp<Connection> connection = commandEntry->connection;
    nsecs_t finishTime = commandEntry->eventTime;
    const nsecs_t finishTime = commandEntry->eventTime;
    uint32_t seq = commandEntry->seq;
    bool handled = commandEntry->handled;
    const bool handled = commandEntry->handled;

    // Handle post-event policy actions.
    DispatchEntry* dispatchEntry = connection->findWaitQueueEntry(seq);
    if (dispatchEntry) {
    if (!dispatchEntry) {
        return;
    }

    nsecs_t eventDuration = finishTime - dispatchEntry->deliveryTime;
    if (eventDuration > SLOW_EVENT_PROCESSING_WARNING_TIMEOUT) {
        std::string msg =
@@ -4256,12 +4259,12 @@ void InputDispatcher::doDispatchCycleFinishedLockedInterruptible(
    bool restartEvent;
    if (dispatchEntry->eventEntry->type == EventEntry::TYPE_KEY) {
        KeyEntry* keyEntry = static_cast<KeyEntry*>(dispatchEntry->eventEntry);
            restartEvent = afterKeyEventLockedInterruptible(connection,
                    dispatchEntry, keyEntry, handled);
        restartEvent =
                afterKeyEventLockedInterruptible(connection, dispatchEntry, keyEntry, handled);
    } else if (dispatchEntry->eventEntry->type == EventEntry::TYPE_MOTION) {
        MotionEntry* motionEntry = static_cast<MotionEntry*>(dispatchEntry->eventEntry);
            restartEvent = afterMotionEventLockedInterruptible(connection,
                    dispatchEntry, motionEntry, handled);
        restartEvent = afterMotionEventLockedInterruptible(connection, dispatchEntry, motionEntry,
                                                           handled);
    } else {
        restartEvent = false;
    }
@@ -4284,7 +4287,6 @@ void InputDispatcher::doDispatchCycleFinishedLockedInterruptible(
    // Start the next dispatch cycle for this connection.
    startDispatchCycleLocked(now(), connection);
}
}

bool InputDispatcher::afterKeyEventLockedInterruptible(const sp<Connection>& connection,
        DispatchEntry* dispatchEntry, KeyEntry* keyEntry, bool handled) {