summaryrefslogtreecommitdiff
path: root/services/inputflinger/InputManager.h
diff options
context:
space:
mode:
Diffstat (limited to 'services/inputflinger/InputManager.h')
-rw-r--r--services/inputflinger/InputManager.h58
1 files changed, 34 insertions, 24 deletions
diff --git a/services/inputflinger/InputManager.h b/services/inputflinger/InputManager.h
index 0158441fd1..49bea132c8 100644
--- a/services/inputflinger/InputManager.h
+++ b/services/inputflinger/InputManager.h
@@ -26,15 +26,19 @@
#include <InputDispatcherInterface.h>
#include <InputDispatcherPolicyInterface.h>
-#include <input/ISetInputWindowsListener.h>
+#include <android/os/ISetInputWindowsListener.h>
#include <input/Input.h>
#include <input/InputTransport.h>
-#include <input/IInputFlinger.h>
+#include <android/os/BnInputFlinger.h>
+#include <android/os/IInputFlinger.h>
#include <utils/Errors.h>
-#include <utils/Vector.h>
-#include <utils/Timers.h>
#include <utils/RefBase.h>
+#include <utils/Timers.h>
+#include <utils/Vector.h>
+
+using android::os::BnInputFlinger;
+using android::os::ISetInputWindowsListener;
namespace android {
class InputChannel;
@@ -43,17 +47,19 @@ class InputDispatcherThread;
/*
* The input manager is the core of the system event processing.
*
- * The input manager has two components.
+ * The input manager has three components.
*
* 1. The InputReader class starts a thread that reads and preprocesses raw input events, applies
- * policy, and posts messages to a queue managed by the InputDispatcherThread.
- * 2. The InputDispatcher class starts a thread that waits for new events on the
- * queue and asynchronously dispatches them to applications.
+ * policy, and posts messages to a queue managed by the InputClassifier.
+ * 2. The InputClassifier class starts a thread to communicate with the device-specific
+ * classifiers. It then waits on the queue of events from InputReader, applies a classification
+ * to them, and queues them for the InputDispatcher.
+ * 3. The InputDispatcher class starts a thread that waits for new events on the
+ * previous queue and asynchronously dispatches them to applications.
*
- * By design, the InputReader class and InputDispatcher class do not share any
- * internal state. Moreover, all communication is done one way from the InputReader
- * into the InputDispatcherThread and never the reverse. Both classes may interact with the
- * InputDispatchPolicy, however.
+ * By design, none of these classes share any internal state. Moreover, all communication is
+ * done one way from the InputReader to the InputDispatcher and never the reverse. All
+ * classes may interact with the InputDispatchPolicy, however.
*
* The InputManager class never makes any calls into Java itself. Instead, the
* InputDispatchPolicy is responsible for performing all external interactions with the
@@ -74,33 +80,37 @@ public:
/* Gets the input reader. */
virtual sp<InputReaderInterface> getReader() = 0;
+ /* Gets the input classifier */
+ virtual sp<InputClassifierInterface> getClassifier() = 0;
+
/* Gets the input dispatcher. */
virtual sp<InputDispatcherInterface> getDispatcher() = 0;
};
class InputManager : public InputManagerInterface, public BnInputFlinger {
protected:
- virtual ~InputManager();
+ ~InputManager() override;
public:
InputManager(
const sp<InputReaderPolicyInterface>& readerPolicy,
const sp<InputDispatcherPolicyInterface>& dispatcherPolicy);
- virtual status_t start();
- virtual status_t stop();
-
- virtual sp<InputReaderInterface> getReader();
- virtual sp<InputClassifierInterface> getClassifier();
- virtual sp<InputDispatcherInterface> getDispatcher();
+ status_t start() override;
+ status_t stop() override;
- virtual void setInputWindows(const std::vector<InputWindowInfo>& handles,
- const sp<ISetInputWindowsListener>& setInputWindowsListener);
+ sp<InputReaderInterface> getReader() override;
+ sp<InputClassifierInterface> getClassifier() override;
+ sp<InputDispatcherInterface> getDispatcher() override;
- virtual void registerInputChannel(const sp<InputChannel>& channel);
- virtual void unregisterInputChannel(const sp<InputChannel>& channel);
+ status_t dump(int fd, const Vector<String16>& args) override;
+ binder::Status setInputWindows(
+ const std::vector<InputWindowInfo>& handles,
+ const sp<ISetInputWindowsListener>& setInputWindowsListener) override;
- void setMotionClassifierEnabled(bool enabled);
+ binder::Status createInputChannel(const std::string& name, InputChannel* outChannel) override;
+ binder::Status removeInputChannel(const sp<IBinder>& connectionToken) override;
+ binder::Status setFocusedWindow(const FocusRequest&) override;
private:
sp<InputReaderInterface> mReader;