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

Commit a2fe3637 authored by Tony Huang's avatar Tony Huang
Browse files

Ignore task view task when loadAnimation

Task view task should animate itself so we should avoid load
animation in core.

Also add a new create root task api for auto to create a task
with removeWithTaskOrganizer flag to be determined as task
view task.

Bug: 263199423
Test: manual
Test: pass existing tests
Change-Id: Ib49afc71b04c66a346147d1af2207dc0dcdf5018
parent f2b5978c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -40,7 +40,8 @@ interface ITaskOrganizerController {
    void unregisterTaskOrganizer(ITaskOrganizer organizer);

    /** Creates a persistent root task in WM for a particular windowing-mode. */
    void createRootTask(int displayId, int windowingMode, IBinder launchCookie);
    void createRootTask(int displayId, int windowingMode, IBinder launchCookie,
            boolean removeWithTaskOrganizer);

    /** Deletes a persistent root task in WM */
    boolean deleteRootTask(in WindowContainerToken task);
+19 −3
Original line number Diff line number Diff line
@@ -152,17 +152,33 @@ public class TaskOrganizer extends WindowOrganizer {
     * @param windowingMode Windowing mode to put the root task in.
     * @param launchCookie Launch cookie to associate with the task so that is can be identified
     *                     when the {@link ITaskOrganizer#onTaskAppeared} callback is called.
     * @param removeWithTaskOrganizer True if this task should be removed when organizer destroyed.
     * @hide
     */
    @RequiresPermission(android.Manifest.permission.MANAGE_ACTIVITY_TASKS)
    @Nullable
    public void createRootTask(int displayId, int windowingMode, @Nullable IBinder launchCookie) {
    public void createRootTask(int displayId, int windowingMode, @Nullable IBinder launchCookie,
            boolean removeWithTaskOrganizer) {
        try {
            mTaskOrganizerController.createRootTask(displayId, windowingMode, launchCookie);
            mTaskOrganizerController.createRootTask(displayId, windowingMode, launchCookie,
                    removeWithTaskOrganizer);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    /**
     * Creates a persistent root task in WM for a particular windowing-mode.
     * @param displayId The display to create the root task on.
     * @param windowingMode Windowing mode to put the root task in.
     * @param launchCookie Launch cookie to associate with the task so that is can be identified
     *                     when the {@link ITaskOrganizer#onTaskAppeared} callback is called.
     */
    @RequiresPermission(android.Manifest.permission.MANAGE_ACTIVITY_TASKS)
    @Nullable
    public void createRootTask(int displayId, int windowingMode, @Nullable IBinder launchCookie) {
        createRootTask(displayId, windowingMode, launchCookie, false /* removeWithTaskOrganizer */);
    }

    /** Deletes a persistent root task in WM */
    @RequiresPermission(android.Manifest.permission.MANAGE_ACTIVITY_TASKS)
    public boolean deleteRootTask(@NonNull WindowContainerToken task) {
+20 −2
Original line number Diff line number Diff line
@@ -256,12 +256,30 @@ public class ShellTaskOrganizer extends TaskOrganizer implements
        }
    }

    /**
     * Creates a persistent root task in WM for a particular windowing-mode.
     * @param displayId The display to create the root task on.
     * @param windowingMode Windowing mode to put the root task in.
     * @param listener The listener to get the created task callback.
     */
    public void createRootTask(int displayId, int windowingMode, TaskListener listener) {
        createRootTask(displayId, windowingMode, listener, false /* removeWithTaskOrganizer */);
    }

    /**
     * Creates a persistent root task in WM for a particular windowing-mode.
     * @param displayId The display to create the root task on.
     * @param windowingMode Windowing mode to put the root task in.
     * @param listener The listener to get the created task callback.
     * @param removeWithTaskOrganizer True if this task should be removed when organizer destroyed.
     */
    public void createRootTask(int displayId, int windowingMode, TaskListener listener,
            boolean removeWithTaskOrganizer) {
        ProtoLog.v(WM_SHELL_TASK_ORG, "createRootTask() displayId=%d winMode=%d listener=%s" ,
                displayId, windowingMode, listener.toString());
        final IBinder cookie = new Binder();
        setPendingLaunchCookieListener(cookie, listener);
        super.createRootTask(displayId, windowingMode, cookie);
        super.createRootTask(displayId, windowingMode, cookie, removeWithTaskOrganizer);
    }

    /**
+1 −1
Original line number Diff line number Diff line
@@ -892,7 +892,7 @@ public class AppTransitionController {
     *
     * TODO(b/213312721): Remove this predicate and its callers once ShellTransition is enabled.
     */
    private static boolean isTaskViewTask(WindowContainer wc) {
    static boolean isTaskViewTask(WindowContainer wc) {
        // We use Task#mRemoveWithTaskOrganizer to identify an embedded Task, but this is a hack and
        // it is not guaranteed to work this logic in the future version.
        return wc instanceof Task && ((Task) wc).mRemoveWithTaskOrganizer;
+6 −1
Original line number Diff line number Diff line
@@ -6363,6 +6363,11 @@ class Task extends TaskFragment {
            return this;
        }

        Builder setRemoveWithTaskOrganizer(boolean removeWithTaskOrganizer) {
            mRemoveWithTaskOrganizer = removeWithTaskOrganizer;
            return this;
        }

        private Builder setUserId(int userId) {
            mUserId = userId;
            return this;
@@ -6560,7 +6565,7 @@ class Task extends TaskFragment {
            mCallingPackage = mActivityInfo.packageName;
            mResizeMode = mActivityInfo.resizeMode;
            mSupportsPictureInPicture = mActivityInfo.supportsPictureInPicture();
            if (mActivityOptions != null) {
            if (!mRemoveWithTaskOrganizer && mActivityOptions != null) {
                mRemoveWithTaskOrganizer = mActivityOptions.getRemoveWithTaskOranizer();
            }

Loading