Merge "Merge "Force pinned windows to always be scaleable." into nyc-dev am: e67960e am: 6ce373a" into nyc-mr1-dev-plus-aosp
This commit is contained in:
committed by
Android (Google) Code Review
commit
69a89816f9
@@ -694,6 +694,14 @@ public class ActivityManager {
|
|||||||
public static boolean activitiesCanRequestVisibleBehind(int stackId) {
|
public static boolean activitiesCanRequestVisibleBehind(int stackId) {
|
||||||
return stackId == FULLSCREEN_WORKSPACE_STACK_ID;
|
return stackId == FULLSCREEN_WORKSPACE_STACK_ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if this stack may be scaled without resizing,
|
||||||
|
* and windows within may need to be configured as such.
|
||||||
|
*/
|
||||||
|
public static boolean windowsAreScaleable(int stackId) {
|
||||||
|
return stackId == PINNED_STACK_ID;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -554,6 +554,15 @@ public class TaskStack implements DimLayer.DimLayerUser,
|
|||||||
if (toTop) {
|
if (toTop) {
|
||||||
mDisplayContent.moveStack(this, true);
|
mDisplayContent.moveStack(this, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (StackId.windowsAreScaleable(mStackId)) {
|
||||||
|
// We force windows out of SCALING_MODE_FREEZE
|
||||||
|
// so that we can continue to animate them
|
||||||
|
// while a resize is pending.
|
||||||
|
forceWindowsScaleable(task, true);
|
||||||
|
} else {
|
||||||
|
forceWindowsScaleable(task, false);
|
||||||
|
}
|
||||||
EventLog.writeEvent(EventLogTags.WM_TASK_MOVED, task.mTaskId, toTop ? 1 : 0, position);
|
EventLog.writeEvent(EventLogTags.WM_TASK_MOVED, task.mTaskId, toTop ? 1 : 0, position);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1279,20 +1288,18 @@ public class TaskStack implements DimLayer.DimLayerUser,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void forceWindowsScaleable(boolean force) {
|
void forceWindowsScaleable(Task task, boolean force) {
|
||||||
SurfaceControl.openTransaction();
|
SurfaceControl.openTransaction();
|
||||||
try {
|
try {
|
||||||
for (int taskNdx = mTasks.size() - 1; taskNdx >= 0; --taskNdx) {
|
final ArrayList<AppWindowToken> activities = task.mAppTokens;
|
||||||
final ArrayList<AppWindowToken> activities = mTasks.get(taskNdx).mAppTokens;
|
for (int activityNdx = activities.size() - 1; activityNdx >= 0; --activityNdx) {
|
||||||
for (int activityNdx = activities.size() - 1; activityNdx >= 0; --activityNdx) {
|
final ArrayList<WindowState> windows = activities.get(activityNdx).allAppWindows;
|
||||||
final ArrayList<WindowState> windows = activities.get(activityNdx).allAppWindows;
|
for (int winNdx = windows.size() - 1; winNdx >= 0; --winNdx) {
|
||||||
for (int winNdx = windows.size() - 1; winNdx >= 0; --winNdx) {
|
final WindowStateAnimator winAnimator = windows.get(winNdx).mWinAnimator;
|
||||||
final WindowStateAnimator winAnimator = windows.get(winNdx).mWinAnimator;
|
if (winAnimator == null || !winAnimator.hasSurface()) {
|
||||||
if (winAnimator == null || !winAnimator.hasSurface()) {
|
continue;
|
||||||
continue;
|
|
||||||
}
|
|
||||||
winAnimator.mSurfaceController.forceScaleableInTransaction(force);
|
|
||||||
}
|
}
|
||||||
|
winAnimator.mSurfaceController.forceScaleableInTransaction(force);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
@@ -1303,10 +1310,6 @@ public class TaskStack implements DimLayer.DimLayerUser,
|
|||||||
@Override // AnimatesBounds
|
@Override // AnimatesBounds
|
||||||
public void onAnimationStart() {
|
public void onAnimationStart() {
|
||||||
synchronized (mService.mWindowMap) {
|
synchronized (mService.mWindowMap) {
|
||||||
// We force windows out of SCALING_MODE_FREEZE
|
|
||||||
// so that we can continue to animate them
|
|
||||||
// while a resize is pending.
|
|
||||||
forceWindowsScaleable(true);
|
|
||||||
mFreezeMovementAnimations = true;
|
mFreezeMovementAnimations = true;
|
||||||
mBoundsAnimating = true;
|
mBoundsAnimating = true;
|
||||||
}
|
}
|
||||||
@@ -1317,7 +1320,6 @@ public class TaskStack implements DimLayer.DimLayerUser,
|
|||||||
synchronized (mService.mWindowMap) {
|
synchronized (mService.mWindowMap) {
|
||||||
mFreezeMovementAnimations = false;
|
mFreezeMovementAnimations = false;
|
||||||
mBoundsAnimating = false;
|
mBoundsAnimating = false;
|
||||||
forceWindowsScaleable(false);
|
|
||||||
mService.requestTraversal();
|
mService.requestTraversal();
|
||||||
}
|
}
|
||||||
if (mStackId == PINNED_STACK_ID) {
|
if (mStackId == PINNED_STACK_ID) {
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
package com.android.server.wm;
|
package com.android.server.wm;
|
||||||
|
|
||||||
import static android.app.ActivityManager.StackId;
|
import static android.app.ActivityManager.StackId;
|
||||||
|
import static android.app.ActivityManager.StackId.PINNED_STACK_ID;
|
||||||
import static android.view.Display.DEFAULT_DISPLAY;
|
import static android.view.Display.DEFAULT_DISPLAY;
|
||||||
import static android.view.WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED;
|
import static android.view.WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED;
|
||||||
import static android.view.WindowManager.LayoutParams.FLAG_SCALED;
|
import static android.view.WindowManager.LayoutParams.FLAG_SCALED;
|
||||||
@@ -1695,6 +1696,11 @@ class WindowStateAnimator {
|
|||||||
* @return Returns true if the surface was successfully shown.
|
* @return Returns true if the surface was successfully shown.
|
||||||
*/
|
*/
|
||||||
private boolean showSurfaceRobustlyLocked() {
|
private boolean showSurfaceRobustlyLocked() {
|
||||||
|
final Task task = mWin.getTask();
|
||||||
|
if (task != null && StackId.windowsAreScaleable(task.mStack.mStackId)) {
|
||||||
|
mSurfaceController.forceScaleableInTransaction(true);
|
||||||
|
}
|
||||||
|
|
||||||
boolean shown = mSurfaceController.showRobustlyInTransaction();
|
boolean shown = mSurfaceController.showRobustlyInTransaction();
|
||||||
if (!shown)
|
if (!shown)
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user