summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorChristopher Tate <ctate@android.com>2009-10-27 20:23:28 -0700
committerChristopher Tate <ctate@android.com>2009-10-28 11:52:58 -0700
commit405d0898630a1c35e8e5ece072d8703fd68aca3b (patch)
tree1fa2463eb820f24babaa7b9d73d1ea4ce8195709 /services
parent8321bdf4dd85b81224d84b0d7a2f53218bf1a250 (diff)
downloadframeworks_base-405d0898630a1c35e8e5ece072d8703fd68aca3b.zip
frameworks_base-405d0898630a1c35e8e5ece072d8703fd68aca3b.tar.gz
frameworks_base-405d0898630a1c35e8e5ece072d8703fd68aca3b.tar.bz2
DO NOT MERGE: Fix loss of focus after wakeup into incall screen
Because of the asynchronous behavior of keyguard, and incall explicitly disabling keyguard, sometimes the window manager would wind up in a state in which the "correct" app and activity window were shown, but focus was recalculated "too soon," at a time when keyguard was just about gone but not quite, and incall was not yet fully shown. In this case there was no currently valid event target, but the final show of the incall window would not prompt a focus recalculation, so that "no current focus" state would incorrectly persist, resulting in spurious ANRs until some other phone activity forced a focus update. We now detect the problematic case when windows are shown, and make sure to recalculate focus explicitly thereafter. This change does *not* fix the underlying race conditions that have been resulting in mismatched state within the window manager, but it does force a validation pass that puts things in order so that normal operation can continue. Change-Id: I8e7f5f0795f0042a0da074aeed385e3fbc210360
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/WindowManagerService.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/services/java/com/android/server/WindowManagerService.java b/services/java/com/android/server/WindowManagerService.java
index cd6a371..6418901 100644
--- a/services/java/com/android/server/WindowManagerService.java
+++ b/services/java/com/android/server/WindowManagerService.java
@@ -9303,6 +9303,15 @@ public class WindowManagerService extends IWindowManager.Stub
& WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER) != 0) {
wallpaperMayChange = true;
}
+ if (changed && !forceHiding
+ && (mCurrentFocus == null)
+ && (mFocusedApp != null)) {
+ // It's possible that the last focus recalculation left no
+ // current focused window even though the app has come to the
+ // foreground already. In this case, we make sure to recalculate
+ // focus when we show a window.
+ focusMayChange = true;
+ }
}
mPolicy.animatingWindowLw(w, attrs);