Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 53acaf6c authored by Louis Chang's avatar Louis Chang Committed by Android (Google) Code Review
Browse files

Merge "Allow Reordering of Tasks on Specific Displays" into main

parents 3acbfc73 017993c6
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -403,4 +403,14 @@ interface IActivityTaskManager {
     * @hide
     */
    void unregisterScreenCaptureObserver(IBinder activityToken, IScreenCaptureObserver observer);

    /**
    * Move the task to the top/ bottom of the activity stack of specific display
    *
    * @param taskId Id of the task that has to be moved
    * @param displayId Id of the display to which it has to be moved
    * @param onTop defines the task has to be moved on top or bottom of the stack
    * @hide
    */
    void moveRootTaskToDisplayOnTopOrBottom(int taskId, int displayId, boolean onTop);
}
+16 −0
Original line number Diff line number Diff line
@@ -3175,6 +3175,22 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
        }
    }

    @Override
    public void moveRootTaskToDisplayOnTopOrBottom(int taskId, int displayId, boolean onTop) {
        mAmInternal.enforceCallingPermission(INTERNAL_SYSTEM_WINDOW,
                "moveRootTaskToDisplayOnTopOrBottom()");
        synchronized (mGlobalLock) {
            final long ident = Binder.clearCallingIdentity();
            try {
                ProtoLog.d(WM_DEBUG_TASKS, "moveRootTaskToDisplayOnTopOrBottom: " +
                        "moving taskId=%d to displayId=%d, onTop=%b", taskId, displayId, onTop);
                mRootWindowContainer.moveRootTaskToDisplay(taskId, displayId, onTop);
            } finally {
                Binder.restoreCallingIdentity(ident);
            }
        }
    }

    /** Sets the task stack listener that gets callbacks when a task stack changes. */
    @Override
    public void registerTaskStackListener(ITaskStackListener listener) {