Loading cmds/am/src/com/android/commands/am/Am.java +26 −18 Original line number Diff line number Diff line Loading @@ -1774,18 +1774,33 @@ public class Am extends BaseCommand { System.err.println("Error: invalid input bounds"); return; } resizeStack(stackId, bounds, 0, false); resizeStack(stackId, bounds, 0); } private void runStackResizeAnimated() throws Exception { String stackIdStr = nextArgRequired(); int stackId = Integer.valueOf(stackIdStr); final Rect bounds = getBounds(); final Rect bounds; if ("null".equals(mArgs.peekNextArg())) { bounds = null; } else { bounds = getBounds(); if (bounds == null) { System.err.println("Error: invalid input bounds"); return; } resizeStack(stackId, bounds, 0, true); } resizeStackUnchecked(stackId, bounds, 0, true); } private void resizeStackUnchecked(int stackId, Rect bounds, int delayMs, boolean animate) { try { mAm.resizeStack(stackId, bounds, false, false, animate); Thread.sleep(delayMs); } catch (RemoteException e) { showError("Error: resizing stack " + e); } catch (InterruptedException e) { } } private void runStackResizeDocked() throws Exception { Loading @@ -1802,20 +1817,13 @@ public class Am extends BaseCommand { } } private void resizeStack(int stackId, Rect bounds, int delayMs, boolean animate) private void resizeStack(int stackId, Rect bounds, int delayMs) throws Exception { if (bounds == null) { showError("Error: invalid input bounds"); return; } try { mAm.resizeStack(stackId, bounds, false, false, animate); Thread.sleep(delayMs); } catch (RemoteException e) { showError("Error: resizing stack " + e); } catch (InterruptedException e) { } resizeStackUnchecked(stackId, bounds, delayMs, false); } private void runStackPositionTask() throws Exception { Loading Loading @@ -1924,7 +1932,7 @@ public class Am extends BaseCommand { maxChange = Math.min(stepSize, currentPoint - minPoint); currentPoint -= maxChange; setBoundsSide(bounds, side, currentPoint); resizeStack(DOCKED_STACK_ID, bounds, delayMs, false); resizeStack(DOCKED_STACK_ID, bounds, delayMs); } System.out.println("Growing docked stack side=" + side); Loading @@ -1932,7 +1940,7 @@ public class Am extends BaseCommand { maxChange = Math.min(stepSize, maxPoint - currentPoint); currentPoint += maxChange; setBoundsSide(bounds, side, currentPoint); resizeStack(DOCKED_STACK_ID, bounds, delayMs, false); resizeStack(DOCKED_STACK_ID, bounds, delayMs); } System.out.println("Back to Original size side=" + side); Loading @@ -1940,7 +1948,7 @@ public class Am extends BaseCommand { maxChange = Math.min(stepSize, currentPoint - startPoint); currentPoint -= maxChange; setBoundsSide(bounds, side, currentPoint); resizeStack(DOCKED_STACK_ID, bounds, delayMs, false); resizeStack(DOCKED_STACK_ID, bounds, delayMs); } } Loading core/java/android/os/ShellCommand.java +10 −0 Original line number Diff line number Diff line Loading @@ -234,6 +234,16 @@ public abstract class ShellCommand { } } public String peekNextArg() { if (mCurArgData != null) { return mCurArgData; } else if (mArgPos < mArgs.length) { return mArgs[mArgPos]; } else { return null; } } /** * Return the next argument on the command line, whatever it is; if there are * no arguments left, throws an IllegalArgumentException to report this to the user. Loading services/core/java/com/android/server/wm/BoundsAnimationController.java +20 −3 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.ValueAnimator; import android.graphics.Rect; import android.util.ArrayMap; Loading Loading @@ -50,13 +51,15 @@ public class BoundsAnimationController { private final Rect mFrom; private final Rect mTo; private final Rect mTmpRect; private final boolean mMoveToFullScreen; BoundsAnimator(AnimateBoundsUser target, Rect from, Rect to) { BoundsAnimator(AnimateBoundsUser target, Rect from, Rect to, boolean moveToFullScreen) { super(); mTarget = target; mFrom = from; mTo = to; mTmpRect = new Rect(); mMoveToFullScreen = moveToFullScreen; addUpdateListener(this); addListener(this); } Loading Loading @@ -88,6 +91,9 @@ public class BoundsAnimationController { @Override public void onAnimationEnd(Animator animation) { finishAnimation(); if (mMoveToFullScreen) { mTarget.moveToFullscreen(); } } @Override Loading Loading @@ -125,14 +131,25 @@ public class BoundsAnimationController { * necessary cleanup. */ void finishBoundsAnimation(); void moveToFullscreen(); void getFullScreenBounds(Rect bounds); } void animateBounds(final AnimateBoundsUser target, Rect from, Rect to) { boolean moveToFullscreen = false; if (to == null) { to = new Rect(); target.getFullScreenBounds(to); moveToFullscreen = true; } void animateBounds(AnimateBoundsUser target, Rect from, Rect to) { final BoundsAnimator existing = mRunningAnimations.get(target); if (existing != null) { existing.cancel(); } BoundsAnimator animator = new BoundsAnimator(target, from, to); BoundsAnimator animator = new BoundsAnimator(target, from, to, moveToFullscreen); mRunningAnimations.put(target, animator); animator.setFloatValues(0f, 1f); animator.setDuration(DEFAULT_APP_TRANSITION_DURATION); Loading services/core/java/com/android/server/wm/TaskStack.java +14 −0 Original line number Diff line number Diff line Loading @@ -927,4 +927,18 @@ public class TaskStack implements DimLayer.DimLayerUser, } } } @Override public void moveToFullscreen() { try { mService.mActivityManager.moveTasksToFullscreenStack(mStackId, true); } catch (RemoteException e) { e.printStackTrace(); } } @Override public void getFullScreenBounds(Rect bounds) { getDisplayContent().getContentRect(bounds); } } Loading
cmds/am/src/com/android/commands/am/Am.java +26 −18 Original line number Diff line number Diff line Loading @@ -1774,18 +1774,33 @@ public class Am extends BaseCommand { System.err.println("Error: invalid input bounds"); return; } resizeStack(stackId, bounds, 0, false); resizeStack(stackId, bounds, 0); } private void runStackResizeAnimated() throws Exception { String stackIdStr = nextArgRequired(); int stackId = Integer.valueOf(stackIdStr); final Rect bounds = getBounds(); final Rect bounds; if ("null".equals(mArgs.peekNextArg())) { bounds = null; } else { bounds = getBounds(); if (bounds == null) { System.err.println("Error: invalid input bounds"); return; } resizeStack(stackId, bounds, 0, true); } resizeStackUnchecked(stackId, bounds, 0, true); } private void resizeStackUnchecked(int stackId, Rect bounds, int delayMs, boolean animate) { try { mAm.resizeStack(stackId, bounds, false, false, animate); Thread.sleep(delayMs); } catch (RemoteException e) { showError("Error: resizing stack " + e); } catch (InterruptedException e) { } } private void runStackResizeDocked() throws Exception { Loading @@ -1802,20 +1817,13 @@ public class Am extends BaseCommand { } } private void resizeStack(int stackId, Rect bounds, int delayMs, boolean animate) private void resizeStack(int stackId, Rect bounds, int delayMs) throws Exception { if (bounds == null) { showError("Error: invalid input bounds"); return; } try { mAm.resizeStack(stackId, bounds, false, false, animate); Thread.sleep(delayMs); } catch (RemoteException e) { showError("Error: resizing stack " + e); } catch (InterruptedException e) { } resizeStackUnchecked(stackId, bounds, delayMs, false); } private void runStackPositionTask() throws Exception { Loading Loading @@ -1924,7 +1932,7 @@ public class Am extends BaseCommand { maxChange = Math.min(stepSize, currentPoint - minPoint); currentPoint -= maxChange; setBoundsSide(bounds, side, currentPoint); resizeStack(DOCKED_STACK_ID, bounds, delayMs, false); resizeStack(DOCKED_STACK_ID, bounds, delayMs); } System.out.println("Growing docked stack side=" + side); Loading @@ -1932,7 +1940,7 @@ public class Am extends BaseCommand { maxChange = Math.min(stepSize, maxPoint - currentPoint); currentPoint += maxChange; setBoundsSide(bounds, side, currentPoint); resizeStack(DOCKED_STACK_ID, bounds, delayMs, false); resizeStack(DOCKED_STACK_ID, bounds, delayMs); } System.out.println("Back to Original size side=" + side); Loading @@ -1940,7 +1948,7 @@ public class Am extends BaseCommand { maxChange = Math.min(stepSize, currentPoint - startPoint); currentPoint -= maxChange; setBoundsSide(bounds, side, currentPoint); resizeStack(DOCKED_STACK_ID, bounds, delayMs, false); resizeStack(DOCKED_STACK_ID, bounds, delayMs); } } Loading
core/java/android/os/ShellCommand.java +10 −0 Original line number Diff line number Diff line Loading @@ -234,6 +234,16 @@ public abstract class ShellCommand { } } public String peekNextArg() { if (mCurArgData != null) { return mCurArgData; } else if (mArgPos < mArgs.length) { return mArgs[mArgPos]; } else { return null; } } /** * Return the next argument on the command line, whatever it is; if there are * no arguments left, throws an IllegalArgumentException to report this to the user. Loading
services/core/java/com/android/server/wm/BoundsAnimationController.java +20 −3 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.ValueAnimator; import android.graphics.Rect; import android.util.ArrayMap; Loading Loading @@ -50,13 +51,15 @@ public class BoundsAnimationController { private final Rect mFrom; private final Rect mTo; private final Rect mTmpRect; private final boolean mMoveToFullScreen; BoundsAnimator(AnimateBoundsUser target, Rect from, Rect to) { BoundsAnimator(AnimateBoundsUser target, Rect from, Rect to, boolean moveToFullScreen) { super(); mTarget = target; mFrom = from; mTo = to; mTmpRect = new Rect(); mMoveToFullScreen = moveToFullScreen; addUpdateListener(this); addListener(this); } Loading Loading @@ -88,6 +91,9 @@ public class BoundsAnimationController { @Override public void onAnimationEnd(Animator animation) { finishAnimation(); if (mMoveToFullScreen) { mTarget.moveToFullscreen(); } } @Override Loading Loading @@ -125,14 +131,25 @@ public class BoundsAnimationController { * necessary cleanup. */ void finishBoundsAnimation(); void moveToFullscreen(); void getFullScreenBounds(Rect bounds); } void animateBounds(final AnimateBoundsUser target, Rect from, Rect to) { boolean moveToFullscreen = false; if (to == null) { to = new Rect(); target.getFullScreenBounds(to); moveToFullscreen = true; } void animateBounds(AnimateBoundsUser target, Rect from, Rect to) { final BoundsAnimator existing = mRunningAnimations.get(target); if (existing != null) { existing.cancel(); } BoundsAnimator animator = new BoundsAnimator(target, from, to); BoundsAnimator animator = new BoundsAnimator(target, from, to, moveToFullscreen); mRunningAnimations.put(target, animator); animator.setFloatValues(0f, 1f); animator.setDuration(DEFAULT_APP_TRANSITION_DURATION); Loading
services/core/java/com/android/server/wm/TaskStack.java +14 −0 Original line number Diff line number Diff line Loading @@ -927,4 +927,18 @@ public class TaskStack implements DimLayer.DimLayerUser, } } } @Override public void moveToFullscreen() { try { mService.mActivityManager.moveTasksToFullscreenStack(mStackId, true); } catch (RemoteException e) { e.printStackTrace(); } } @Override public void getFullScreenBounds(Rect bounds) { getDisplayContent().getContentRect(bounds); } }