diff options
5 files changed, 17 insertions, 7 deletions
diff --git a/core/proto/android/server/windowmanagerservice.proto b/core/proto/android/server/windowmanagerservice.proto index 0228edb03a83..915fe9d5ce41 100644 --- a/core/proto/android/server/windowmanagerservice.proto +++ b/core/proto/android/server/windowmanagerservice.proto @@ -200,6 +200,7 @@ message ScreenRotationAnimationProto { message WindowContainerProto { optional ConfigurationContainerProto configuration_container = 1; optional int32 orientation = 2; + optional bool visible = 3; } /* represents ConfigurationContainer */ diff --git a/services/core/java/com/android/server/am/ActivityDisplay.java b/services/core/java/com/android/server/am/ActivityDisplay.java index 2d2424fe7b59..9bfdd0c5009c 100644 --- a/services/core/java/com/android/server/am/ActivityDisplay.java +++ b/services/core/java/com/android/server/am/ActivityDisplay.java @@ -433,7 +433,9 @@ class ActivityDisplay extends ConfigurationContainer<ActivityStack> { || !otherStack.affectedBySplitScreenResize()) { continue; } - otherStack.setWindowingMode(WINDOWING_MODE_SPLIT_SCREEN_SECONDARY); + otherStack.setWindowingMode(WINDOWING_MODE_SPLIT_SCREEN_SECONDARY, + false /* animate */, false /* showRecents */, + false /* sendNonResizeableNotification */); } } finally { mSupervisor.mWindowManager.continueSurfaceLayout(); diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index 7b4703a4677c..982380c8b85c 100644 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -10570,7 +10570,8 @@ public class ActivityManagerService extends IActivityManager.Stub if (toTop) { stack.moveToFront("setTaskWindowingModeSplitScreenPrimary", task); } - stack.setWindowingMode(WINDOWING_MODE_SPLIT_SCREEN_PRIMARY, animate, showRecents); + stack.setWindowingMode(WINDOWING_MODE_SPLIT_SCREEN_PRIMARY, animate, showRecents, + true /* sendNonResizeableNotification */); return windowingMode != task.getWindowingMode(); } finally { Binder.restoreCallingIdentity(ident); diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java index edf9813497e0..fcf99465d1b4 100644 --- a/services/core/java/com/android/server/am/ActivityStack.java +++ b/services/core/java/com/android/server/am/ActivityStack.java @@ -483,10 +483,12 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai @Override public void setWindowingMode(int windowingMode) { - setWindowingMode(windowingMode, false /* animate */, true /* showRecents */); + setWindowingMode(windowingMode, false /* animate */, true /* showRecents */, + true /* sendNonResizeableNotification */); } - void setWindowingMode(int preferredWindowingMode, boolean animate, boolean showRecents) { + void setWindowingMode(int preferredWindowingMode, boolean animate, boolean showRecents, + boolean sendNonResizeableNotification) { final int currentMode = getWindowingMode(); final ActivityDisplay display = getDisplay(); final TaskRecord topTask = topTask(); @@ -505,7 +507,8 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai final boolean alreadyInSplitScreenMode = display.hasSplitScreenPrimaryStack(); // Take any required action due to us not supporting the preferred windowing mode. - if (windowingMode != preferredWindowingMode && isActivityTypeStandardOrUndefined()) { + if (sendNonResizeableNotification + && windowingMode != preferredWindowingMode && isActivityTypeStandardOrUndefined()) { if (alreadyInSplitScreenMode && (preferredWindowingMode == WINDOWING_MODE_SPLIT_SCREEN_PRIMARY || preferredWindowingMode == WINDOWING_MODE_SPLIT_SCREEN_SECONDARY)) { @@ -524,8 +527,9 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai final WindowManagerService wm = mService.mWindowManager; final ActivityRecord topActivity = getTopActivity(); - if (windowingMode != WINDOWING_MODE_FULLSCREEN && topActivity != null - && topActivity.isNonResizableOrForcedResizable() && !topActivity.noDisplay) { + if (sendNonResizeableNotification && windowingMode != WINDOWING_MODE_FULLSCREEN + && topActivity != null && topActivity.isNonResizableOrForcedResizable() + && !topActivity.noDisplay) { // Inform the user that they are starting an app that may not work correctly in // multi-window mode. final String packageName = topActivity.appInfo.packageName; diff --git a/services/core/java/com/android/server/wm/WindowContainer.java b/services/core/java/com/android/server/wm/WindowContainer.java index 64675825243e..c371e8832e5a 100644 --- a/services/core/java/com/android/server/wm/WindowContainer.java +++ b/services/core/java/com/android/server/wm/WindowContainer.java @@ -21,6 +21,7 @@ import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSET; import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED; import static com.android.server.wm.proto.WindowContainerProto.CONFIGURATION_CONTAINER; import static com.android.server.wm.proto.WindowContainerProto.ORIENTATION; +import static com.android.server.wm.proto.WindowContainerProto.VISIBLE; import static android.view.SurfaceControl.Transaction; import android.annotation.CallSuper; @@ -809,6 +810,7 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer< final long token = proto.start(fieldId); super.writeToProto(proto, CONFIGURATION_CONTAINER, trim); proto.write(ORIENTATION, mOrientation); + proto.write(VISIBLE, isVisible()); proto.end(token); } |