Loading core/java/android/app/ActivityManager.java +4 −0 Original line number Diff line number Diff line Loading @@ -548,6 +548,10 @@ public class ActivityManager { public static boolean canReceiveKeys(int stackId) { return stackId != PINNED_STACK_ID; } public static boolean isAlwaysOnTop(int stackId) { return stackId == PINNED_STACK_ID; } } /** Loading services/core/java/com/android/server/am/ActivityStack.java +2 −3 Original line number Diff line number Diff line Loading @@ -538,9 +538,8 @@ final class ActivityStack { if (addIndex > 0) { final ActivityStack topStack = mStacks.get(addIndex - 1); if (topStack.mStackId == PINNED_STACK_ID && topStack != this) { // The pinned stack is always the top most stack (always-on-top). // So, stack is moved just below the pinned stack. if (StackId.isAlwaysOnTop(topStack.mStackId) && topStack != this) { // If the top stack is always on top, we move this stack just below it. addIndex--; } } Loading services/core/java/com/android/server/wm/DisplayContent.java +2 −2 Original line number Diff line number Diff line Loading @@ -237,8 +237,8 @@ class DisplayContent { } void moveStack(TaskStack stack, boolean toTop) { if (stack.mStackId == PINNED_STACK_ID && !toTop) { // Pinned stack is always-on-top silly... if (StackId.isAlwaysOnTop(stack.mStackId) && !toTop) { // This stack is always-on-top silly... Slog.w(TAG, "Ignoring move of always-on-top stack=" + stack + " to bottom"); return; } Loading services/core/java/com/android/server/wm/WindowManagerService.java +27 −8 Original line number Diff line number Diff line Loading @@ -58,6 +58,8 @@ import android.Manifest; import android.animation.ValueAnimator; import android.annotation.NonNull; import android.annotation.Nullable; import android.app.ActivityManager; import android.app.ActivityManager.StackId; import android.app.ActivityManagerNative; import android.app.AppOpsManager; import android.app.IActivityManager; Loading Loading @@ -8652,14 +8654,7 @@ public class WindowManagerService extends IWindowManager.Stub } else if (wtoken != null) { winAnimator.mAnimLayer = w.mLayer + wtoken.mAppAnimator.animLayerAdjustment; if (wtoken.mWillReplaceWindow && wtoken.mReplacingWindow != w && wtoken.mAnimateReplacingWindow) { // We know that we will be animating a relaunching window in the near future, // which will receive a z-order increase. We want the replaced window to // immediately receive the same treatment, e.g. to be above the dock divider. w.mLayer += TYPE_LAYER_OFFSET; winAnimator.mAnimLayer += TYPE_LAYER_OFFSET; } forceHigherLayerIfNeeded(w, winAnimator, wtoken); } else { winAnimator.mAnimLayer = w.mLayer; } Loading Loading @@ -8696,6 +8691,30 @@ public class WindowManagerService extends IWindowManager.Stub } } private void forceHigherLayerIfNeeded(WindowState w, WindowStateAnimator winAnimator, AppWindowToken wtoken) { boolean force = false; if (wtoken.mWillReplaceWindow && wtoken.mReplacingWindow != w && wtoken.mAnimateReplacingWindow) { // We know that we will be animating a relaunching window in the near future, // which will receive a z-order increase. We want the replaced window to // immediately receive the same treatment, e.g. to be above the dock divider. force = true; } if (!force) { final TaskStack stack = w.getStack(); if (stack != null && StackId.isAlwaysOnTop(stack.mStackId)) { // If the window's stack is always on top, we want to make it above other windows // also when these windows are animating. force = true; } } if (force) { w.mLayer += TYPE_LAYER_OFFSET; winAnimator.mAnimLayer += TYPE_LAYER_OFFSET; } } void makeWindowFreezingScreenIfNeededLocked(WindowState w) { // If the screen is currently frozen or off, then keep // it frozen/off until this window draws at its new Loading Loading
core/java/android/app/ActivityManager.java +4 −0 Original line number Diff line number Diff line Loading @@ -548,6 +548,10 @@ public class ActivityManager { public static boolean canReceiveKeys(int stackId) { return stackId != PINNED_STACK_ID; } public static boolean isAlwaysOnTop(int stackId) { return stackId == PINNED_STACK_ID; } } /** Loading
services/core/java/com/android/server/am/ActivityStack.java +2 −3 Original line number Diff line number Diff line Loading @@ -538,9 +538,8 @@ final class ActivityStack { if (addIndex > 0) { final ActivityStack topStack = mStacks.get(addIndex - 1); if (topStack.mStackId == PINNED_STACK_ID && topStack != this) { // The pinned stack is always the top most stack (always-on-top). // So, stack is moved just below the pinned stack. if (StackId.isAlwaysOnTop(topStack.mStackId) && topStack != this) { // If the top stack is always on top, we move this stack just below it. addIndex--; } } Loading
services/core/java/com/android/server/wm/DisplayContent.java +2 −2 Original line number Diff line number Diff line Loading @@ -237,8 +237,8 @@ class DisplayContent { } void moveStack(TaskStack stack, boolean toTop) { if (stack.mStackId == PINNED_STACK_ID && !toTop) { // Pinned stack is always-on-top silly... if (StackId.isAlwaysOnTop(stack.mStackId) && !toTop) { // This stack is always-on-top silly... Slog.w(TAG, "Ignoring move of always-on-top stack=" + stack + " to bottom"); return; } Loading
services/core/java/com/android/server/wm/WindowManagerService.java +27 −8 Original line number Diff line number Diff line Loading @@ -58,6 +58,8 @@ import android.Manifest; import android.animation.ValueAnimator; import android.annotation.NonNull; import android.annotation.Nullable; import android.app.ActivityManager; import android.app.ActivityManager.StackId; import android.app.ActivityManagerNative; import android.app.AppOpsManager; import android.app.IActivityManager; Loading Loading @@ -8652,14 +8654,7 @@ public class WindowManagerService extends IWindowManager.Stub } else if (wtoken != null) { winAnimator.mAnimLayer = w.mLayer + wtoken.mAppAnimator.animLayerAdjustment; if (wtoken.mWillReplaceWindow && wtoken.mReplacingWindow != w && wtoken.mAnimateReplacingWindow) { // We know that we will be animating a relaunching window in the near future, // which will receive a z-order increase. We want the replaced window to // immediately receive the same treatment, e.g. to be above the dock divider. w.mLayer += TYPE_LAYER_OFFSET; winAnimator.mAnimLayer += TYPE_LAYER_OFFSET; } forceHigherLayerIfNeeded(w, winAnimator, wtoken); } else { winAnimator.mAnimLayer = w.mLayer; } Loading Loading @@ -8696,6 +8691,30 @@ public class WindowManagerService extends IWindowManager.Stub } } private void forceHigherLayerIfNeeded(WindowState w, WindowStateAnimator winAnimator, AppWindowToken wtoken) { boolean force = false; if (wtoken.mWillReplaceWindow && wtoken.mReplacingWindow != w && wtoken.mAnimateReplacingWindow) { // We know that we will be animating a relaunching window in the near future, // which will receive a z-order increase. We want the replaced window to // immediately receive the same treatment, e.g. to be above the dock divider. force = true; } if (!force) { final TaskStack stack = w.getStack(); if (stack != null && StackId.isAlwaysOnTop(stack.mStackId)) { // If the window's stack is always on top, we want to make it above other windows // also when these windows are animating. force = true; } } if (force) { w.mLayer += TYPE_LAYER_OFFSET; winAnimator.mAnimLayer += TYPE_LAYER_OFFSET; } } void makeWindowFreezingScreenIfNeededLocked(WindowState w) { // If the screen is currently frozen or off, then keep // it frozen/off until this window draws at its new Loading