commit | 5e20f27d19c1f1a869d5ac11d5271394990fc59d | [log] [tgz] |
---|---|---|
author | Siarhei Vishniakou <svv@google.com> | Thu Jun 08 17:24:44 2023 -0700 |
committer | Siarhei Vishniakou <svv@google.com> | Fri Jul 07 22:11:09 2023 +0000 |
tree | 50e3e1d0b2a054ad2b220982749864d220519670 | |
parent | 489359cb7ba7e6ea4a026991fcea81dcdf9b1f5d [diff] |
Mark InputDispatcher::dump as const This helps debug InputDispatcher by dumping its state from other const functions. Bug: 281806933 Test: none Change-Id: Ic7f1cef7eeaa753115143756ce60f4167412ef24
diff --git a/services/inputflinger/dispatcher/InputDispatcher.cpp b/services/inputflinger/dispatcher/InputDispatcher.cpp index 65bd05b..df3f7d9 100644 --- a/services/inputflinger/dispatcher/InputDispatcher.cpp +++ b/services/inputflinger/dispatcher/InputDispatcher.cpp
@@ -6590,7 +6590,7 @@ } } -void InputDispatcher::dump(std::string& dump) { +void InputDispatcher::dump(std::string& dump) const { std::scoped_lock _l(mLock); dump += "Input Dispatcher State:\n";
diff --git a/services/inputflinger/dispatcher/InputDispatcher.h b/services/inputflinger/dispatcher/InputDispatcher.h index 37f569e..2b8b37e 100644 --- a/services/inputflinger/dispatcher/InputDispatcher.h +++ b/services/inputflinger/dispatcher/InputDispatcher.h
@@ -87,7 +87,7 @@ std::chrono::nanoseconds staleEventTimeout); ~InputDispatcher() override; - void dump(std::string& dump) override; + void dump(std::string& dump) const override; void monitor() override; bool waitForIdle() const override; status_t start() override;
diff --git a/services/inputflinger/dispatcher/include/InputDispatcherInterface.h b/services/inputflinger/dispatcher/include/InputDispatcherInterface.h index 49597e2..6a07e59 100644 --- a/services/inputflinger/dispatcher/include/InputDispatcherInterface.h +++ b/services/inputflinger/dispatcher/include/InputDispatcherInterface.h
@@ -39,7 +39,7 @@ /* Dumps the state of the input dispatcher. * * This method may be called on any thread (usually by the input manager). */ - virtual void dump(std::string& dump) = 0; + virtual void dump(std::string& dump) const = 0; /* Called by the heatbeat to ensures that the dispatcher has not deadlocked. */ virtual void monitor() = 0;