auto import from //branches/cupcake/...@132569
diff --git a/services/java/com/android/server/WindowManagerService.java b/services/java/com/android/server/WindowManagerService.java
index fc22bad..10a2d29 100644
--- a/services/java/com/android/server/WindowManagerService.java
+++ b/services/java/com/android/server/WindowManagerService.java
@@ -2088,6 +2088,11 @@
                     }
                 }
                 int or = wtoken.requestedOrientation;
+                // If this application is fullscreen, then just take whatever
+                // orientation it has and ignores whatever is under it.
+                if (wtoken.appFullscreen) {
+                    return or;
+                }
                 // If this application has requested an explicit orientation,
                 // then use it.
                 if (or == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE ||
@@ -5594,6 +5599,10 @@
             return mFrame;
         }
 
+        public Rect getShownFrameLw() {
+            return mShownFrame;
+        }
+
         public Rect getDisplayFrameLw() {
             return mDisplayFrame;
         }
@@ -6221,10 +6230,16 @@
         }
 
         public boolean fillsScreenLw(int screenWidth, int screenHeight,
-                                   boolean shownFrame) {
+                                   boolean shownFrame, boolean onlyOpaque) {
             if (mSurface == null) {
                 return false;
             }
+            if (mAppToken != null && !mAppToken.appFullscreen) {
+                return false;
+            }
+            if (onlyOpaque && mAttrs.format != PixelFormat.OPAQUE) {
+                return false;
+            }
             final Rect frame = shownFrame ? mShownFrame : mFrame;
             if (frame.left <= 0 && frame.top <= 0
                     && frame.right >= screenWidth