Disable FLAG_LAYOUT_NO_LIMITS window flag in multi-window mode
FLAG_LAYOUT_NO_LIMITS allows a window to extend its dimensions outside the screen area by setting the display frame to a really big value. We don't want this in multi-window mode since all window frames should be limited to their parent task/stack dimensions. Bug: 27577275 Change-Id: Ie0a8b8c13de91561e06dadc27aac3a5ba209d05b
This commit is contained in:
@@ -405,6 +405,12 @@ public interface WindowManagerPolicy {
|
||||
* not attached to any stack.
|
||||
*/
|
||||
int getStackId();
|
||||
|
||||
/**
|
||||
* Returns true if the window is current in multi-windowing mode. i.e. it shares the
|
||||
* screen with other application windows.
|
||||
*/
|
||||
public boolean inMultiWindowMode();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -4593,7 +4593,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
||||
}
|
||||
|
||||
// TYPE_SYSTEM_ERROR is above the NavigationBar so it can't be allowed to extend over it.
|
||||
if ((fl & FLAG_LAYOUT_NO_LIMITS) != 0 && attrs.type != TYPE_SYSTEM_ERROR) {
|
||||
// Also, we don't allow windows in multi-window mode to extend out of the screen.
|
||||
if ((fl & FLAG_LAYOUT_NO_LIMITS) != 0 && attrs.type != TYPE_SYSTEM_ERROR
|
||||
&& !win.inMultiWindowMode()) {
|
||||
df.left = df.top = -10000;
|
||||
df.right = df.bottom = 10000;
|
||||
if (attrs.type != TYPE_WALLPAPER) {
|
||||
|
||||
@@ -642,7 +642,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
|
||||
mHaveFrame = true;
|
||||
|
||||
final Task task = getTask();
|
||||
final boolean fullscreenTask = task == null || task.isFullscreen();
|
||||
final boolean fullscreenTask = !inMultiWindowMode();
|
||||
final boolean windowsAreFloating = task != null && task.isFloating();
|
||||
|
||||
if (fullscreenTask || (isChildWindow()
|
||||
@@ -2215,6 +2215,12 @@ final class WindowState implements WindowManagerPolicy.WindowState {
|
||||
return task != null && task.inFreeformWorkspace();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean inMultiWindowMode() {
|
||||
final Task task = getTask();
|
||||
return task != null && !task.isFullscreen();
|
||||
}
|
||||
|
||||
boolean isDragResizeChanged() {
|
||||
return mDragResizing != computeDragResizing();
|
||||
}
|
||||
@@ -2506,9 +2512,8 @@ final class WindowState implements WindowManagerPolicy.WindowState {
|
||||
final int pw = mContainingFrame.width();
|
||||
final int ph = mContainingFrame.height();
|
||||
final Task task = getTask();
|
||||
final boolean nonFullscreenTask = task != null && !task.isFullscreen();
|
||||
final boolean fitToDisplay = task != null &&
|
||||
!task.isFloating();
|
||||
final boolean nonFullscreenTask = inMultiWindowMode();
|
||||
final boolean fitToDisplay = task != null && !task.isFloating();
|
||||
float x, y;
|
||||
int w,h;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user