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

Unverified Commit a0d02a4f authored by Corinna Vinschen's avatar Corinna Vinschen Committed by Michael Bestas
Browse files

InputDispatcher: On keypress, deliver keycode to pokeUserActivity



Change-Id: I8f64a6fa9b4b2e4520e25731f55e89f5087c70da
Signed-off-by: default avatarCorinna Vinschen <xda@vinschen.de>
parent 6c534408
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -3298,6 +3298,7 @@ void InputDispatcher::pokeUserActivityLocked(const EventEntry& eventEntry) {
        }
    }

    int32_t keyCode = AKEYCODE_UNKNOWN;
    switch (eventEntry.type) {
        case EventEntry::Type::MOTION: {
            const MotionEntry& motionEntry = static_cast<const MotionEntry&>(eventEntry);
@@ -3328,6 +3329,8 @@ void InputDispatcher::pokeUserActivityLocked(const EventEntry& eventEntry) {
                }
                return;
            }

            keyCode = keyEntry.keyCode;
            break;
        }
        default: {
@@ -3338,10 +3341,10 @@ void InputDispatcher::pokeUserActivityLocked(const EventEntry& eventEntry) {
    }

    mLastUserActivityTimes[eventType] = eventEntry.eventTime;
    auto command = [this, eventTime = eventEntry.eventTime, eventType, displayId]()
    auto command = [this, eventTime = eventEntry.eventTime, eventType, displayId, keyCode]()
                           REQUIRES(mLock) {
                               scoped_unlock unlock(mLock);
                               mPolicy.pokeUserActivity(eventTime, eventType, displayId);
                               mPolicy.pokeUserActivity(eventTime, eventType, displayId, keyCode);
                           };
    postCommandLocked(std::move(command));
}
+1 −1
Original line number Diff line number Diff line
@@ -126,7 +126,7 @@ public:

    /* Poke user activity for an event dispatched to a window. */
    virtual void pokeUserActivity(nsecs_t eventTime, int32_t eventType,
                                  ui::LogicalDisplayId displayId) = 0;
                                  ui::LogicalDisplayId displayId, int32_t keyCode) = 0;

    /*
     * Return true if the provided event is stale, and false otherwise. Used for determining