Revert "Reland "Let InputReader handle its own thread""
Reason for revert: flaky tests b/144546498
Bug: 144546498
Change-Id: Id5a4c8dc8e634b23b560dde6843b5a5860305e5f
diff --git a/services/inputflinger/InputManager.cpp b/services/inputflinger/InputManager.cpp
index 1043390..e7640dd 100644
--- a/services/inputflinger/InputManager.cpp
+++ b/services/inputflinger/InputManager.cpp
@@ -46,6 +46,7 @@
}
void InputManager::initialize() {
+ mReaderThread = new InputReaderThread(mReader);
mDispatcherThread = new InputDispatcherThread(mDispatcher);
}
@@ -56,9 +57,9 @@
return result;
}
- result = mReader->start();
+ result = mReaderThread->run("InputReader", PRIORITY_URGENT_DISPLAY);
if (result) {
- ALOGE("Could not start InputReader due to error %d.", result);
+ ALOGE("Could not start InputReader thread due to error %d.", result);
mDispatcherThread->requestExit();
return result;
@@ -68,9 +69,9 @@
}
status_t InputManager::stop() {
- status_t result = mReader->stop();
+ status_t result = mReaderThread->requestExitAndWait();
if (result) {
- ALOGW("Could not stop InputReader due to error %d.", result);
+ ALOGW("Could not stop InputReader thread due to error %d.", result);
}
result = mDispatcherThread->requestExitAndWait();