Loading services/core/java/com/android/server/am/ActivityStackSupervisor.java +10 −3 Original line number Diff line number Diff line Loading @@ -1239,9 +1239,16 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D ResolveInfo resolveIntent(Intent intent, String resolvedType, int userId, int flags) { synchronized (mService) { return mService.getPackageManagerInternalLocked().resolveIntent(intent, resolvedType, PackageManager.MATCH_INSTANT | PackageManager.MATCH_DEFAULT_ONLY | flags try { Trace.traceBegin(TRACE_TAG_ACTIVITY_MANAGER, "resolveIntent"); return mService.getPackageManagerInternalLocked().resolveIntent( intent, resolvedType, PackageManager.MATCH_INSTANT | PackageManager.MATCH_DEFAULT_ONLY | flags | ActivityManagerService.STOCK_PM_FLAGS, userId, true); } finally { Trace.traceEnd(TRACE_TAG_ACTIVITY_MANAGER); } } } Loading services/core/java/com/android/server/am/ActivityStarter.java +1 −0 Original line number Diff line number Diff line Loading @@ -96,6 +96,7 @@ import android.os.Bundle; import android.os.IBinder; import android.os.RemoteException; import android.os.SystemClock; import android.os.Trace; import android.os.UserHandle; import android.os.UserManager; import android.service.voice.IVoiceInteractionSession; Loading services/core/java/com/android/server/wm/DisplayContent.java +47 −40 Original line number Diff line number Diff line Loading @@ -135,6 +135,7 @@ import android.os.Handler; import android.os.IBinder; import android.os.RemoteException; import android.os.SystemClock; import android.os.Trace; import android.util.DisplayMetrics; import android.util.MutableBoolean; import android.util.Slog; Loading Loading @@ -178,20 +179,20 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo /** The containers below are the only child containers the display can have. */ // Contains all window containers that are related to apps (Activities) private final TaskStackContainers mTaskStackContainers = new TaskStackContainers(); private final TaskStackContainers mTaskStackContainers = new TaskStackContainers(mService); // Contains all non-app window containers that should be displayed above the app containers // (e.g. Status bar) private final AboveAppWindowContainers mAboveAppWindowsContainers = new AboveAppWindowContainers("mAboveAppWindowsContainers"); new AboveAppWindowContainers("mAboveAppWindowsContainers", mService); // Contains all non-app window containers that should be displayed below the app containers // (e.g. Wallpaper). private final NonAppWindowContainers mBelowAppWindowsContainers = new NonAppWindowContainers("mBelowAppWindowsContainers"); new NonAppWindowContainers("mBelowAppWindowsContainers", mService); // Contains all IME window containers. Note that the z-ordering of the IME windows will depend // on the IME target. We mainly have this container grouping so we can keep track of all the IME // window containers together and move them in-sync if/when needed. private final NonAppWindowContainers mImeWindowsContainers = new NonAppWindowContainers("mImeWindowsContainers"); new NonAppWindowContainers("mImeWindowsContainers", mService); private WindowState mTmpWindow; private WindowState mTmpWindow2; Loading Loading @@ -317,8 +318,6 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo /** Used for handing back size of display */ private final Rect mTmpBounds = new Rect(); WindowManagerService mService; /** Remove this display when animation on it has completed. */ private boolean mDeferredRemoval; Loading Loading @@ -765,6 +764,7 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo */ DisplayContent(Display display, WindowManagerService service, WallpaperController wallpaperController) { super(service); if (service.mRoot.getDisplayContent(display.getDisplayId()) != null) { throw new IllegalArgumentException("Display with ID=" + display.getDisplayId() + " already exists=" + service.mRoot.getDisplayContent(display.getDisplayId()) Loading @@ -777,7 +777,6 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo display.getDisplayInfo(mDisplayInfo); display.getMetrics(mDisplayMetrics); isDefaultDisplay = mDisplayId == DEFAULT_DISPLAY; mService = service; mDisplayFrames = new DisplayFrames(mDisplayId, mDisplayInfo); initializeDisplayBaseInfo(); mDividerControllerLocked = new DockedStackDividerController(service, this); Loading Loading @@ -2339,6 +2338,7 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo /** Updates the layer assignment of windows on this display. */ void assignWindowLayers(boolean setLayoutNeeded) { Trace.traceBegin(Trace.TRACE_TAG_WINDOW_MANAGER, "assignWindowLayers"); assignChildLayers(getPendingTransaction()); if (setLayoutNeeded) { setLayoutNeeded(); Loading @@ -2349,6 +2349,7 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo // prepareSurfaces. This allows us to synchronize Z-ordering changes with // the hiding and showing of surfaces. scheduleAnimation(); Trace.traceEnd(Trace.TRACE_TAG_WINDOW_MANAGER); } // TODO: This should probably be called any time a visual change is made to the hierarchy like Loading Loading @@ -3182,6 +3183,10 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo */ static class DisplayChildWindowContainer<E extends WindowContainer> extends WindowContainer<E> { DisplayChildWindowContainer(WindowManagerService service) { super(service); } @Override boolean fillsParent() { return true; Loading Loading @@ -3209,6 +3214,10 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo private TaskStack mPinnedStack = null; private TaskStack mSplitScreenPrimaryStack = null; TaskStackContainers(WindowManagerService service) { super(service); } /** * Returns the topmost stack on the display that is compatible with the input windowing mode * and activity type. Null is no compatible stack on the display. Loading Loading @@ -3516,34 +3525,36 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo @Override void assignChildLayers(SurfaceControl.Transaction t) { final int NORMAL_STACK_STATE = 0; final int BOOSTED_STATE = 1; final int ALWAYS_ON_TOP_STATE = 2; int layer = 0; // We allow stacks to change visual order from the AM specified order due to // Z-boosting during animations. However we must take care to ensure TaskStacks // which are marked as alwaysOnTop remain that way. int layer = 0; for (int state = 0; state <= ALWAYS_ON_TOP_STATE; state++) { for (int i = 0; i < mChildren.size(); i++) { final TaskStack s = mChildren.get(i); layer++; if (state == NORMAL_STACK_STATE) { s.assignLayer(t, layer); } else if (state == BOOSTED_STATE && s.needsZBoost()) { s.assignLayer(t, layer); } else if (state == ALWAYS_ON_TOP_STATE && s.isAlwaysOnTop()) { s.assignLayer(t, layer); s.assignChildLayers(); if (!s.needsZBoost() && !s.isAlwaysOnTop()) { s.assignLayer(t, layer++); } s.assignChildLayers(t); } for (int i = 0; i < mChildren.size(); i++) { final TaskStack s = mChildren.get(i); if (s.needsZBoost() && !s.isAlwaysOnTop()) { s.assignLayer(t, layer++); } } for (int i = 0; i < mChildren.size(); i++) { final TaskStack s = mChildren.get(i); if (s.isAlwaysOnTop()) { s.assignLayer(t, layer++); } } // The appropriate place for App-Transitions to occur is right // above all other animations but still below things in the Picture-and-Picture // windowing mode. if (state == BOOSTED_STATE && mAnimationLayer != null) { t.setLayer(mAnimationLayer, layer + 1); } if (mAnimationLayer != null) { t.setLayer(mAnimationLayer, layer++); } } Loading @@ -3560,8 +3571,8 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo } private final class AboveAppWindowContainers extends NonAppWindowContainers { AboveAppWindowContainers(String name) { super(name); AboveAppWindowContainers(String name, WindowManagerService service) { super(name, service); } void assignChildLayers(SurfaceControl.Transaction t, WindowContainer imeContainer) { Loading @@ -3577,14 +3588,12 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo if (needAssignIme && layer >= mService.mPolicy.getWindowLayerFromTypeLw( TYPE_INPUT_METHOD_DIALOG, true)) { t.setRelativeLayer(imeContainer.getSurfaceControl(), wt.getSurfaceControl(), -1); imeContainer.assignRelativeLayer(t, wt.getSurfaceControl(), -1); needAssignIme = false; } } if (needAssignIme) { t.setRelativeLayer(imeContainer.getSurfaceControl(), getSurfaceControl(), Integer.MAX_VALUE); imeContainer.assignRelativeLayer(t, getSurfaceControl(), Integer.MAX_VALUE); } } } Loading Loading @@ -3618,7 +3627,8 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo }; private final String mName; NonAppWindowContainers(String name) { NonAppWindowContainers(String name, WindowManagerService service) { super(service); mName = name; } Loading Loading @@ -3712,8 +3722,6 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo @Override void assignChildLayers(SurfaceControl.Transaction t) { t.setLayer(mOverlayLayer, 1) .setLayer(mWindowingLayer, 0); // These are layers as children of "mWindowingLayer" mBelowAppWindowsContainers.assignLayer(t, 0); Loading @@ -3737,8 +3745,7 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo // place it in the AboveAppWindowContainers. if (imeTarget != null && !imeTarget.inSplitScreenWindowingMode() && (imeTarget.getSurfaceControl() != null)) { t.setRelativeLayer(mImeWindowsContainers.getSurfaceControl(), imeTarget.getSurfaceControl(), mImeWindowsContainers.assignRelativeLayer(t, imeTarget.getSurfaceControl(), // TODO: We need to use an extra level on the app surface to ensure // this is always above SurfaceView but always below attached window. 1); Loading services/core/java/com/android/server/wm/RootWindowContainer.java +1 −3 Original line number Diff line number Diff line Loading @@ -101,8 +101,6 @@ class RootWindowContainer extends WindowContainer<DisplayContent> { private static final int SET_SCREEN_BRIGHTNESS_OVERRIDE = 1; private static final int SET_USER_ACTIVITY_TIMEOUT = 2; WindowManagerService mService; private boolean mWallpaperForceHidingChanged = false; private Object mLastWindowFreezeSource = null; private Session mHoldScreen = null; Loading Loading @@ -160,7 +158,7 @@ class RootWindowContainer extends WindowContainer<DisplayContent> { }; RootWindowContainer(WindowManagerService service) { mService = service; super(service); mHandler = new MyHandler(service.mH.getLooper()); mWallpaperController = new WallpaperController(mService); } Loading services/core/java/com/android/server/wm/Task.java +1 −2 Original line number Diff line number Diff line Loading @@ -59,7 +59,6 @@ class Task extends WindowContainer<AppWindowToken> { final int mTaskId; final int mUserId; private boolean mDeferRemoval = false; final WindowManagerService mService; final Rect mPreparedFrozenBounds = new Rect(); final Configuration mPreparedFrozenMergedConfig = new Configuration(); Loading Loading @@ -102,10 +101,10 @@ class Task extends WindowContainer<AppWindowToken> { Task(int taskId, TaskStack stack, int userId, WindowManagerService service, int resizeMode, boolean supportsPictureInPicture, TaskDescription taskDescription, TaskWindowContainerController controller) { super(service); mTaskId = taskId; mStack = stack; mUserId = userId; mService = service; mResizeMode = resizeMode; mSupportsPictureInPicture = supportsPictureInPicture; setController(controller); Loading Loading
services/core/java/com/android/server/am/ActivityStackSupervisor.java +10 −3 Original line number Diff line number Diff line Loading @@ -1239,9 +1239,16 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D ResolveInfo resolveIntent(Intent intent, String resolvedType, int userId, int flags) { synchronized (mService) { return mService.getPackageManagerInternalLocked().resolveIntent(intent, resolvedType, PackageManager.MATCH_INSTANT | PackageManager.MATCH_DEFAULT_ONLY | flags try { Trace.traceBegin(TRACE_TAG_ACTIVITY_MANAGER, "resolveIntent"); return mService.getPackageManagerInternalLocked().resolveIntent( intent, resolvedType, PackageManager.MATCH_INSTANT | PackageManager.MATCH_DEFAULT_ONLY | flags | ActivityManagerService.STOCK_PM_FLAGS, userId, true); } finally { Trace.traceEnd(TRACE_TAG_ACTIVITY_MANAGER); } } } Loading
services/core/java/com/android/server/am/ActivityStarter.java +1 −0 Original line number Diff line number Diff line Loading @@ -96,6 +96,7 @@ import android.os.Bundle; import android.os.IBinder; import android.os.RemoteException; import android.os.SystemClock; import android.os.Trace; import android.os.UserHandle; import android.os.UserManager; import android.service.voice.IVoiceInteractionSession; Loading
services/core/java/com/android/server/wm/DisplayContent.java +47 −40 Original line number Diff line number Diff line Loading @@ -135,6 +135,7 @@ import android.os.Handler; import android.os.IBinder; import android.os.RemoteException; import android.os.SystemClock; import android.os.Trace; import android.util.DisplayMetrics; import android.util.MutableBoolean; import android.util.Slog; Loading Loading @@ -178,20 +179,20 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo /** The containers below are the only child containers the display can have. */ // Contains all window containers that are related to apps (Activities) private final TaskStackContainers mTaskStackContainers = new TaskStackContainers(); private final TaskStackContainers mTaskStackContainers = new TaskStackContainers(mService); // Contains all non-app window containers that should be displayed above the app containers // (e.g. Status bar) private final AboveAppWindowContainers mAboveAppWindowsContainers = new AboveAppWindowContainers("mAboveAppWindowsContainers"); new AboveAppWindowContainers("mAboveAppWindowsContainers", mService); // Contains all non-app window containers that should be displayed below the app containers // (e.g. Wallpaper). private final NonAppWindowContainers mBelowAppWindowsContainers = new NonAppWindowContainers("mBelowAppWindowsContainers"); new NonAppWindowContainers("mBelowAppWindowsContainers", mService); // Contains all IME window containers. Note that the z-ordering of the IME windows will depend // on the IME target. We mainly have this container grouping so we can keep track of all the IME // window containers together and move them in-sync if/when needed. private final NonAppWindowContainers mImeWindowsContainers = new NonAppWindowContainers("mImeWindowsContainers"); new NonAppWindowContainers("mImeWindowsContainers", mService); private WindowState mTmpWindow; private WindowState mTmpWindow2; Loading Loading @@ -317,8 +318,6 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo /** Used for handing back size of display */ private final Rect mTmpBounds = new Rect(); WindowManagerService mService; /** Remove this display when animation on it has completed. */ private boolean mDeferredRemoval; Loading Loading @@ -765,6 +764,7 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo */ DisplayContent(Display display, WindowManagerService service, WallpaperController wallpaperController) { super(service); if (service.mRoot.getDisplayContent(display.getDisplayId()) != null) { throw new IllegalArgumentException("Display with ID=" + display.getDisplayId() + " already exists=" + service.mRoot.getDisplayContent(display.getDisplayId()) Loading @@ -777,7 +777,6 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo display.getDisplayInfo(mDisplayInfo); display.getMetrics(mDisplayMetrics); isDefaultDisplay = mDisplayId == DEFAULT_DISPLAY; mService = service; mDisplayFrames = new DisplayFrames(mDisplayId, mDisplayInfo); initializeDisplayBaseInfo(); mDividerControllerLocked = new DockedStackDividerController(service, this); Loading Loading @@ -2339,6 +2338,7 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo /** Updates the layer assignment of windows on this display. */ void assignWindowLayers(boolean setLayoutNeeded) { Trace.traceBegin(Trace.TRACE_TAG_WINDOW_MANAGER, "assignWindowLayers"); assignChildLayers(getPendingTransaction()); if (setLayoutNeeded) { setLayoutNeeded(); Loading @@ -2349,6 +2349,7 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo // prepareSurfaces. This allows us to synchronize Z-ordering changes with // the hiding and showing of surfaces. scheduleAnimation(); Trace.traceEnd(Trace.TRACE_TAG_WINDOW_MANAGER); } // TODO: This should probably be called any time a visual change is made to the hierarchy like Loading Loading @@ -3182,6 +3183,10 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo */ static class DisplayChildWindowContainer<E extends WindowContainer> extends WindowContainer<E> { DisplayChildWindowContainer(WindowManagerService service) { super(service); } @Override boolean fillsParent() { return true; Loading Loading @@ -3209,6 +3214,10 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo private TaskStack mPinnedStack = null; private TaskStack mSplitScreenPrimaryStack = null; TaskStackContainers(WindowManagerService service) { super(service); } /** * Returns the topmost stack on the display that is compatible with the input windowing mode * and activity type. Null is no compatible stack on the display. Loading Loading @@ -3516,34 +3525,36 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo @Override void assignChildLayers(SurfaceControl.Transaction t) { final int NORMAL_STACK_STATE = 0; final int BOOSTED_STATE = 1; final int ALWAYS_ON_TOP_STATE = 2; int layer = 0; // We allow stacks to change visual order from the AM specified order due to // Z-boosting during animations. However we must take care to ensure TaskStacks // which are marked as alwaysOnTop remain that way. int layer = 0; for (int state = 0; state <= ALWAYS_ON_TOP_STATE; state++) { for (int i = 0; i < mChildren.size(); i++) { final TaskStack s = mChildren.get(i); layer++; if (state == NORMAL_STACK_STATE) { s.assignLayer(t, layer); } else if (state == BOOSTED_STATE && s.needsZBoost()) { s.assignLayer(t, layer); } else if (state == ALWAYS_ON_TOP_STATE && s.isAlwaysOnTop()) { s.assignLayer(t, layer); s.assignChildLayers(); if (!s.needsZBoost() && !s.isAlwaysOnTop()) { s.assignLayer(t, layer++); } s.assignChildLayers(t); } for (int i = 0; i < mChildren.size(); i++) { final TaskStack s = mChildren.get(i); if (s.needsZBoost() && !s.isAlwaysOnTop()) { s.assignLayer(t, layer++); } } for (int i = 0; i < mChildren.size(); i++) { final TaskStack s = mChildren.get(i); if (s.isAlwaysOnTop()) { s.assignLayer(t, layer++); } } // The appropriate place for App-Transitions to occur is right // above all other animations but still below things in the Picture-and-Picture // windowing mode. if (state == BOOSTED_STATE && mAnimationLayer != null) { t.setLayer(mAnimationLayer, layer + 1); } if (mAnimationLayer != null) { t.setLayer(mAnimationLayer, layer++); } } Loading @@ -3560,8 +3571,8 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo } private final class AboveAppWindowContainers extends NonAppWindowContainers { AboveAppWindowContainers(String name) { super(name); AboveAppWindowContainers(String name, WindowManagerService service) { super(name, service); } void assignChildLayers(SurfaceControl.Transaction t, WindowContainer imeContainer) { Loading @@ -3577,14 +3588,12 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo if (needAssignIme && layer >= mService.mPolicy.getWindowLayerFromTypeLw( TYPE_INPUT_METHOD_DIALOG, true)) { t.setRelativeLayer(imeContainer.getSurfaceControl(), wt.getSurfaceControl(), -1); imeContainer.assignRelativeLayer(t, wt.getSurfaceControl(), -1); needAssignIme = false; } } if (needAssignIme) { t.setRelativeLayer(imeContainer.getSurfaceControl(), getSurfaceControl(), Integer.MAX_VALUE); imeContainer.assignRelativeLayer(t, getSurfaceControl(), Integer.MAX_VALUE); } } } Loading Loading @@ -3618,7 +3627,8 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo }; private final String mName; NonAppWindowContainers(String name) { NonAppWindowContainers(String name, WindowManagerService service) { super(service); mName = name; } Loading Loading @@ -3712,8 +3722,6 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo @Override void assignChildLayers(SurfaceControl.Transaction t) { t.setLayer(mOverlayLayer, 1) .setLayer(mWindowingLayer, 0); // These are layers as children of "mWindowingLayer" mBelowAppWindowsContainers.assignLayer(t, 0); Loading @@ -3737,8 +3745,7 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo // place it in the AboveAppWindowContainers. if (imeTarget != null && !imeTarget.inSplitScreenWindowingMode() && (imeTarget.getSurfaceControl() != null)) { t.setRelativeLayer(mImeWindowsContainers.getSurfaceControl(), imeTarget.getSurfaceControl(), mImeWindowsContainers.assignRelativeLayer(t, imeTarget.getSurfaceControl(), // TODO: We need to use an extra level on the app surface to ensure // this is always above SurfaceView but always below attached window. 1); Loading
services/core/java/com/android/server/wm/RootWindowContainer.java +1 −3 Original line number Diff line number Diff line Loading @@ -101,8 +101,6 @@ class RootWindowContainer extends WindowContainer<DisplayContent> { private static final int SET_SCREEN_BRIGHTNESS_OVERRIDE = 1; private static final int SET_USER_ACTIVITY_TIMEOUT = 2; WindowManagerService mService; private boolean mWallpaperForceHidingChanged = false; private Object mLastWindowFreezeSource = null; private Session mHoldScreen = null; Loading Loading @@ -160,7 +158,7 @@ class RootWindowContainer extends WindowContainer<DisplayContent> { }; RootWindowContainer(WindowManagerService service) { mService = service; super(service); mHandler = new MyHandler(service.mH.getLooper()); mWallpaperController = new WallpaperController(mService); } Loading
services/core/java/com/android/server/wm/Task.java +1 −2 Original line number Diff line number Diff line Loading @@ -59,7 +59,6 @@ class Task extends WindowContainer<AppWindowToken> { final int mTaskId; final int mUserId; private boolean mDeferRemoval = false; final WindowManagerService mService; final Rect mPreparedFrozenBounds = new Rect(); final Configuration mPreparedFrozenMergedConfig = new Configuration(); Loading Loading @@ -102,10 +101,10 @@ class Task extends WindowContainer<AppWindowToken> { Task(int taskId, TaskStack stack, int userId, WindowManagerService service, int resizeMode, boolean supportsPictureInPicture, TaskDescription taskDescription, TaskWindowContainerController controller) { super(service); mTaskId = taskId; mStack = stack; mUserId = userId; mService = service; mResizeMode = resizeMode; mSupportsPictureInPicture = supportsPictureInPicture; setController(controller); Loading