summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorWale Ogunwale <ogunwale@google.com>2015-04-23 16:22:02 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-04-23 16:22:03 +0000
commit2ff8ca659ed8f78768a4872e569b203517d2bb0f (patch)
tree22f56e689cc677286f6d08b6c4f178289ae76929 /services
parent0edd74db6e17fe4e2582c2cb7a5308d27d594e30 (diff)
parenta48a8db90ffd6f2439fd5ee2db59d9807ed9ba00 (diff)
downloadframeworks_base-2ff8ca659ed8f78768a4872e569b203517d2bb0f.zip
frameworks_base-2ff8ca659ed8f78768a4872e569b203517d2bb0f.tar.gz
frameworks_base-2ff8ca659ed8f78768a4872e569b203517d2bb0f.tar.bz2
Merge "Fixed bug with black background when exiting a wallpaper window."
Diffstat (limited to 'services')
-rw-r--r--services/core/java/com/android/server/wm/WindowManagerService.java32
1 files changed, 27 insertions, 5 deletions
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index 584892b..38fc959 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -624,6 +624,12 @@ public class WindowManagerService extends IWindowManager.Stub
static final int WALLPAPER_DRAW_TIMEOUT = 2;
int mWallpaperDrawState = WALLPAPER_DRAW_NORMAL;
+ // Set to the wallpaper window we would like to hide once the transition animations are done.
+ // This is useful in cases where we don't want the wallpaper to be hidden when the close app
+ // is a wallpaper target and is done animating out, but the opening app isn't a wallpaper
+ // target and isn't done animating in.
+ WindowState mDeferredHideWallpaper = null;
+
AppWindowToken mFocusedApp = null;
PowerManager mPowerManager;
@@ -1781,17 +1787,24 @@ public class WindowManagerService extends IWindowManager.Stub
}
void hideWallpapersLocked(final WindowState winGoingAway) {
- if (mWallpaperTarget != null &&
- (mWallpaperTarget != winGoingAway || mLowerWallpaperTarget != null)) {
+ if (mWallpaperTarget != null
+ && (mWallpaperTarget != winGoingAway || mLowerWallpaperTarget != null)) {
+ return;
+ }
+ if (mAppTransition.isRunning()) {
+ // Defer hiding the wallpaper when app transition is running until the animations
+ // are done.
+ mDeferredHideWallpaper = winGoingAway;
return;
}
+ final boolean wasDeferred = (mDeferredHideWallpaper == winGoingAway);
for (int i = mWallpaperTokens.size() - 1; i >= 0; i--) {
final WindowToken token = mWallpaperTokens.get(i);
for (int j = token.windows.size() - 1; j >= 0; j--) {
final WindowState wallpaper = token.windows.get(j);
final WindowStateAnimator winAnimator = wallpaper.mWinAnimator;
- if (!winAnimator.mLastHidden) {
+ if (!winAnimator.mLastHidden || wasDeferred) {
winAnimator.hide();
dispatchWallpaperVisibility(wallpaper, false);
final DisplayContent displayContent = wallpaper.getDisplayContent();
@@ -2270,12 +2283,15 @@ public class WindowManagerService extends IWindowManager.Stub
}
/**
- * Check wallpaper for visiblity change and notify window if so.
+ * Check wallpaper for visibility change and notify window if so.
* @param wallpaper The wallpaper to test and notify.
* @param visible Current visibility.
*/
void dispatchWallpaperVisibility(final WindowState wallpaper, final boolean visible) {
- if (wallpaper.mWallpaperVisible != visible) {
+ // Only send notification if the visibility actually changed and we are not trying to hide
+ // the wallpaper when we are deferring hiding of the wallpaper.
+ if (wallpaper.mWallpaperVisible != visible
+ && (mDeferredHideWallpaper == null || visible)) {
wallpaper.mWallpaperVisible = visible;
try {
if (DEBUG_VISIBILITY || DEBUG_WALLPAPER_LIGHT) Slog.v(TAG,
@@ -9527,6 +9543,12 @@ public class WindowManagerService extends IWindowManager.Stub
int changes = 0;
mAppTransition.setIdle();
+
+ if (mDeferredHideWallpaper != null) {
+ hideWallpapersLocked(mDeferredHideWallpaper);
+ mDeferredHideWallpaper = null;
+ }
+
// Restore window app tokens to the ActivityManager views
ArrayList<TaskStack> stacks = getDefaultDisplayContentLocked().getStacks();
for (int stackNdx = stacks.size() - 1; stackNdx >= 0; --stackNdx) {