Use std::function for commands
While refactoring InputDispatcher to use unique_ptr in order to better
understand the lifespands of different object, it became necessary to
refactor commands into something more comprehensible.
Bug: 70668286
Test: presubmit
Change-Id: I273b4f75a32b2c4faf6f907de9f85e7323f2f90d
diff --git a/services/inputflinger/InputDispatcher.h b/services/inputflinger/InputDispatcher.h
index c30a8d6..147437c 100644
--- a/services/inputflinger/InputDispatcher.h
+++ b/services/inputflinger/InputDispatcher.h
@@ -644,7 +644,7 @@
//
// Commands are implicitly 'LockedInterruptible'.
struct CommandEntry;
- typedef void (InputDispatcher::*Command)(CommandEntry* commandEntry);
+ typedef std::function<void(InputDispatcher&, CommandEntry*)> Command;
class Connection;
struct CommandEntry : Link<CommandEntry> {