Merge "Don't send non-resizeable notification in some cases."
This commit is contained in:
committed by
Android (Google) Code Review
commit
b85dfde696
@@ -200,6 +200,7 @@ message ScreenRotationAnimationProto {
|
||||
message WindowContainerProto {
|
||||
optional ConfigurationContainerProto configuration_container = 1;
|
||||
optional int32 orientation = 2;
|
||||
optional bool visible = 3;
|
||||
}
|
||||
|
||||
/* represents ConfigurationContainer */
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user