Loading core/java/android/app/ActivityManager.java +8 −0 Original line number Diff line number Diff line Loading @@ -608,6 +608,14 @@ public class ActivityManager { public static boolean resizeStackWithLaunchBounds(int stackId) { return stackId == PINNED_STACK_ID; } /** * Returns true if any visible windows belonging to apps in this stack should be kept on * screen when the app is killed due to something like the low memory killer. */ public static boolean keepVisibleDeadAppWindowOnScreen(int stackId) { return stackId != PINNED_STACK_ID; } } /** Loading services/core/java/com/android/server/wm/WindowManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -2193,7 +2193,7 @@ public class WindowManagerService extends IWindowManager.Stub // need to see about starting one. wasVisible = win.isWinVisibleLw(); if (wasVisible && appToken != null && appToken.appDied) { if (win.shouldKeepVisibleDeadAppWindow()) { if (DEBUG_ADD_REMOVE) Slog.v(TAG_WM, "Not removing " + win + " because app died while it's visible"); Loading services/core/java/com/android/server/wm/WindowState.java +21 −0 Original line number Diff line number Diff line Loading @@ -1615,6 +1615,27 @@ final class WindowState implements WindowManagerPolicy.WindowState { } } /** * Returns true if this window is visible and belongs to a dead app and shouldn't be removed, * because we want to preserve its location on screen to be re-activated later when the user * interacts with it. */ boolean shouldKeepVisibleDeadAppWindow() { if (!isWinVisibleLw() || mAppToken == null || !mAppToken.appDied) { // Not a visible app window or the app isn't dead. return false; } if (mAttrs.type == TYPE_APPLICATION_STARTING) { // We don't keep starting windows since they were added by the window manager before // the app even launched. return false; } final TaskStack stack = getStack(); return stack != null && StackId.keepVisibleDeadAppWindowOnScreen(stack.mStackId); } /** @return true if this window desires key events. */ boolean canReceiveKeys() { return isVisibleOrAdding() Loading Loading
core/java/android/app/ActivityManager.java +8 −0 Original line number Diff line number Diff line Loading @@ -608,6 +608,14 @@ public class ActivityManager { public static boolean resizeStackWithLaunchBounds(int stackId) { return stackId == PINNED_STACK_ID; } /** * Returns true if any visible windows belonging to apps in this stack should be kept on * screen when the app is killed due to something like the low memory killer. */ public static boolean keepVisibleDeadAppWindowOnScreen(int stackId) { return stackId != PINNED_STACK_ID; } } /** Loading
services/core/java/com/android/server/wm/WindowManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -2193,7 +2193,7 @@ public class WindowManagerService extends IWindowManager.Stub // need to see about starting one. wasVisible = win.isWinVisibleLw(); if (wasVisible && appToken != null && appToken.appDied) { if (win.shouldKeepVisibleDeadAppWindow()) { if (DEBUG_ADD_REMOVE) Slog.v(TAG_WM, "Not removing " + win + " because app died while it's visible"); Loading
services/core/java/com/android/server/wm/WindowState.java +21 −0 Original line number Diff line number Diff line Loading @@ -1615,6 +1615,27 @@ final class WindowState implements WindowManagerPolicy.WindowState { } } /** * Returns true if this window is visible and belongs to a dead app and shouldn't be removed, * because we want to preserve its location on screen to be re-activated later when the user * interacts with it. */ boolean shouldKeepVisibleDeadAppWindow() { if (!isWinVisibleLw() || mAppToken == null || !mAppToken.appDied) { // Not a visible app window or the app isn't dead. return false; } if (mAttrs.type == TYPE_APPLICATION_STARTING) { // We don't keep starting windows since they were added by the window manager before // the app even launched. return false; } final TaskStack stack = getStack(); return stack != null && StackId.keepVisibleDeadAppWindowOnScreen(stack.mStackId); } /** @return true if this window desires key events. */ boolean canReceiveKeys() { return isVisibleOrAdding() Loading