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

Commit 01803f65 authored by Sean Stout's avatar Sean Stout Committed by Android (Google) Code Review
Browse files

Merge "Include display ID in user activity reporting" into sc-dev

parents 38f5ed3d b4e0a599
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -105,7 +105,7 @@ private:

    void notifySwitch(nsecs_t, uint32_t, uint32_t, uint32_t) override {}

    void pokeUserActivity(nsecs_t, int32_t) override {}
    void pokeUserActivity(nsecs_t, int32_t, int32_t) override {}

    bool checkInjectEventsPermissionNonReentrant(int32_t, int32_t) override { return false; }

+1 −0
Original line number Diff line number Diff line
@@ -273,6 +273,7 @@ struct CommandEntry {
    bool enabled;
    int32_t pid;
    nsecs_t consumeTime; // time when the event was consumed by InputConsumer
    int32_t displayId;
};

} // namespace android::inputdispatcher
+3 −1
Original line number Diff line number Diff line
@@ -2591,6 +2591,7 @@ void InputDispatcher::pokeUserActivityLocked(const EventEntry& eventEntry) {
            std::make_unique<CommandEntry>(&InputDispatcher::doPokeUserActivityLockedInterruptible);
    commandEntry->eventTime = eventEntry.eventTime;
    commandEntry->userActivityEventType = eventType;
    commandEntry->displayId = displayId;
    postCommandLocked(std::move(commandEntry));
}

@@ -5715,7 +5716,8 @@ bool InputDispatcher::afterMotionEventLockedInterruptible(const sp<Connection>&
void InputDispatcher::doPokeUserActivityLockedInterruptible(CommandEntry* commandEntry) {
    mLock.unlock();

    mPolicy->pokeUserActivity(commandEntry->eventTime, commandEntry->userActivityEventType);
    mPolicy->pokeUserActivity(commandEntry->eventTime, commandEntry->userActivityEventType,
                              commandEntry->displayId);

    mLock.lock();
}
+1 −1
Original line number Diff line number Diff line
@@ -134,7 +134,7 @@ public:
                              uint32_t policyFlags) = 0;

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

    /* Checks whether a given application pid/uid has permission to inject input events
     * into other applications.
+1 −1
Original line number Diff line number Diff line
@@ -377,7 +377,7 @@ private:
        mLastNotifySwitch = NotifySwitchArgs(1 /*id*/, when, policyFlags, switchValues, switchMask);
    }

    void pokeUserActivity(nsecs_t, int32_t) override {}
    void pokeUserActivity(nsecs_t, int32_t, int32_t) override {}

    bool checkInjectEventsPermissionNonReentrant(int32_t, int32_t) override { return false; }