diff options
Diffstat (limited to 'services/core/java/com/android/server/wm')
5 files changed, 39 insertions, 9 deletions
diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java index f914369..5d6df26 100644 --- a/services/core/java/com/android/server/wm/DisplayContent.java +++ b/services/core/java/com/android/server/wm/DisplayContent.java @@ -238,6 +238,7 @@ class DisplayContent { final TaskStack stack = win.getStack(); if (win.isVisibleLw() && stack != null && stack != focusedStack) { mTmpRect.set(win.mVisibleFrame); + // If no intersection, we need mTmpRect to be unmodified. mTmpRect.intersect(win.mVisibleInsets); mTouchExcludeRegion.op(mTmpRect, Region.Op.DIFFERENCE); } diff --git a/services/core/java/com/android/server/wm/TaskStack.java b/services/core/java/com/android/server/wm/TaskStack.java index 7cdf8b2..4545032 100644 --- a/services/core/java/com/android/server/wm/TaskStack.java +++ b/services/core/java/com/android/server/wm/TaskStack.java @@ -144,7 +144,11 @@ public class TaskStack { bounds = mTmpRect; mFullscreen = true; } else { - bounds.intersect(mTmpRect); // ensure bounds are entirely within the display rect + // ensure bounds are entirely within the display rect + if (!bounds.intersect(mTmpRect)) { + // Can't set bounds outside the containing display.. Sorry! + return false; + } mFullscreen = mTmpRect.equals(bounds); } } diff --git a/services/core/java/com/android/server/wm/WindowAnimator.java b/services/core/java/com/android/server/wm/WindowAnimator.java index 9169351..3305e1e 100644 --- a/services/core/java/com/android/server/wm/WindowAnimator.java +++ b/services/core/java/com/android/server/wm/WindowAnimator.java @@ -191,7 +191,8 @@ public class WindowAnimator { private boolean shouldForceHide(WindowState win) { final WindowState imeTarget = mService.mInputMethodTarget; final boolean showImeOverKeyguard = imeTarget != null && imeTarget.isVisibleNow() && - (imeTarget.getAttrs().flags & FLAG_SHOW_WHEN_LOCKED) != 0; + ((imeTarget.getAttrs().flags & FLAG_SHOW_WHEN_LOCKED) != 0 + || !mPolicy.canBeForceHidden(imeTarget, imeTarget.mAttrs)); final WindowState winShowWhenLocked = (WindowState) mPolicy.getWinShowWhenLockedLw(); final AppWindowToken appShowWhenLocked = winShowWhenLocked == null ? @@ -203,7 +204,11 @@ public class WindowAnimator { || (win.mAttrs.flags & FLAG_SHOW_WHEN_LOCKED) != 0 && win.isAnimatingLw() // Show error dialogs over apps that dismiss keyguard. || (win.mAttrs.privateFlags & PRIVATE_FLAG_SYSTEM_ERROR) != 0))); - return (mForceHiding == KEYGUARD_SHOWN) && hideWhenLocked; + + // Only hide windows if the keyguard is active and not animating away. + boolean keyguardOn = mPolicy.isKeyguardShowingOrOccluded() + && mForceHiding != KEYGUARD_ANIMATING_OUT; + return keyguardOn && hideWhenLocked; } private void updateWindowsLocked(final int displayId) { @@ -228,6 +233,7 @@ public class WindowAnimator { winAnimator.mAnimation.setDuration(KEYGUARD_ANIM_TIMEOUT_MS); winAnimator.mAnimationIsEntrance = false; winAnimator.mAnimationStartTime = -1; + winAnimator.mKeyguardGoingAwayAnimation = true; } } else { if (DEBUG_KEYGUARD) Slog.d(TAG, @@ -310,7 +316,7 @@ public class WindowAnimator { mKeyguardGoingAway = false; } if (win.isReadyForDisplay()) { - if (nowAnimating) { + if (nowAnimating && win.mWinAnimator.mKeyguardGoingAwayAnimation) { mForceHiding = KEYGUARD_ANIMATING_OUT; } else { mForceHiding = win.isDrawnLw() ? KEYGUARD_SHOWN : KEYGUARD_NOT_SHOWN; diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index bd2e002..6b5c224 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -208,7 +208,7 @@ public class WindowManagerService extends IWindowManager.Stub static final boolean DEBUG_APP_ORIENTATION = false; static final boolean DEBUG_CONFIGURATION = false; static final boolean DEBUG_APP_TRANSITIONS = false; - static final boolean DEBUG_STARTING_WINDOW = false; + static final boolean DEBUG_STARTING_WINDOW = true; static final boolean DEBUG_WALLPAPER = false; static final boolean DEBUG_WALLPAPER_LIGHT = false || DEBUG_WALLPAPER; static final boolean DEBUG_DRAG = false; @@ -2272,6 +2272,16 @@ public class WindowManagerService extends IWindowManager.Stub } else if (changingTarget.mWallpaperDisplayOffsetY != Integer.MIN_VALUE) { mLastWallpaperDisplayOffsetY = changingTarget.mWallpaperDisplayOffsetY; } + if (target.mWallpaperXStep >= 0) { + mLastWallpaperXStep = target.mWallpaperXStep; + } else if (changingTarget.mWallpaperXStep >= 0) { + mLastWallpaperXStep = changingTarget.mWallpaperXStep; + } + if (target.mWallpaperYStep >= 0) { + mLastWallpaperYStep = target.mWallpaperYStep; + } else if (changingTarget.mWallpaperYStep >= 0) { + mLastWallpaperYStep = changingTarget.mWallpaperYStep; + } } for (int curTokenNdx = mWallpaperTokens.size() - 1; curTokenNdx >= 0; curTokenNdx--) { @@ -6224,7 +6234,10 @@ public class WindowManagerService extends IWindowManager.Stub int bottom = wf.bottom - cr.bottom; frame.union(left, top, right, bottom); ws.getStackBounds(stackBounds); - frame.intersect(stackBounds); + if (!frame.intersect(stackBounds)) { + // Set frame empty if there's no intersection. + frame.setEmpty(); + } } if (ws.mAppToken != null && ws.mAppToken.token == appToken && @@ -6271,12 +6284,16 @@ public class WindowManagerService extends IWindowManager.Stub if (!includeFullDisplay) { // Constrain frame to the screen size. - frame.intersect(0, 0, dw, dh); + if (!frame.intersect(0, 0, dw, dh)) { + frame.setEmpty(); + } } else { // Caller just wants entire display. frame.set(0, 0, dw, dh); } - + if (frame.isEmpty()) { + return null; + } if (width < 0) { width = frame.width(); diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java index b8b243c..eda7f79 100644 --- a/services/core/java/com/android/server/wm/WindowState.java +++ b/services/core/java/com/android/server/wm/WindowState.java @@ -547,7 +547,9 @@ final class WindowState implements WindowManagerPolicy.WindowState { } // Make sure the containing frame is within the content frame so we don't layout // resized window under screen decorations. - mContainingFrame.intersect(cf); + if (!mContainingFrame.intersect(cf)) { + mContainingFrame.set(cf); + } mDisplayFrame.set(mContainingFrame); } else { mContainingFrame.set(pf); |