Remove device state when device is reset
When device reset is received in MotionClassifier, don't just set the
classification for that device to 'none'.
Instead, remove all state related to that device.
This prevents growing indefinitely the unordered_maps
that contain device-related state.
Also, log the feature state to the InputClassifier dump.
Bug: 150419367
Test: run several touch integration tests several times, and then do
'dumpsys input'. Ensure that the list doesn't grow as the tests are
executed multiple times.
Change-Id: I2e1ac359458a321f87e4599bb19350623afc9b2b
diff --git a/services/inputflinger/BlockingQueue.h b/services/inputflinger/BlockingQueue.h
index db9f26e..b612ca7 100644
--- a/services/inputflinger/BlockingQueue.h
+++ b/services/inputflinger/BlockingQueue.h
@@ -45,10 +45,7 @@
T pop() {
std::unique_lock lock(mLock);
android::base::ScopedLockAssertion assumeLock(mLock);
- mHasElements.wait(lock, [this]{
- android::base::ScopedLockAssertion assumeLock(mLock);
- return !this->mQueue.empty();
- });
+ mHasElements.wait(lock, [this]() REQUIRES(mLock) { return !this->mQueue.empty(); });
T t = std::move(mQueue.front());
mQueue.erase(mQueue.begin());
return t;