From c03d28b9e96f667d29ec6e480bed171bbd07169d Mon Sep 17 00:00:00 2001 From: Suchi Amalapurapu Date: Wed, 28 Oct 2009 14:32:05 -0700 Subject: Check that the window which wants to force hide is visible before setting the flag forceHiding to true. If we do layout the surfaces again this flag gets set no matter what since the keyguard window is always present in the list of tokens and this hides the window which would have become visible since the keyguard just got dismissed. This causes unnecessary focus changes due to changes in visibility of current window. This will resolve issues related to current focus and time outs when dispatching key events. --- services/java/com/android/server/WindowManagerService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'services') diff --git a/services/java/com/android/server/WindowManagerService.java b/services/java/com/android/server/WindowManagerService.java index 6418901..94667eb 100644 --- a/services/java/com/android/server/WindowManagerService.java +++ b/services/java/com/android/server/WindowManagerService.java @@ -9653,7 +9653,8 @@ public class WindowManagerService extends IWindowManager.Stub WindowState w = (WindowState)mWindows.get(i); if (w.mSurface != null) { final WindowManager.LayoutParams attrs = w.mAttrs; - if (mPolicy.doesForceHide(w, attrs)) { + if (mPolicy.doesForceHide(w, attrs) && w.isVisibleLw()) { + if (DEBUG_FOCUS) Log.i(TAG, "win=" + w + " force hides other windows"); forceHiding = true; } else if (mPolicy.canBeForceHidden(w, attrs)) { if (!w.mAnimating) { -- cgit v1.1