diff options
| author | 2019-11-05 01:10:04 +0000 | |
|---|---|---|
| committer | 2019-11-08 12:33:50 -0800 | |
| commit | f15a8aa344946fb274b1db9f546d5fed746cae70 (patch) | |
| tree | 557f7f642339f8e663dcf5d86de3b4bb0a51b84d /services/inputflinger/InputReaderBase.cpp | |
| parent | cee9c595034cab9b49bf4397d10d63806d99cf21 (diff) | |
Reland "Let InputReader handle its own thread"
This CL was first landed in Ic732436d4f00a831e317be1f16ac106a11652cff
but was reverted due to flaky tests.
The flaky tests were caused by races between the instrumented test
classes and the InputReader class under test, which now runs in a new
thread.
In addition to re-landing the change, this CL fixes the flaky tests by
changing the tests to eliminate the race condition.
- InputReaderTest should send a configuration change request to
InputReader every time a device is enabled or disabled, and the test
should wait for notifyDeviceReset to be called on the input listener to
ensure it was enabled/disabled successfully.
Bug: 130819454
Test: atest inputflinger_tests
Test: Touch input works on crosshatch
Change-Id: I822d3c33384ebdc1bc850a40534e942a27a79ec9
Diffstat (limited to 'services/inputflinger/InputReaderBase.cpp')
| -rw-r--r-- | services/inputflinger/InputReaderBase.cpp | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/services/inputflinger/InputReaderBase.cpp b/services/inputflinger/InputReaderBase.cpp index 0422d8342b..2d6f2c1cc9 100644 --- a/services/inputflinger/InputReaderBase.cpp +++ b/services/inputflinger/InputReaderBase.cpp @@ -33,20 +33,6 @@ using android::base::StringPrintf; namespace android { -// --- InputReaderThread --- - -InputReaderThread::InputReaderThread(const sp<InputReaderInterface>& reader) : - Thread(/*canCallJava*/ true), mReader(reader) { -} - -InputReaderThread::~InputReaderThread() { -} - -bool InputReaderThread::threadLoop() { - mReader->loopOnce(); - return true; -} - // --- InputReaderConfiguration --- std::string InputReaderConfiguration::changesToString(uint32_t changes) { |