summaryrefslogtreecommitdiff
path: root/services/inputflinger/InputManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'services/inputflinger/InputManager.cpp')
-rw-r--r--services/inputflinger/InputManager.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/services/inputflinger/InputManager.cpp b/services/inputflinger/InputManager.cpp
index 1043390f84..c7c61cf1ef 100644
--- a/services/inputflinger/InputManager.cpp
+++ b/services/inputflinger/InputManager.cpp
@@ -20,7 +20,6 @@
#include "InputManager.h"
#include "InputDispatcherFactory.h"
-#include "InputDispatcherThread.h"
#include "InputReaderFactory.h"
#include <binder/IPCThreadState.h>
@@ -38,19 +37,14 @@ InputManager::InputManager(
mDispatcher = createInputDispatcher(dispatcherPolicy);
mClassifier = new InputClassifier(mDispatcher);
mReader = createInputReader(readerPolicy, mClassifier);
- initialize();
}
InputManager::~InputManager() {
stop();
}
-void InputManager::initialize() {
- mDispatcherThread = new InputDispatcherThread(mDispatcher);
-}
-
status_t InputManager::start() {
- status_t result = mDispatcherThread->run("InputDispatcher", PRIORITY_URGENT_DISPLAY);
+ status_t result = mDispatcher->start();
if (result) {
ALOGE("Could not start InputDispatcher thread due to error %d.", result);
return result;
@@ -60,7 +54,7 @@ status_t InputManager::start() {
if (result) {
ALOGE("Could not start InputReader due to error %d.", result);
- mDispatcherThread->requestExit();
+ mDispatcher->stop();
return result;
}
@@ -68,17 +62,21 @@ status_t InputManager::start() {
}
status_t InputManager::stop() {
+ status_t status = OK;
+
status_t result = mReader->stop();
if (result) {
ALOGW("Could not stop InputReader due to error %d.", result);
+ status = result;
}
- result = mDispatcherThread->requestExitAndWait();
+ result = mDispatcher->stop();
if (result) {
ALOGW("Could not stop InputDispatcher thread due to error %d.", result);
+ status = result;
}
- return OK;
+ return status;
}
sp<InputReaderInterface> InputManager::getReader() {