Loading services/input/EventHub.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -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 services/input/EventHub.h +5 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -259,6 +263,7 @@ public: virtual void wake(); virtual void dump(String8& dump); virtual void monitor(); protected: virtual ~EventHub(); Loading services/input/InputDispatcher.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -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); Loading @@ -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 --- Loading services/input/InputDispatcher.h +4 −0 Original line number Diff line number Diff line Loading @@ -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. * Loading Loading @@ -370,6 +373,7 @@ public: explicit InputDispatcher(const sp<InputDispatcherPolicyInterface>& policy); virtual void dump(String8& dump); virtual void monitor(); virtual void dispatchOnce(); Loading services/input/InputReader.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -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 Loading
services/input/EventHub.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -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
services/input/EventHub.h +5 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -259,6 +263,7 @@ public: virtual void wake(); virtual void dump(String8& dump); virtual void monitor(); protected: virtual ~EventHub(); Loading
services/input/InputDispatcher.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -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); Loading @@ -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 --- Loading
services/input/InputDispatcher.h +4 −0 Original line number Diff line number Diff line Loading @@ -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. * Loading Loading @@ -370,6 +373,7 @@ public: explicit InputDispatcher(const sp<InputDispatcherPolicyInterface>& policy); virtual void dump(String8& dump); virtual void monitor(); virtual void dispatchOnce(); Loading
services/input/InputReader.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -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