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

Commit 21da0fff authored by Atif Niyaz's avatar Atif Niyaz
Browse files

Remove handling of EV_MSC/MSC_TIMESTAMP in Input

MSC_TIMESTAMP is not being utilized anymore to report timestamps from
drivers. MSC_TIMESTAMP and all other utilizations of it are removed.

Bug: 119840121
Test: No crashes happening after building and running on flame
Change-Id: I4d9bec3d763bee3583c351b4240f145a21711e33
parent b4db9d86
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -358,6 +358,7 @@ common::V1_0::MotionEvent notifyMotionArgsToHalMotionEvent(const NotifyMotionArg
    event.displayId = args.displayId;
    event.downTime = args.downTime;
    event.eventTime = args.eventTime;
    event.deviceTimestamp = 0;
    event.action = getAction(args.action & AMOTION_EVENT_ACTION_MASK);
    event.actionIndex = getActionIndex(args.action);
    event.actionButton = getActionButton(args.actionButton);
@@ -375,7 +376,6 @@ common::V1_0::MotionEvent notifyMotionArgsToHalMotionEvent(const NotifyMotionArg
    event.pointerProperties = pointerProperties;
    event.pointerCoords = pointerCoords;

    event.deviceTimestamp = args.deviceTimestamp;
    event.frames = convertVideoFrames(args.videoFrames);

    return event;
+5 −7
Original line number Diff line number Diff line
@@ -92,10 +92,10 @@ NotifyMotionArgs::NotifyMotionArgs(
        uint32_t sequenceNum, nsecs_t eventTime, int32_t deviceId, uint32_t source,
        int32_t displayId, uint32_t policyFlags, int32_t action, int32_t actionButton,
        int32_t flags, int32_t metaState, int32_t buttonState, MotionClassification classification,
        int32_t edgeFlags, uint32_t deviceTimestamp, uint32_t pointerCount,
        const PointerProperties* pointerProperties, const PointerCoords* pointerCoords,
        float xPrecision, float yPrecision, float xCursorPosition, float yCursorPosition,
        nsecs_t downTime, const std::vector<TouchVideoFrame>& videoFrames)
        int32_t edgeFlags, uint32_t pointerCount, const PointerProperties* pointerProperties,
        const PointerCoords* pointerCoords, float xPrecision, float yPrecision,
        float xCursorPosition, float yCursorPosition, nsecs_t downTime,
        const std::vector<TouchVideoFrame>& videoFrames)
      : NotifyArgs(sequenceNum, eventTime),
        deviceId(deviceId),
        source(source),
@@ -108,7 +108,6 @@ NotifyMotionArgs::NotifyMotionArgs(
        buttonState(buttonState),
        classification(classification),
        edgeFlags(edgeFlags),
        deviceTimestamp(deviceTimestamp),
        pointerCount(pointerCount),
        xPrecision(xPrecision),
        yPrecision(yPrecision),
@@ -135,7 +134,6 @@ NotifyMotionArgs::NotifyMotionArgs(const NotifyMotionArgs& other)
        buttonState(other.buttonState),
        classification(other.classification),
        edgeFlags(other.edgeFlags),
        deviceTimestamp(other.deviceTimestamp),
        pointerCount(other.pointerCount),
        xPrecision(other.xPrecision),
        yPrecision(other.yPrecision),
@@ -159,7 +157,7 @@ bool NotifyMotionArgs::operator==(const NotifyMotionArgs& rhs) const {
            policyFlags == rhs.policyFlags && action == rhs.action &&
            actionButton == rhs.actionButton && flags == rhs.flags && metaState == rhs.metaState &&
            buttonState == rhs.buttonState && classification == rhs.classification &&
            edgeFlags == rhs.edgeFlags && deviceTimestamp == rhs.deviceTimestamp &&
            edgeFlags == rhs.edgeFlags &&
            pointerCount == rhs.pointerCount
            // PointerProperties and PointerCoords are compared separately below
            && xPrecision == rhs.xPrecision && yPrecision == rhs.yPrecision &&
+78 −110

File changed.

Preview size limit exceeded, changes collapsed.

+0 −9
Original line number Diff line number Diff line
@@ -717,7 +717,6 @@ public:

    inline size_t getSlotCount() const { return mSlotCount; }
    inline const Slot* getSlot(size_t index) const { return &mSlots[index]; }
    inline uint32_t getDeviceTimestamp() const { return mDeviceTimestamp; }

private:
    int32_t mCurrentSlot;
@@ -725,7 +724,6 @@ private:
    size_t mSlotCount;
    bool mUsingSlotsProtocol;
    bool mHaveStylus;
    uint32_t mDeviceTimestamp;

    void clearSlots(int32_t initialSlot);
};
@@ -1174,7 +1172,6 @@ protected:

    struct RawState {
        nsecs_t when;
        uint32_t deviceTimestamp;

        // Raw pointer sample data.
        RawPointerData rawPointerData;
@@ -1187,7 +1184,6 @@ protected:

        void copyFrom(const RawState& other) {
            when = other.when;
            deviceTimestamp = other.deviceTimestamp;
            rawPointerData.copyFrom(other.rawPointerData);
            buttonState = other.buttonState;
            rawVScroll = other.rawVScroll;
@@ -1196,7 +1192,6 @@ protected:

        void clear() {
            when = 0;
            deviceTimestamp = 0;
            rawPointerData.clear();
            buttonState = 0;
            rawVScroll = 0;
@@ -1205,7 +1200,6 @@ protected:
    };

    struct CookedState {
        uint32_t deviceTimestamp;
        // Cooked pointer sample data.
        CookedPointerData cookedPointerData;

@@ -1217,7 +1211,6 @@ protected:
        int32_t buttonState;

        void copyFrom(const CookedState& other) {
            deviceTimestamp = other.deviceTimestamp;
            cookedPointerData.copyFrom(other.cookedPointerData);
            fingerIdBits = other.fingerIdBits;
            stylusIdBits = other.stylusIdBits;
@@ -1226,7 +1219,6 @@ protected:
        }

        void clear() {
            deviceTimestamp = 0;
            cookedPointerData.clear();
            fingerIdBits.clear();
            stylusIdBits.clear();
@@ -1634,7 +1626,6 @@ private:
    void dispatchMotion(nsecs_t when, uint32_t policyFlags, uint32_t source,
            int32_t action, int32_t actionButton,
            int32_t flags, int32_t metaState, int32_t buttonState, int32_t edgeFlags,
            uint32_t deviceTimestamp,
            const PointerProperties* properties, const PointerCoords* coords,
            const uint32_t* idToIndex, BitSet32 idBits,
            int32_t changedId, float xPrecision, float yPrecision, nsecs_t downTime);
+2 −9
Original line number Diff line number Diff line
@@ -107,13 +107,7 @@ struct NotifyMotionArgs : public NotifyArgs {
     */
    MotionClassification classification;
    int32_t edgeFlags;
    /**
     * A timestamp in the input device's time base, not the platform's.
     * The units are microseconds since the last reset.
     * This can only be compared to other device timestamps from the same device.
     * This value will overflow after a little over an hour.
     */
    uint32_t deviceTimestamp;

    uint32_t pointerCount;
    PointerProperties pointerProperties[MAX_POINTERS];
    PointerCoords pointerCoords[MAX_POINTERS];
@@ -134,8 +128,7 @@ struct NotifyMotionArgs : public NotifyArgs {
    NotifyMotionArgs(uint32_t sequenceNum, nsecs_t eventTime, int32_t deviceId, uint32_t source,
                     int32_t displayId, uint32_t policyFlags, int32_t action, int32_t actionButton,
                     int32_t flags, int32_t metaState, int32_t buttonState,
                     MotionClassification classification, int32_t edgeFlags,
                     uint32_t deviceTimestamp, uint32_t pointerCount,
                     MotionClassification classification, int32_t edgeFlags, uint32_t pointerCount,
                     const PointerProperties* pointerProperties, const PointerCoords* pointerCoords,
                     float xPrecision, float yPrecision, float xCursorPosition,
                     float yCursorPosition, nsecs_t downTime,
Loading