From 15a4620b18412d81c1f9102cfc85777dece41a8b Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Mon, 4 Feb 2013 18:49:38 -0800 Subject: [PATCH] Fix graphics corruption in WiFi password dialogs The ActionBarContextView popup window was set to use the "layout in screen" and "inset decor" flags even though it's not a fullscreen window. This was causing the popup window to be created by taking up all the available space. Because the views inside the popup window are wrap_content, this would cause part of the window to not be drawn and since the window is, correctly, marked opaque, we would get random graphics corruption on screen (the user would see the content of the tiles on a tiled renderer such as QCOM's.) This change simply removes the two unnecessary flags from the popup window, forcing it to be created and laid out at the exact size it needs. It will be properly positioned by the window manager underneath the status bar. An interesting side effect is that the window is now smaller than before (since it doesn't extend underneath the status bar) which saves a bit of memory. The popup window also contains an unncessary black background behind the action bar context view. This helps in a way because it allows us to create an opaque window but it increases the required bandwidth to draw that window. Given the benefits for SF it's probably best we keep the window the way it is for now. Change-Id: I4aeeb42a6232ff6b71811e766846d45635eb3365 --- policy/src/com/android/internal/policy/impl/PhoneWindow.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindow.java b/policy/src/com/android/internal/policy/impl/PhoneWindow.java index 41d67bc60845e..88a0ef3dd838c 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindow.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindow.java @@ -2266,8 +2266,6 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { mActionModeView = new ActionBarContextView(mContext); mActionModePopup = new PopupWindow(mContext, null, com.android.internal.R.attr.actionModePopupWindowStyle); - mActionModePopup.setLayoutInScreenEnabled(true); - mActionModePopup.setLayoutInsetDecor(true); mActionModePopup.setWindowLayoutType( WindowManager.LayoutParams.TYPE_APPLICATION); mActionModePopup.setContentView(mActionModeView);