From ecde72fe411811ca02a2565bf73b86e6e8ddc76b Mon Sep 17 00:00:00 2001 From: Derek Sollenberger Date: Mon, 1 Mar 2010 13:44:42 -0500 Subject: [PATCH] Ensure the IME is rendered above the surface when we z-order the surface to be on top. --- core/java/android/view/SurfaceView.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/java/android/view/SurfaceView.java b/core/java/android/view/SurfaceView.java index ca5e1de1e5b9b..a79a91c8cff2b 100644 --- a/core/java/android/view/SurfaceView.java +++ b/core/java/android/view/SurfaceView.java @@ -319,8 +319,14 @@ public class SurfaceView extends View { *

Calling this overrides any previous call to {@link #setZOrderMediaOverlay}. */ public void setZOrderOnTop(boolean onTop) { - mWindowType = onTop ? WindowManager.LayoutParams.TYPE_APPLICATION_PANEL - : WindowManager.LayoutParams.TYPE_APPLICATION_MEDIA; + if (onTop) { + mWindowType = WindowManager.LayoutParams.TYPE_APPLICATION_PANEL; + // ensures the surface is placed below the IME + mLayout.flags |= WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM; + } else { + mWindowType = WindowManager.LayoutParams.TYPE_APPLICATION_MEDIA; + mLayout.flags &= ~WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM; + } } /**