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

Commit fbd63fbe authored by Tony Huang's avatar Tony Huang Committed by Automerger Merge Worker
Browse files

Merge "Ignore task view task when loadAnimation" into tm-qpr-dev am: a1c41b0d am: cefb3a41

parents 2a83f10e cefb3a41
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
@@ -257,12 +257,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
@@ -900,7 +900,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
@@ -6265,6 +6265,11 @@ class Task extends TaskFragment {
            return this;
        }

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

        private Builder setUserId(int userId) {
            mUserId = userId;
            return this;
@@ -6462,7 +6467,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