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.
This commit is contained in:
Suchi Amalapurapu
2009-10-28 14:32:05 -07:00
parent 763ccae7d7
commit c03d28b9e9

View File

@@ -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) {