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

Commit 9a3dd3fe authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Dump dispatcher state before crashing due to unexpected events" into main

parents 8f742998 f91f3c7a
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -693,7 +693,8 @@ std::optional<nsecs_t> getDownTime(const EventEntry& eventEntry) {
 */
std::vector<TouchedWindow> getHoveringWindowsLocked(const TouchState* oldState,
                                                    const TouchState& newTouchState,
                                                    const MotionEntry& entry) {
                                                    const MotionEntry& entry,
                                                    std::function<void()> dump) {
    const int32_t maskedAction = MotionEvent::getActionMasked(entry.action);

    if (maskedAction == AMOTION_EVENT_ACTION_SCROLL) {
@@ -741,6 +742,7 @@ std::vector<TouchedWindow> getHoveringWindowsLocked(const TouchState* oldState,
                    // crashing the device with FATAL.
                    severity = android::base::LogSeverity::ERROR;
                }
                dump();
                LOG(severity) << "Expected ACTION_HOVER_MOVE instead of " << entry.getDescription();
            }
            touchedWindow.dispatchMode = InputTarget::DispatchMode::AS_IS;
@@ -2710,7 +2712,8 @@ InputDispatcher::findTouchedWindowTargetsLocked(nsecs_t currentTime, const Motio
    // Update dispatching for hover enter and exit.
    {
        std::vector<TouchedWindow> hoveringWindows =
                getHoveringWindowsLocked(oldState, tempTouchState, entry);
                getHoveringWindowsLocked(oldState, tempTouchState, entry,
                                         [this]() REQUIRES(mLock) { logDispatchStateLocked(); });
        // Hardcode to single hovering pointer for now.
        std::bitset<MAX_POINTER_ID + 1> pointerIds;
        pointerIds.set(entry.pointerProperties[0].id);