Loading services/core/java/com/android/server/wm/WindowManagerService.java +2 −1 Original line number Diff line number Diff line Loading @@ -2468,7 +2468,8 @@ public class WindowManagerService extends IWindowManager.Stub // to the client erroneously accepting a configuration that would have otherwise caused // an activity restart. We instead hand back the last reported // {@link MergedConfiguration}. if (shouldRelayout) { if (shouldRelayout && (!win.shouldCheckTokenVisibleRequested() || win.mToken.isVisibleRequested())) { win.getMergedConfiguration(mergedConfiguration); } else { win.getLastReportedMergedConfiguration(mergedConfiguration); Loading services/core/java/com/android/server/wm/WindowState.java +16 −9 Original line number Diff line number Diff line Loading @@ -186,6 +186,7 @@ import static com.android.server.wm.WindowStateProto.WINDOW_CONTAINER; import static com.android.server.wm.WindowStateProto.WINDOW_FRAMES; import android.annotation.CallSuper; import android.annotation.NonNull; import android.annotation.Nullable; import android.app.AppOpsManager; import android.app.admin.DevicePolicyCache; Loading Loading @@ -298,7 +299,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP /** The owner has {@link android.Manifest.permission#INTERNAL_SYSTEM_WINDOW} */ final boolean mOwnerCanAddInternalSystemWindow; final WindowId mWindowId; WindowToken mToken; @NonNull WindowToken mToken; // The same object as mToken if this is an app window and null for non-app windows. ActivityRecord mActivityRecord; Loading Loading @@ -1814,13 +1815,22 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP @Override boolean isVisibleRequested() { if (mToken != null && (mActivityRecord != null || mToken.asWallpaperToken() != null)) { // Currently only ActivityRecord and WallpaperToken support visibleRequested. if (shouldCheckTokenVisibleRequested()) { return isVisible() && mToken.isVisibleRequested(); } return isVisible(); } /** * Returns {@code true} if {@link WindowToken#isVisibleRequested()} should be considered * before dispatching the latest configuration. Currently only {@link * ActivityRecord#isVisibleRequested()} and {@link WallpaperWindowToken#isVisibleRequested()} * implement explicit visible-requested. */ boolean shouldCheckTokenVisibleRequested() { return mActivityRecord != null || mToken.asWallpaperToken() != null; } /** * Ensures that all the policy visibility bits are set. * @return {@code true} if all flags about visiblity are set Loading Loading @@ -1851,7 +1861,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP if (!mHasSurface || isParentWindowHidden() || mAnimatingExit || mDestroying) { return false; } final boolean isWallpaper = mToken != null && mToken.asWallpaperToken() != null; final boolean isWallpaper = mToken.asWallpaperToken() != null; return !isWallpaper || mToken.isVisible(); } Loading Loading @@ -2053,7 +2063,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP // When there is keyguard, wallpaper could be placed over the secure app // window but invisible. We need to check wallpaper visibility explicitly // to determine if it's occluding apps. final boolean isWallpaper = mToken != null && mToken.asWallpaperToken() != null; final boolean isWallpaper = mToken.asWallpaperToken() != null; return ((!isWallpaper && mAttrs.format == PixelFormat.OPAQUE) || (isWallpaper && mToken.isVisible())) && isDrawn() && !isAnimating(TRANSITION | PARENTS); Loading Loading @@ -3340,8 +3350,6 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP void sendAppVisibilityToClients() { super.sendAppVisibilityToClients(); if (mToken == null) return; final boolean clientVisible = mToken.isClientVisible(); // TODO(shell-transitions): This is currently only applicable to app windows, BUT we // want to extend the "starting" concept to other windows. Loading Loading @@ -3734,8 +3742,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP // If this is an activity or wallpaper and is invisible or going invisible, don't report // either since it is going away. This is likely during a transition so we want to preserve // the original state. if ((mActivityRecord != null || mToken.asWallpaperToken() != null) && !mToken.isVisibleRequested()) { if (shouldCheckTokenVisibleRequested() && !mToken.isVisibleRequested()) { return; } Loading Loading
services/core/java/com/android/server/wm/WindowManagerService.java +2 −1 Original line number Diff line number Diff line Loading @@ -2468,7 +2468,8 @@ public class WindowManagerService extends IWindowManager.Stub // to the client erroneously accepting a configuration that would have otherwise caused // an activity restart. We instead hand back the last reported // {@link MergedConfiguration}. if (shouldRelayout) { if (shouldRelayout && (!win.shouldCheckTokenVisibleRequested() || win.mToken.isVisibleRequested())) { win.getMergedConfiguration(mergedConfiguration); } else { win.getLastReportedMergedConfiguration(mergedConfiguration); Loading
services/core/java/com/android/server/wm/WindowState.java +16 −9 Original line number Diff line number Diff line Loading @@ -186,6 +186,7 @@ import static com.android.server.wm.WindowStateProto.WINDOW_CONTAINER; import static com.android.server.wm.WindowStateProto.WINDOW_FRAMES; import android.annotation.CallSuper; import android.annotation.NonNull; import android.annotation.Nullable; import android.app.AppOpsManager; import android.app.admin.DevicePolicyCache; Loading Loading @@ -298,7 +299,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP /** The owner has {@link android.Manifest.permission#INTERNAL_SYSTEM_WINDOW} */ final boolean mOwnerCanAddInternalSystemWindow; final WindowId mWindowId; WindowToken mToken; @NonNull WindowToken mToken; // The same object as mToken if this is an app window and null for non-app windows. ActivityRecord mActivityRecord; Loading Loading @@ -1814,13 +1815,22 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP @Override boolean isVisibleRequested() { if (mToken != null && (mActivityRecord != null || mToken.asWallpaperToken() != null)) { // Currently only ActivityRecord and WallpaperToken support visibleRequested. if (shouldCheckTokenVisibleRequested()) { return isVisible() && mToken.isVisibleRequested(); } return isVisible(); } /** * Returns {@code true} if {@link WindowToken#isVisibleRequested()} should be considered * before dispatching the latest configuration. Currently only {@link * ActivityRecord#isVisibleRequested()} and {@link WallpaperWindowToken#isVisibleRequested()} * implement explicit visible-requested. */ boolean shouldCheckTokenVisibleRequested() { return mActivityRecord != null || mToken.asWallpaperToken() != null; } /** * Ensures that all the policy visibility bits are set. * @return {@code true} if all flags about visiblity are set Loading Loading @@ -1851,7 +1861,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP if (!mHasSurface || isParentWindowHidden() || mAnimatingExit || mDestroying) { return false; } final boolean isWallpaper = mToken != null && mToken.asWallpaperToken() != null; final boolean isWallpaper = mToken.asWallpaperToken() != null; return !isWallpaper || mToken.isVisible(); } Loading Loading @@ -2053,7 +2063,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP // When there is keyguard, wallpaper could be placed over the secure app // window but invisible. We need to check wallpaper visibility explicitly // to determine if it's occluding apps. final boolean isWallpaper = mToken != null && mToken.asWallpaperToken() != null; final boolean isWallpaper = mToken.asWallpaperToken() != null; return ((!isWallpaper && mAttrs.format == PixelFormat.OPAQUE) || (isWallpaper && mToken.isVisible())) && isDrawn() && !isAnimating(TRANSITION | PARENTS); Loading Loading @@ -3340,8 +3350,6 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP void sendAppVisibilityToClients() { super.sendAppVisibilityToClients(); if (mToken == null) return; final boolean clientVisible = mToken.isClientVisible(); // TODO(shell-transitions): This is currently only applicable to app windows, BUT we // want to extend the "starting" concept to other windows. Loading Loading @@ -3734,8 +3742,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP // If this is an activity or wallpaper and is invisible or going invisible, don't report // either since it is going away. This is likely during a transition so we want to preserve // the original state. if ((mActivityRecord != null || mToken.asWallpaperToken() != null) && !mToken.isVisibleRequested()) { if (shouldCheckTokenVisibleRequested() && !mToken.isVisibleRequested()) { return; } Loading