summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcus Oakland <marcus.oakland@sonyericsson.com>2010-09-03 11:24:28 +0200
committerPatrick Jacques <kernelzilla@kinetic-computing.com>2010-09-04 22:51:17 -0700
commit4be257e00f144b2cd6c920cb1d1f3aff0e8f3185 (patch)
tree7039dcba4284559af0c4b305021403914aef8947
parent096ab5eb459e0b65010246ccd25bcdc8e1e36e89 (diff)
downloadframeworks_base-4be257e00f144b2cd6c920cb1d1f3aff0e8f3185.zip
frameworks_base-4be257e00f144b2cd6c920cb1d1f3aff0e8f3185.tar.gz
frameworks_base-4be257e00f144b2cd6c920cb1d1f3aff0e8f3185.tar.bz2
Prevent key dispatch ANR on rapid change of orientation.
Rapidly opening and closing the keyboard slider while playing a track on the music player and touching the screen to start the key dispatch timer, an ANR could occur because the 500ms timeout occured with mWasFrozen true, causing waitedFor to be set to zero and mWasFrozen to be set to false. If the 500ms timeout then occured again before the mWasFrozen frozen flag was set to true again, the value of waitedFor was recalculated and if this indicated that the keyDispatchingTimeout had elapsed then a "key dispatching" ANR was raised. The intention was to restart the timeout checks if we were frozen during configuration change, and this is properly achieved by setting startTime to the current time so that the subsequent recalculation of waitedFor is from this new point. Change-Id: I6626c4bfff82ebe3d3401fed15263d09fe2b69ad
-rw-r--r--services/java/com/android/server/WindowManagerService.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/services/java/com/android/server/WindowManagerService.java b/services/java/com/android/server/WindowManagerService.java
index d8c8cae..7d0898b 100644
--- a/services/java/com/android/server/WindowManagerService.java
+++ b/services/java/com/android/server/WindowManagerService.java
@@ -5800,6 +5800,8 @@ public class WindowManagerService extends IWindowManager.Stub
// timeout checks from now; otherwise look at whether we timed
// out before awakening.
if (mWasFrozen) {
+ // Set startTime to the current time in addition to setting waitedFor to zero.
+ startTime = SystemClock.uptimeMillis();
waitedFor = 0;
mWasFrozen = false;
} else {