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

Commit b7d47a7e authored by Corinna Vinschen's avatar Corinna Vinschen Committed by Nolen Johnson
Browse files

InputDispatcher: On keypress, deliver keycode to pokeUserActivity



Change-Id: I8f64a6fa9b4b2e4520e25731f55e89f5087c70da
Signed-off-by: default avatarCorinna Vinschen <xda@vinschen.de>
parent e876ae50
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -3290,6 +3290,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);
@@ -3318,6 +3319,8 @@ void InputDispatcher::pokeUserActivityLocked(const EventEntry& eventEntry) {
                        << windowDisablingUserActivityInfo->name << "'.";
                return;
            }

            keyCode = keyEntry.keyCode;
            break;
        }
        default: {
@@ -3328,10 +3331,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
@@ -125,7 +125,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