Loading cmds/am/src/com/android/commands/am/Am.java +22 −8 Original line number Diff line number Diff line Loading @@ -47,7 +47,6 @@ import android.content.pm.ResolveInfo; import android.content.pm.UserInfo; import android.content.res.Configuration; import android.graphics.Rect; import android.net.Uri; import android.os.Binder; import android.os.Build; import android.os.Bundle; Loading Loading @@ -79,7 +78,6 @@ import java.net.URISyntaxException; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.HashSet; import java.util.List; public class Am extends BaseCommand { Loading Loading @@ -159,6 +157,7 @@ public class Am extends BaseCommand { " am stack start <DISPLAY_ID> <INTENT>\n" + " am stack movetask <TASK_ID> <STACK_ID> [true|false]\n" + " am stack resize <STACK_ID> <LEFT,TOP,RIGHT,BOTTOM>\n" + " am stack resize-animated <STACK_ID> <LEFT,TOP,RIGHT,BOTTOM>\n" + " am stack resize-docked-stack <LEFT,TOP,RIGHT,BOTTOM> [<TASK_LEFT,TASK_TOP,TASK_RIGHT,TASK_BOTTOM>]\n" + " am stack size-docked-stack-test: <STEP_SIZE> <l|t|r|b> [DELAY_MS]\n" + " am stack move-top-activity-to-pinned-stack: <STACK_ID> <LEFT,TOP,RIGHT,BOTTOM>\n" + Loading Loading @@ -1688,6 +1687,9 @@ public class Am extends BaseCommand { case "resize": runStackResize(); break; case "resize-animated": runStackResizeAnimated(); break; case "resize-docked-stack": runStackResizeDocked(); break; Loading Loading @@ -1756,7 +1758,18 @@ public class Am extends BaseCommand { System.err.println("Error: invalid input bounds"); return; } resizeStack(stackId, bounds, 0); resizeStack(stackId, bounds, 0, false); } private void runStackResizeAnimated() throws Exception { String stackIdStr = nextArgRequired(); int stackId = Integer.valueOf(stackIdStr); final Rect bounds = getBounds(); if (bounds == null) { System.err.println("Error: invalid input bounds"); return; } resizeStack(stackId, bounds, 0, true); } private void runStackResizeDocked() throws Exception { Loading @@ -1773,14 +1786,15 @@ public class Am extends BaseCommand { } } private void resizeStack(int stackId, Rect bounds, int delayMs) throws Exception { private void resizeStack(int stackId, Rect bounds, int delayMs, boolean animate) throws Exception { if (bounds == null) { showError("Error: invalid input bounds"); return; } try { mAm.resizeStack(stackId, bounds, false); mAm.resizeStack(stackId, bounds, false, false, animate); Thread.sleep(delayMs); } catch (RemoteException e) { showError("Error: resizing stack " + e); Loading Loading @@ -1894,7 +1908,7 @@ public class Am extends BaseCommand { maxChange = Math.min(stepSize, currentPoint - minPoint); currentPoint -= maxChange; setBoundsSide(bounds, side, currentPoint); resizeStack(DOCKED_STACK_ID, bounds, delayMs); resizeStack(DOCKED_STACK_ID, bounds, delayMs, false); } System.out.println("Growing docked stack side=" + side); Loading @@ -1902,7 +1916,7 @@ public class Am extends BaseCommand { maxChange = Math.min(stepSize, maxPoint - currentPoint); currentPoint += maxChange; setBoundsSide(bounds, side, currentPoint); resizeStack(DOCKED_STACK_ID, bounds, delayMs); resizeStack(DOCKED_STACK_ID, bounds, delayMs, false); } System.out.println("Back to Original size side=" + side); Loading @@ -1910,7 +1924,7 @@ public class Am extends BaseCommand { maxChange = Math.min(stepSize, currentPoint - startPoint); currentPoint -= maxChange; setBoundsSide(bounds, side, currentPoint); resizeStack(DOCKED_STACK_ID, bounds, delayMs); resizeStack(DOCKED_STACK_ID, bounds, delayMs, false); } } Loading core/java/android/app/ActivityManager.java +9 −2 Original line number Diff line number Diff line Loading @@ -564,8 +564,7 @@ public class ActivityManager { * there isn't a display gap. */ public static boolean preserveWindowOnTaskMove(int stackId) { return stackId == FULLSCREEN_WORKSPACE_STACK_ID || stackId == DOCKED_STACK_ID || stackId == PINNED_STACK_ID; return stackId == FULLSCREEN_WORKSPACE_STACK_ID || stackId == DOCKED_STACK_ID; } /** Loading Loading @@ -616,6 +615,14 @@ public class ActivityManager { public static boolean keepVisibleDeadAppWindowOnScreen(int stackId) { return stackId != PINNED_STACK_ID; } /** * Returns true if the backdrop on the client side should match the frame of the window. * Returns false, if the backdrop should be fullscreen. */ public static boolean useWindowFrameForBackdrop(int stackId) { return stackId == FREEFORM_WORKSPACE_STACK_ID || stackId == PINNED_STACK_ID; } } /** Loading core/java/android/app/ActivityManagerNative.java +7 −4 Original line number Diff line number Diff line Loading @@ -816,7 +816,9 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM r = Rect.CREATOR.createFromParcel(data); } final boolean allowResizeInDockedMode = data.readInt() == 1; resizeStack(stackId, r, allowResizeInDockedMode); final boolean preserveWindows = data.readInt() == 1; final boolean animate = data.readInt() == 1; resizeStack(stackId, r, allowResizeInDockedMode, preserveWindows, animate); reply.writeNoException(); return true; } Loading Loading @@ -3815,9 +3817,8 @@ class ActivityManagerProxy implements IActivityManager return res; } @Override public void resizeStack(int stackId, Rect r, boolean allowResizeInDockedMode) throws RemoteException { public void resizeStack(int stackId, Rect r, boolean allowResizeInDockedMode, boolean preserveWindows, boolean animate) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); Loading @@ -3829,6 +3830,8 @@ class ActivityManagerProxy implements IActivityManager data.writeInt(0); } data.writeInt(allowResizeInDockedMode ? 1 : 0); data.writeInt(preserveWindows ? 1 : 0); data.writeInt(animate ? 1 : 0); mRemote.transact(RESIZE_STACK_TRANSACTION, data, reply, 0); reply.readException(); data.recycle(); Loading core/java/android/app/IActivityManager.java +2 −2 Original line number Diff line number Diff line Loading @@ -146,8 +146,8 @@ public interface IActivityManager extends IInterface { public void moveTaskToDockedStack(int taskId, int createMode, boolean toTop, boolean animate, Rect initialBounds) throws RemoteException; public boolean moveTopActivityToPinnedStack(int stackId, Rect bounds) throws RemoteException; public void resizeStack(int stackId, Rect bounds, boolean allowResizeInDockedMode) throws RemoteException; public void resizeStack(int stackId, Rect bounds, boolean allowResizeInDockedMode, boolean preserveWindows, boolean animate) throws RemoteException; /** * Resizes the docked stack, and all other stacks as the result of the dock stack bounds change. Loading packages/SystemUI/src/com/android/systemui/stackdivider/WindowManagerProxy.java +2 −1 Original line number Diff line number Diff line Loading @@ -97,7 +97,8 @@ public class WindowManagerProxy { @Override public void run() { try { ActivityManagerNative.getDefault().resizeStack(DOCKED_STACK_ID, null, true); ActivityManagerNative.getDefault().resizeStack(DOCKED_STACK_ID, null, true, false, false); } catch (RemoteException e) { Log.w(TAG, "Failed to resize stack: " + e); } Loading Loading
cmds/am/src/com/android/commands/am/Am.java +22 −8 Original line number Diff line number Diff line Loading @@ -47,7 +47,6 @@ import android.content.pm.ResolveInfo; import android.content.pm.UserInfo; import android.content.res.Configuration; import android.graphics.Rect; import android.net.Uri; import android.os.Binder; import android.os.Build; import android.os.Bundle; Loading Loading @@ -79,7 +78,6 @@ import java.net.URISyntaxException; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.HashSet; import java.util.List; public class Am extends BaseCommand { Loading Loading @@ -159,6 +157,7 @@ public class Am extends BaseCommand { " am stack start <DISPLAY_ID> <INTENT>\n" + " am stack movetask <TASK_ID> <STACK_ID> [true|false]\n" + " am stack resize <STACK_ID> <LEFT,TOP,RIGHT,BOTTOM>\n" + " am stack resize-animated <STACK_ID> <LEFT,TOP,RIGHT,BOTTOM>\n" + " am stack resize-docked-stack <LEFT,TOP,RIGHT,BOTTOM> [<TASK_LEFT,TASK_TOP,TASK_RIGHT,TASK_BOTTOM>]\n" + " am stack size-docked-stack-test: <STEP_SIZE> <l|t|r|b> [DELAY_MS]\n" + " am stack move-top-activity-to-pinned-stack: <STACK_ID> <LEFT,TOP,RIGHT,BOTTOM>\n" + Loading Loading @@ -1688,6 +1687,9 @@ public class Am extends BaseCommand { case "resize": runStackResize(); break; case "resize-animated": runStackResizeAnimated(); break; case "resize-docked-stack": runStackResizeDocked(); break; Loading Loading @@ -1756,7 +1758,18 @@ public class Am extends BaseCommand { System.err.println("Error: invalid input bounds"); return; } resizeStack(stackId, bounds, 0); resizeStack(stackId, bounds, 0, false); } private void runStackResizeAnimated() throws Exception { String stackIdStr = nextArgRequired(); int stackId = Integer.valueOf(stackIdStr); final Rect bounds = getBounds(); if (bounds == null) { System.err.println("Error: invalid input bounds"); return; } resizeStack(stackId, bounds, 0, true); } private void runStackResizeDocked() throws Exception { Loading @@ -1773,14 +1786,15 @@ public class Am extends BaseCommand { } } private void resizeStack(int stackId, Rect bounds, int delayMs) throws Exception { private void resizeStack(int stackId, Rect bounds, int delayMs, boolean animate) throws Exception { if (bounds == null) { showError("Error: invalid input bounds"); return; } try { mAm.resizeStack(stackId, bounds, false); mAm.resizeStack(stackId, bounds, false, false, animate); Thread.sleep(delayMs); } catch (RemoteException e) { showError("Error: resizing stack " + e); Loading Loading @@ -1894,7 +1908,7 @@ public class Am extends BaseCommand { maxChange = Math.min(stepSize, currentPoint - minPoint); currentPoint -= maxChange; setBoundsSide(bounds, side, currentPoint); resizeStack(DOCKED_STACK_ID, bounds, delayMs); resizeStack(DOCKED_STACK_ID, bounds, delayMs, false); } System.out.println("Growing docked stack side=" + side); Loading @@ -1902,7 +1916,7 @@ public class Am extends BaseCommand { maxChange = Math.min(stepSize, maxPoint - currentPoint); currentPoint += maxChange; setBoundsSide(bounds, side, currentPoint); resizeStack(DOCKED_STACK_ID, bounds, delayMs); resizeStack(DOCKED_STACK_ID, bounds, delayMs, false); } System.out.println("Back to Original size side=" + side); Loading @@ -1910,7 +1924,7 @@ public class Am extends BaseCommand { maxChange = Math.min(stepSize, currentPoint - startPoint); currentPoint -= maxChange; setBoundsSide(bounds, side, currentPoint); resizeStack(DOCKED_STACK_ID, bounds, delayMs); resizeStack(DOCKED_STACK_ID, bounds, delayMs, false); } } Loading
core/java/android/app/ActivityManager.java +9 −2 Original line number Diff line number Diff line Loading @@ -564,8 +564,7 @@ public class ActivityManager { * there isn't a display gap. */ public static boolean preserveWindowOnTaskMove(int stackId) { return stackId == FULLSCREEN_WORKSPACE_STACK_ID || stackId == DOCKED_STACK_ID || stackId == PINNED_STACK_ID; return stackId == FULLSCREEN_WORKSPACE_STACK_ID || stackId == DOCKED_STACK_ID; } /** Loading Loading @@ -616,6 +615,14 @@ public class ActivityManager { public static boolean keepVisibleDeadAppWindowOnScreen(int stackId) { return stackId != PINNED_STACK_ID; } /** * Returns true if the backdrop on the client side should match the frame of the window. * Returns false, if the backdrop should be fullscreen. */ public static boolean useWindowFrameForBackdrop(int stackId) { return stackId == FREEFORM_WORKSPACE_STACK_ID || stackId == PINNED_STACK_ID; } } /** Loading
core/java/android/app/ActivityManagerNative.java +7 −4 Original line number Diff line number Diff line Loading @@ -816,7 +816,9 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM r = Rect.CREATOR.createFromParcel(data); } final boolean allowResizeInDockedMode = data.readInt() == 1; resizeStack(stackId, r, allowResizeInDockedMode); final boolean preserveWindows = data.readInt() == 1; final boolean animate = data.readInt() == 1; resizeStack(stackId, r, allowResizeInDockedMode, preserveWindows, animate); reply.writeNoException(); return true; } Loading Loading @@ -3815,9 +3817,8 @@ class ActivityManagerProxy implements IActivityManager return res; } @Override public void resizeStack(int stackId, Rect r, boolean allowResizeInDockedMode) throws RemoteException { public void resizeStack(int stackId, Rect r, boolean allowResizeInDockedMode, boolean preserveWindows, boolean animate) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); Loading @@ -3829,6 +3830,8 @@ class ActivityManagerProxy implements IActivityManager data.writeInt(0); } data.writeInt(allowResizeInDockedMode ? 1 : 0); data.writeInt(preserveWindows ? 1 : 0); data.writeInt(animate ? 1 : 0); mRemote.transact(RESIZE_STACK_TRANSACTION, data, reply, 0); reply.readException(); data.recycle(); Loading
core/java/android/app/IActivityManager.java +2 −2 Original line number Diff line number Diff line Loading @@ -146,8 +146,8 @@ public interface IActivityManager extends IInterface { public void moveTaskToDockedStack(int taskId, int createMode, boolean toTop, boolean animate, Rect initialBounds) throws RemoteException; public boolean moveTopActivityToPinnedStack(int stackId, Rect bounds) throws RemoteException; public void resizeStack(int stackId, Rect bounds, boolean allowResizeInDockedMode) throws RemoteException; public void resizeStack(int stackId, Rect bounds, boolean allowResizeInDockedMode, boolean preserveWindows, boolean animate) throws RemoteException; /** * Resizes the docked stack, and all other stacks as the result of the dock stack bounds change. Loading
packages/SystemUI/src/com/android/systemui/stackdivider/WindowManagerProxy.java +2 −1 Original line number Diff line number Diff line Loading @@ -97,7 +97,8 @@ public class WindowManagerProxy { @Override public void run() { try { ActivityManagerNative.getDefault().resizeStack(DOCKED_STACK_ID, null, true); ActivityManagerNative.getDefault().resizeStack(DOCKED_STACK_ID, null, true, false, false); } catch (RemoteException e) { Log.w(TAG, "Failed to resize stack: " + e); } Loading