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

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

Merge "Add input system to Watchdog. Bug: 5094994"

parents 7034e4e6 89ef0720
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1294,4 +1294,11 @@ void EventHub::dump(String8& dump) {
    } // release lock
}

void EventHub::monitor() {
    // Acquire and release the lock to ensure that the event hub has not deadlocked.
    mLock.lock();
    mLock.unlock();
}


}; // namespace android
+5 −0
Original line number Diff line number Diff line
@@ -208,7 +208,11 @@ public:
    /* Wakes up getEvents() if it is blocked on a read. */
    virtual void wake() = 0;

    /* Dump EventHub state to a string. */
    virtual void dump(String8& dump) = 0;

    /* Called by the heatbeat to ensures that the reader has not deadlocked. */
    virtual void monitor() = 0;
};

class EventHub : public EventHubInterface
@@ -259,6 +263,7 @@ public:
    virtual void wake();

    virtual void dump(String8& dump);
    virtual void monitor();

protected:
    virtual ~EventHub();
+8 −0
Original line number Diff line number Diff line
@@ -3919,6 +3919,8 @@ void InputDispatcher::updateDispatchStatisticsLocked(nsecs_t currentTime, const
}

void InputDispatcher::dump(String8& dump) {
    AutoMutex _l(mLock);

    dump.append("Input Dispatcher State:\n");
    dumpDispatchStateLocked(dump);

@@ -3928,6 +3930,12 @@ void InputDispatcher::dump(String8& dump) {
    dump.appendFormat(INDENT2 "KeyRepeatTimeout: %0.1fms\n", mConfig.keyRepeatTimeout * 0.000001f);
}

void InputDispatcher::monitor() {
    // Acquire and release the lock to ensure that the dispatcher has not deadlocked.
    mLock.lock();
    mLock.unlock();
}


// --- InputDispatcher::Queue ---

+4 −0
Original line number Diff line number Diff line
@@ -282,6 +282,9 @@ public:
     * This method may be called on any thread (usually by the input manager). */
    virtual void dump(String8& dump) = 0;

    /* Called by the heatbeat to ensures that the dispatcher has not deadlocked. */
    virtual void monitor() = 0;

    /* Runs a single iteration of the dispatch loop.
     * Nominally processes one queued event, a timeout, or a response from an input consumer.
     *
@@ -370,6 +373,7 @@ public:
    explicit InputDispatcher(const sp<InputDispatcherPolicyInterface>& policy);

    virtual void dump(String8& dump);
    virtual void monitor();

    virtual void dispatchOnce();

+9 −0
Original line number Diff line number Diff line
@@ -731,6 +731,15 @@ void InputReader::dump(String8& dump) {
            mConfig.pointerGestureZoomSpeedRatio);
}

void InputReader::monitor() {
    // Acquire and release the lock to ensure that the reader has not deadlocked.
    mLock.lock();
    mLock.unlock();

    // Check the EventHub
    mEventHub->monitor();
}


// --- InputReader::ContextImpl ---

Loading