summaryrefslogtreecommitdiffstats
path: root/libs/ui
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2010-10-27 22:18:43 -0700
committerJeff Brown <jeffbrown@google.com>2010-10-27 22:18:43 -0700
commit88e7b31ba1447e98f65e4d2939dbf66268c75e35 (patch)
tree3a0a704cb26ccd2cc397506a54e637637b718107 /libs/ui
parenta80d256d04146cfc0a56a0e08666c53728df596a (diff)
parentdf3cccf3dc6b59ec4a45d80fb483022360e13830 (diff)
downloadframeworks_base-88e7b31ba1447e98f65e4d2939dbf66268c75e35.zip
frameworks_base-88e7b31ba1447e98f65e4d2939dbf66268c75e35.tar.gz
frameworks_base-88e7b31ba1447e98f65e4d2939dbf66268c75e35.tar.bz2
resolved conflicts for merge of df3cccf3 to master
Change-Id: I425496a9fc4e9cbc50ad6938e9dccb14827d9558
Diffstat (limited to 'libs/ui')
-rw-r--r--libs/ui/InputDispatcher.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/libs/ui/InputDispatcher.cpp b/libs/ui/InputDispatcher.cpp
index 4c86ebe..b936c4d 100644
--- a/libs/ui/InputDispatcher.cpp
+++ b/libs/ui/InputDispatcher.cpp
@@ -1305,6 +1305,9 @@ Failed:
}
Unresponsive:
+ // Reset temporary touch state to ensure we release unnecessary references to input channels.
+ mTempTouchState.reset();
+
nsecs_t timeSpentWaitingForApplication = getTimeSpentWaitingForApplicationLocked(currentTime);
updateDispatchStatisticsLocked(currentTime, entry,
injectionResult, timeSpentWaitingForApplication);
@@ -2589,10 +2592,14 @@ void InputDispatcher::setInputDispatchMode(bool enabled, bool frozen) {
AutoMutex _l(mLock);
if (mDispatchEnabled != enabled || mDispatchFrozen != frozen) {
- if (mDispatchFrozen && ! frozen) {
+ if (mDispatchFrozen && !frozen) {
resetANRTimeoutsLocked();
}
+ if (mDispatchEnabled && !enabled) {
+ resetAndDropEverythingLocked("dispatcher is being disabled");
+ }
+
mDispatchEnabled = enabled;
mDispatchFrozen = frozen;
changed = true;
@@ -2687,6 +2694,21 @@ bool InputDispatcher::transferTouchFocus(const sp<InputChannel>& fromChannel,
return true;
}
+void InputDispatcher::resetAndDropEverythingLocked(const char* reason) {
+#if DEBUG_FOCUS
+ LOGD("Resetting and dropping all events (%s).", reason);
+#endif
+
+ synthesizeCancelationEventsForAllConnectionsLocked(InputState::CANCEL_ALL_EVENTS, reason);
+
+ resetKeyRepeatLocked();
+ releasePendingEventLocked();
+ drainInboundQueueLocked();
+ resetTargetsLocked();
+
+ mTouchState.reset();
+}
+
void InputDispatcher::logDispatchStateLocked() {
String8 dump;
dumpDispatchStateLocked(dump);