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

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

Merge "Use std::function for commands"

parents 61eba0db 49a350ae
Loading
Loading
Loading
Loading
+16 −16
Original line number Diff line number Diff line
@@ -715,7 +715,7 @@ bool InputDispatcher::runCommandsLockedInterruptible() {
        CommandEntry* commandEntry = mCommandQueue.dequeueAtHead();

        Command command = commandEntry->command;
        (this->*command)(commandEntry); // commands are implicitly 'LockedInterruptible'
        command(*this, commandEntry); // commands are implicitly 'LockedInterruptible'

        commandEntry->connection.clear();
        delete commandEntry;
@@ -809,8 +809,8 @@ bool InputDispatcher::dispatchConfigurationChangedLocked(
    resetKeyRepeatLocked();

    // Enqueue a command to run outside the lock to tell the policy that the configuration changed.
    CommandEntry* commandEntry = postCommandLocked(
            & InputDispatcher::doNotifyConfigurationChangedLockedInterruptible);
    CommandEntry* commandEntry =
            postCommandLocked(&InputDispatcher::doNotifyConfigurationChangedLockedInterruptible);
    commandEntry->eventTime = entry->eventTime;
    return true;
}
@@ -1982,8 +1982,8 @@ void InputDispatcher::pokeUserActivityLocked(const EventEntry* eventEntry) {
    }
    }

    CommandEntry* commandEntry = postCommandLocked(
            & InputDispatcher::doPokeUserActivityLockedInterruptible);
    CommandEntry* commandEntry =
            postCommandLocked(&InputDispatcher::doPokeUserActivityLockedInterruptible);
    commandEntry->eventTime = eventEntry->eventTime;
    commandEntry->userActivityEventType = eventType;
}
@@ -2200,8 +2200,8 @@ void InputDispatcher::dispatchPointerDownOutsideFocus(uint32_t source, int32_t a
        return;
    }

    CommandEntry* commandEntry = postCommandLocked(
            & InputDispatcher::doOnPointerDownOutsideFocusLockedInterruptible);
    CommandEntry* commandEntry =
            postCommandLocked(&InputDispatcher::doOnPointerDownOutsideFocusLockedInterruptible);
    commandEntry->newToken = newToken;
}

@@ -4087,8 +4087,8 @@ ssize_t InputDispatcher::getConnectionIndexLocked(const sp<InputChannel>& inputC

void InputDispatcher::onDispatchCycleFinishedLocked(
        nsecs_t currentTime, const sp<Connection>& connection, uint32_t seq, bool handled) {
    CommandEntry* commandEntry = postCommandLocked(
            & InputDispatcher::doDispatchCycleFinishedLockedInterruptible);
    CommandEntry* commandEntry =
            postCommandLocked(&InputDispatcher::doDispatchCycleFinishedLockedInterruptible);
    commandEntry->connection = connection;
    commandEntry->eventTime = currentTime;
    commandEntry->seq = seq;
@@ -4100,8 +4100,8 @@ void InputDispatcher::onDispatchCycleBrokenLocked(
    ALOGE("channel '%s' ~ Channel is unrecoverably broken and will be disposed!",
            connection->getInputChannelName().c_str());

    CommandEntry* commandEntry = postCommandLocked(
            & InputDispatcher::doNotifyInputChannelBrokenLockedInterruptible);
    CommandEntry* commandEntry =
            postCommandLocked(&InputDispatcher::doNotifyInputChannelBrokenLockedInterruptible);
    commandEntry->connection = connection;
}

@@ -4109,8 +4109,8 @@ void InputDispatcher::onFocusChangedLocked(const sp<InputWindowHandle>& oldFocus
        const sp<InputWindowHandle>& newFocus) {
    sp<IBinder> oldToken = oldFocus != nullptr ? oldFocus->getToken() : nullptr;
    sp<IBinder> newToken = newFocus != nullptr ? newFocus->getToken() : nullptr;
    CommandEntry* commandEntry = postCommandLocked(
            & InputDispatcher::doNotifyFocusChangedLockedInterruptible);
    CommandEntry* commandEntry =
            postCommandLocked(&InputDispatcher::doNotifyFocusChangedLockedInterruptible);
    commandEntry->oldToken = oldToken;
    commandEntry->newToken = newToken;
}
@@ -4142,8 +4142,8 @@ void InputDispatcher::onANRLocked(
    mLastANRState += StringPrintf(INDENT2 "Reason: %s\n", reason);
    dumpDispatchStateLocked(mLastANRState);

    CommandEntry* commandEntry = postCommandLocked(
            & InputDispatcher::doNotifyANRLockedInterruptible);
    CommandEntry* commandEntry =
            postCommandLocked(&InputDispatcher::doNotifyANRLockedInterruptible);
    commandEntry->inputApplicationHandle = applicationHandle;
    commandEntry->inputChannel = windowHandle != nullptr ?
            getInputChannelLocked(windowHandle->getToken()) : nullptr;
+1 −1
Original line number Diff line number Diff line
@@ -644,7 +644,7 @@ private:
    //
    // Commands are implicitly 'LockedInterruptible'.
    struct CommandEntry;
    typedef void (InputDispatcher::*Command)(CommandEntry* commandEntry);
    typedef std::function<void(InputDispatcher&, CommandEntry*)> Command;

    class Connection;
    struct CommandEntry : Link<CommandEntry> {