Merge "Disable FLAG_LAYOUT_NO_LIMITS window flag in multi-window mode" into nyc-dev

This commit is contained in:
Wale Ogunwale
2016-03-14 19:26:26 +00:00
committed by Android (Google) Code Review
3 changed files with 18 additions and 5 deletions

View File

@@ -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();
}
/**

View File

@@ -4635,7 +4635,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) {

View File

@@ -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;