Loading services/core/java/com/android/server/wm/ActivityRecord.java +1 −1 Original line number Diff line number Diff line Loading @@ -1246,7 +1246,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A // First time we are adding the activity to the system. mVoiceInteraction = newTask.voiceSession != null; mInputDispatchingTimeoutNanos = getInputDispatchingTimeoutLocked(this) * 1000000L; onDisplayChanged(task.getDisplayContent()); // TODO(b/36505427): Maybe this call should be moved inside // updateOverrideConfiguration() newTask.updateOverrideConfigurationFromLaunchBounds(); Loading services/core/java/com/android/server/wm/ActivityStack.java +1 −5 Original line number Diff line number Diff line Loading @@ -637,7 +637,7 @@ class ActivityStack extends WindowContainer<WindowContainer> implements BoundsAn } ActivityStack(DisplayContent display, int stackId, ActivityStackSupervisor supervisor, int windowingMode, int activityType, boolean onTop) { int activityType) { super(supervisor.mService.mWindowManager); mStackId = stackId; mDockedStackMinimizeThickness = Loading @@ -654,10 +654,6 @@ class ActivityStack extends WindowContainer<WindowContainer> implements BoundsAn // stacks on a wrong display. mDisplayId = display.mDisplayId; setActivityType(activityType); display.addStack(this, onTop ? POSITION_TOP : POSITION_BOTTOM); setWindowingMode(windowingMode, false /* animate */, false /* showRecents */, false /* enteringSplitScreenMode */, false /* deferEnsuringVisibility */, true /* creating */); } /** Loading services/core/java/com/android/server/wm/DisplayContent.java +14 −4 Original line number Diff line number Diff line Loading @@ -1090,7 +1090,7 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo return token.asActivityRecord(); } private void addWindowToken(IBinder binder, WindowToken token) { void addWindowToken(IBinder binder, WindowToken token) { final DisplayContent dc = mWmService.mRoot.getWindowTokenDisplay(token); if (dc != null) { // We currently don't support adding a window token to the display if the display Loading @@ -1112,6 +1112,11 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo mTokenMap.put(binder, token); if (token.asActivityRecord() == null) { // Set displayContent for non-app token to prevent same token will add twice after // onDisplayChanged. // TODO: Check if it's fine that super.onDisplayChanged of WindowToken // (WindowsContainer#onDisplayChanged) may skipped when token.mDisplayContent assigned. token.mDisplayContent = this; // Add non-app token to container hierarchy on the display. App tokens are added through // the parent container managing them (e.g. Tasks). switch (token.windowType) { Loading Loading @@ -4287,7 +4292,6 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo // The reparenting case is handled in WindowContainer. if (!stack.mReparenting) { setLayoutNeeded(); stack.onDisplayChanged(DisplayContent.this); } } Loading Loading @@ -5745,8 +5749,14 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo throw new IllegalArgumentException("Stack with windowing mode cannot with non standard " + "activity type."); } return new ActivityStack(this, stackId, mRootActivityContainer.mStackSupervisor, windowingMode, activityType, onTop); final ActivityStack stack = new ActivityStack(this, stackId, mRootActivityContainer.mStackSupervisor, activityType); addStack(stack, onTop ? POSITION_TOP : POSITION_BOTTOM); stack.setWindowingMode(windowingMode, false /* animate */, false /* showRecents */, false /* enteringSplitScreenMode */, false /* deferEnsuringVisibility */, true /* creating */); return stack; } /** Loading services/core/java/com/android/server/wm/WindowContainer.java +4 −0 Original line number Diff line number Diff line Loading @@ -315,6 +315,10 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer< mParent.onChildAdded(this); } if (!mReparenting) { if (mParent != null && mParent.mDisplayContent != null && mDisplayContent != mParent.mDisplayContent) { onDisplayChanged(mParent.mDisplayContent); } onParentChanged(mParent, oldParent); } } Loading services/core/java/com/android/server/wm/WindowState.java +7 −3 Original line number Diff line number Diff line Loading @@ -797,9 +797,6 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP mSubLayer = mPolicy.getSubWindowLayerFromTypeLw(a.type); mIsChildWindow = true; ProtoLog.v(WM_DEBUG_ADD_REMOVE, "Adding %s to %s", this, parentWindow); parentWindow.addChild(this, sWindowSubLayerComparator); mLayoutAttached = mAttrs.type != WindowManager.LayoutParams.TYPE_APPLICATION_ATTACHED_DIALOG; mIsImWindow = parentWindow.mAttrs.type == TYPE_INPUT_METHOD Loading Loading @@ -836,6 +833,13 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP mInputWindowHandle = new InputWindowHandle( mActivityRecord != null ? mActivityRecord.mInputApplicationHandle : null, getDisplayId()); // Make sure we initial all fields before adding to parentWindow, to prevent exception // during onDisplayChanged. if (mIsChildWindow) { ProtoLog.v(WM_DEBUG_ADD_REMOVE, "Adding %s to %s", this, parentWindow); parentWindow.addChild(this, sWindowSubLayerComparator); } } void attach() { Loading Loading
services/core/java/com/android/server/wm/ActivityRecord.java +1 −1 Original line number Diff line number Diff line Loading @@ -1246,7 +1246,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A // First time we are adding the activity to the system. mVoiceInteraction = newTask.voiceSession != null; mInputDispatchingTimeoutNanos = getInputDispatchingTimeoutLocked(this) * 1000000L; onDisplayChanged(task.getDisplayContent()); // TODO(b/36505427): Maybe this call should be moved inside // updateOverrideConfiguration() newTask.updateOverrideConfigurationFromLaunchBounds(); Loading
services/core/java/com/android/server/wm/ActivityStack.java +1 −5 Original line number Diff line number Diff line Loading @@ -637,7 +637,7 @@ class ActivityStack extends WindowContainer<WindowContainer> implements BoundsAn } ActivityStack(DisplayContent display, int stackId, ActivityStackSupervisor supervisor, int windowingMode, int activityType, boolean onTop) { int activityType) { super(supervisor.mService.mWindowManager); mStackId = stackId; mDockedStackMinimizeThickness = Loading @@ -654,10 +654,6 @@ class ActivityStack extends WindowContainer<WindowContainer> implements BoundsAn // stacks on a wrong display. mDisplayId = display.mDisplayId; setActivityType(activityType); display.addStack(this, onTop ? POSITION_TOP : POSITION_BOTTOM); setWindowingMode(windowingMode, false /* animate */, false /* showRecents */, false /* enteringSplitScreenMode */, false /* deferEnsuringVisibility */, true /* creating */); } /** Loading
services/core/java/com/android/server/wm/DisplayContent.java +14 −4 Original line number Diff line number Diff line Loading @@ -1090,7 +1090,7 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo return token.asActivityRecord(); } private void addWindowToken(IBinder binder, WindowToken token) { void addWindowToken(IBinder binder, WindowToken token) { final DisplayContent dc = mWmService.mRoot.getWindowTokenDisplay(token); if (dc != null) { // We currently don't support adding a window token to the display if the display Loading @@ -1112,6 +1112,11 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo mTokenMap.put(binder, token); if (token.asActivityRecord() == null) { // Set displayContent for non-app token to prevent same token will add twice after // onDisplayChanged. // TODO: Check if it's fine that super.onDisplayChanged of WindowToken // (WindowsContainer#onDisplayChanged) may skipped when token.mDisplayContent assigned. token.mDisplayContent = this; // Add non-app token to container hierarchy on the display. App tokens are added through // the parent container managing them (e.g. Tasks). switch (token.windowType) { Loading Loading @@ -4287,7 +4292,6 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo // The reparenting case is handled in WindowContainer. if (!stack.mReparenting) { setLayoutNeeded(); stack.onDisplayChanged(DisplayContent.this); } } Loading Loading @@ -5745,8 +5749,14 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo throw new IllegalArgumentException("Stack with windowing mode cannot with non standard " + "activity type."); } return new ActivityStack(this, stackId, mRootActivityContainer.mStackSupervisor, windowingMode, activityType, onTop); final ActivityStack stack = new ActivityStack(this, stackId, mRootActivityContainer.mStackSupervisor, activityType); addStack(stack, onTop ? POSITION_TOP : POSITION_BOTTOM); stack.setWindowingMode(windowingMode, false /* animate */, false /* showRecents */, false /* enteringSplitScreenMode */, false /* deferEnsuringVisibility */, true /* creating */); return stack; } /** Loading
services/core/java/com/android/server/wm/WindowContainer.java +4 −0 Original line number Diff line number Diff line Loading @@ -315,6 +315,10 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer< mParent.onChildAdded(this); } if (!mReparenting) { if (mParent != null && mParent.mDisplayContent != null && mDisplayContent != mParent.mDisplayContent) { onDisplayChanged(mParent.mDisplayContent); } onParentChanged(mParent, oldParent); } } Loading
services/core/java/com/android/server/wm/WindowState.java +7 −3 Original line number Diff line number Diff line Loading @@ -797,9 +797,6 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP mSubLayer = mPolicy.getSubWindowLayerFromTypeLw(a.type); mIsChildWindow = true; ProtoLog.v(WM_DEBUG_ADD_REMOVE, "Adding %s to %s", this, parentWindow); parentWindow.addChild(this, sWindowSubLayerComparator); mLayoutAttached = mAttrs.type != WindowManager.LayoutParams.TYPE_APPLICATION_ATTACHED_DIALOG; mIsImWindow = parentWindow.mAttrs.type == TYPE_INPUT_METHOD Loading Loading @@ -836,6 +833,13 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP mInputWindowHandle = new InputWindowHandle( mActivityRecord != null ? mActivityRecord.mInputApplicationHandle : null, getDisplayId()); // Make sure we initial all fields before adding to parentWindow, to prevent exception // during onDisplayChanged. if (mIsChildWindow) { ProtoLog.v(WM_DEBUG_ADD_REMOVE, "Adding %s to %s", this, parentWindow); parentWindow.addChild(this, sWindowSubLayerComparator); } } void attach() { Loading