Loading services/core/java/com/android/server/wm/WindowLayersController.java +37 −24 Original line number Original line Diff line number Diff line Loading @@ -16,12 +16,14 @@ package com.android.server.wm; package com.android.server.wm; import android.app.ActivityManager.StackId; import android.util.Slog; import android.util.Slog; import android.view.Display; import android.view.Display; import java.io.PrintWriter; import java.io.PrintWriter; import java.util.ArrayDeque; import static android.app.ActivityManager.StackId.DOCKED_STACK_ID; import static android.app.ActivityManager.StackId.PINNED_STACK_ID; import static android.view.WindowManager.LayoutParams.TYPE_DOCK_DIVIDER; import static android.view.WindowManager.LayoutParams.TYPE_DOCK_DIVIDER; import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_LAYERS; import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_LAYERS; import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM; import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM; Loading Loading @@ -55,10 +57,10 @@ public class WindowLayersController { } } private int mHighestApplicationLayer = 0; private int mHighestApplicationLayer = 0; private WindowState mPinnedWindow = null; private ArrayDeque<WindowState> mPinnedWindows = new ArrayDeque<>(); private WindowState mDockedWindow = null; private ArrayDeque<WindowState> mDockedWindows = new ArrayDeque<>(); private WindowState mDockDivider = null; private WindowState mDockDivider = null; private WindowState mReplacingWindow = null; private ArrayDeque<WindowState> mReplacingWindows = new ArrayDeque<>(); final void assignLayersLocked(WindowList windows) { final void assignLayersLocked(WindowList windows) { if (DEBUG_LAYERS) Slog.v(TAG_WM, "Assigning layers based on windows=" + windows, if (DEBUG_LAYERS) Slog.v(TAG_WM, "Assigning layers based on windows=" + windows, Loading Loading @@ -169,43 +171,54 @@ public class WindowLayersController { private void clear() { private void clear() { mHighestApplicationLayer = 0; mHighestApplicationLayer = 0; mPinnedWindow = null; mPinnedWindows.clear(); mDockedWindow = null; mDockedWindows.clear(); mReplacingWindows.clear(); mDockDivider = null; mDockDivider = null; } } private void collectSpecialWindows(WindowState w) { private void collectSpecialWindows(WindowState w) { if (w.mAttrs.type == TYPE_DOCK_DIVIDER) { if (w.mAttrs.type == TYPE_DOCK_DIVIDER) { mDockDivider = w; mDockDivider = w; } else { return; } if (w.mWillReplaceWindow) { mReplacingWindows.add(w); } final TaskStack stack = w.getStack(); final TaskStack stack = w.getStack(); if (stack == null) { if (stack == null) { return; return; } } if (stack.mStackId == StackId.PINNED_STACK_ID) { if (stack.mStackId == PINNED_STACK_ID) { mPinnedWindow = w; mPinnedWindows.add(w); } else if (stack.mStackId == StackId.DOCKED_STACK_ID) { } else if (stack.mStackId == DOCKED_STACK_ID) { mDockedWindow = w; mDockedWindows.add(w); } } } } } private void adjustSpecialWindows() { private void adjustSpecialWindows() { int layer = mHighestApplicationLayer + 1; int layer = mHighestApplicationLayer + 1; // For pinned and docked stack window, we want to make them above other windows // For pinned and docked stack window, we want to make them above other windows also when // also when these windows are animating. // these windows are animating. layer = assignAndIncreaseLayerIfNeeded(mDockedWindow, layer); while (!mDockedWindows.isEmpty()) { layer = assignAndIncreaseLayerIfNeeded(mDockedWindows.remove(), layer); } // Leave some space here so the dim layer while dismissing docked/fullscreen stack has space // Leave some space here so the dim layer while dismissing docked/fullscreen stack has space // below the divider but above the app windows. It needs to be below the divider in because // below the divider but above the app windows. It needs to be below the divider in because // the divider sometimes overlaps the app windows. // the divider sometimes overlaps the app windows. layer++; layer++; layer = assignAndIncreaseLayerIfNeeded(mDockDivider, layer); layer = assignAndIncreaseLayerIfNeeded(mDockDivider, layer); // We know that we will be animating a relaunching window in the near future, // We know that we will be animating a relaunching window in the near future, which will // which will receive a z-order increase. We want the replaced window to // receive a z-order increase. We want the replaced window to immediately receive the same // immediately receive the same treatment, e.g. to be above the dock divider. // treatment, e.g. to be above the dock divider. layer = assignAndIncreaseLayerIfNeeded(mReplacingWindow, layer); while (!mReplacingWindows.isEmpty()) { layer = assignAndIncreaseLayerIfNeeded(mPinnedWindow, layer); layer = assignAndIncreaseLayerIfNeeded(mReplacingWindows.remove(), layer); } while (!mPinnedWindows.isEmpty()) { layer = assignAndIncreaseLayerIfNeeded(mPinnedWindows.remove(), layer); } } } private int assignAndIncreaseLayerIfNeeded(WindowState win, int layer) { private int assignAndIncreaseLayerIfNeeded(WindowState win, int layer) { Loading Loading
services/core/java/com/android/server/wm/WindowLayersController.java +37 −24 Original line number Original line Diff line number Diff line Loading @@ -16,12 +16,14 @@ package com.android.server.wm; package com.android.server.wm; import android.app.ActivityManager.StackId; import android.util.Slog; import android.util.Slog; import android.view.Display; import android.view.Display; import java.io.PrintWriter; import java.io.PrintWriter; import java.util.ArrayDeque; import static android.app.ActivityManager.StackId.DOCKED_STACK_ID; import static android.app.ActivityManager.StackId.PINNED_STACK_ID; import static android.view.WindowManager.LayoutParams.TYPE_DOCK_DIVIDER; import static android.view.WindowManager.LayoutParams.TYPE_DOCK_DIVIDER; import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_LAYERS; import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_LAYERS; import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM; import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM; Loading Loading @@ -55,10 +57,10 @@ public class WindowLayersController { } } private int mHighestApplicationLayer = 0; private int mHighestApplicationLayer = 0; private WindowState mPinnedWindow = null; private ArrayDeque<WindowState> mPinnedWindows = new ArrayDeque<>(); private WindowState mDockedWindow = null; private ArrayDeque<WindowState> mDockedWindows = new ArrayDeque<>(); private WindowState mDockDivider = null; private WindowState mDockDivider = null; private WindowState mReplacingWindow = null; private ArrayDeque<WindowState> mReplacingWindows = new ArrayDeque<>(); final void assignLayersLocked(WindowList windows) { final void assignLayersLocked(WindowList windows) { if (DEBUG_LAYERS) Slog.v(TAG_WM, "Assigning layers based on windows=" + windows, if (DEBUG_LAYERS) Slog.v(TAG_WM, "Assigning layers based on windows=" + windows, Loading Loading @@ -169,43 +171,54 @@ public class WindowLayersController { private void clear() { private void clear() { mHighestApplicationLayer = 0; mHighestApplicationLayer = 0; mPinnedWindow = null; mPinnedWindows.clear(); mDockedWindow = null; mDockedWindows.clear(); mReplacingWindows.clear(); mDockDivider = null; mDockDivider = null; } } private void collectSpecialWindows(WindowState w) { private void collectSpecialWindows(WindowState w) { if (w.mAttrs.type == TYPE_DOCK_DIVIDER) { if (w.mAttrs.type == TYPE_DOCK_DIVIDER) { mDockDivider = w; mDockDivider = w; } else { return; } if (w.mWillReplaceWindow) { mReplacingWindows.add(w); } final TaskStack stack = w.getStack(); final TaskStack stack = w.getStack(); if (stack == null) { if (stack == null) { return; return; } } if (stack.mStackId == StackId.PINNED_STACK_ID) { if (stack.mStackId == PINNED_STACK_ID) { mPinnedWindow = w; mPinnedWindows.add(w); } else if (stack.mStackId == StackId.DOCKED_STACK_ID) { } else if (stack.mStackId == DOCKED_STACK_ID) { mDockedWindow = w; mDockedWindows.add(w); } } } } } private void adjustSpecialWindows() { private void adjustSpecialWindows() { int layer = mHighestApplicationLayer + 1; int layer = mHighestApplicationLayer + 1; // For pinned and docked stack window, we want to make them above other windows // For pinned and docked stack window, we want to make them above other windows also when // also when these windows are animating. // these windows are animating. layer = assignAndIncreaseLayerIfNeeded(mDockedWindow, layer); while (!mDockedWindows.isEmpty()) { layer = assignAndIncreaseLayerIfNeeded(mDockedWindows.remove(), layer); } // Leave some space here so the dim layer while dismissing docked/fullscreen stack has space // Leave some space here so the dim layer while dismissing docked/fullscreen stack has space // below the divider but above the app windows. It needs to be below the divider in because // below the divider but above the app windows. It needs to be below the divider in because // the divider sometimes overlaps the app windows. // the divider sometimes overlaps the app windows. layer++; layer++; layer = assignAndIncreaseLayerIfNeeded(mDockDivider, layer); layer = assignAndIncreaseLayerIfNeeded(mDockDivider, layer); // We know that we will be animating a relaunching window in the near future, // We know that we will be animating a relaunching window in the near future, which will // which will receive a z-order increase. We want the replaced window to // receive a z-order increase. We want the replaced window to immediately receive the same // immediately receive the same treatment, e.g. to be above the dock divider. // treatment, e.g. to be above the dock divider. layer = assignAndIncreaseLayerIfNeeded(mReplacingWindow, layer); while (!mReplacingWindows.isEmpty()) { layer = assignAndIncreaseLayerIfNeeded(mPinnedWindow, layer); layer = assignAndIncreaseLayerIfNeeded(mReplacingWindows.remove(), layer); } while (!mPinnedWindows.isEmpty()) { layer = assignAndIncreaseLayerIfNeeded(mPinnedWindows.remove(), layer); } } } private int assignAndIncreaseLayerIfNeeded(WindowState win, int layer) { private int assignAndIncreaseLayerIfNeeded(WindowState win, int layer) { Loading