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

Commit bf48b571 authored by Jeff Brown's avatar Jeff Brown Committed by Android (Google) Code Review
Browse files

Merge "Use BTN_TOUCH or BTN_TOOL_* to determine if touch active. Bug: 5064702"

parents f167213a d87c6d5f
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -1170,9 +1170,8 @@ int32_t TouchButtonAccumulator::getToolType() const {
    return AMOTION_EVENT_TOOL_TYPE_UNKNOWN;
}

bool TouchButtonAccumulator::isActive() const {
    return mBtnTouch || mBtnToolFinger || mBtnToolPen
            || mBtnToolRubber || mBtnStylus || mBtnStylus2;
bool TouchButtonAccumulator::isToolActive() const {
    return mBtnTouch || mBtnToolFinger || mBtnToolPen || mBtnToolRubber;
}

bool TouchButtonAccumulator::isHovering() const {
@@ -5144,7 +5143,7 @@ void SingleTouchInputMapper::sync(nsecs_t when) {
    mCurrentRawPointerData.clear();
    mCurrentButtonState = 0;

    if (mTouchButtonAccumulator.isActive()) {
    if (mTouchButtonAccumulator.isToolActive()) {
        mCurrentRawPointerData.pointerCount = 1;
        mCurrentRawPointerData.idToIndex[0] = 0;

@@ -5168,10 +5167,10 @@ void SingleTouchInputMapper::sync(nsecs_t when) {
            outPointer.toolType = AMOTION_EVENT_TOOL_TYPE_FINGER;
        }
        outPointer.isHovering = isHovering;
    }

    mCurrentButtonState = mTouchButtonAccumulator.getButtonState()
            | mCursorButtonAccumulator.getButtonState();
    }

    syncTouch(when, true);
}
+1 −1
Original line number Diff line number Diff line
@@ -526,7 +526,7 @@ public:

    uint32_t getButtonState() const;
    int32_t getToolType() const;
    bool isActive() const;
    bool isToolActive() const;
    bool isHovering() const;

private: