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

Commit db7f8334 authored by Chris Li's avatar Chris Li
Browse files

Cleanup TaskFragment remote animation

The handling has been move to Shell for Shell transition.

Bug: 352192627
Test: cleanup only. Pass existing test.
Flag: EXEMPT cleanup after Shell transition
Change-Id: Ide2e3baf1a6be615fb3694dab289438e125404ef
parent 6eee3cab
Loading
Loading
Loading
Loading
+0 −13
Original line number Original line Diff line number Diff line
@@ -38,19 +38,6 @@ interface ITaskFragmentOrganizerController {
     */
     */
    void unregisterOrganizer(in ITaskFragmentOrganizer organizer);
    void unregisterOrganizer(in ITaskFragmentOrganizer organizer);


    /**
     * Registers remote animations per transition type for the organizer. It will override the
     * animations if the transition only contains windows that belong to the organized
     * TaskFragments in the given Task.
     */
    void registerRemoteAnimations(in ITaskFragmentOrganizer organizer,
        in RemoteAnimationDefinition definition);

    /**
     * Unregisters remote animations per transition type for the organizer.
     */
    void unregisterRemoteAnimations(in ITaskFragmentOrganizer organizer);

    /**
    /**
     * Checks if an activity organized by a {@link android.window.TaskFragmentOrganizer} and
     * Checks if an activity organized by a {@link android.window.TaskFragmentOrganizer} and
     * only occupies a portion of Task bounds.
     * only occupies a portion of Task bounds.
+0 −29
Original line number Original line Diff line number Diff line
@@ -32,7 +32,6 @@ import android.annotation.TestApi;
import android.os.Bundle;
import android.os.Bundle;
import android.os.IBinder;
import android.os.IBinder;
import android.os.RemoteException;
import android.os.RemoteException;
import android.view.RemoteAnimationDefinition;
import android.view.WindowManager;
import android.view.WindowManager;


import com.android.window.flags.Flags;
import com.android.window.flags.Flags;
@@ -204,34 +203,6 @@ public class TaskFragmentOrganizer extends WindowOrganizer {
        }
        }
    }
    }


    /**
     * Registers remote animations per transition type for the organizer. It will override the
     * animations if the transition only contains windows that belong to the organized
     * TaskFragments, and at least one of the transition window is embedded (not filling the Task).
     * @hide
     */
    @CallSuper
    public void registerRemoteAnimations(@NonNull RemoteAnimationDefinition definition) {
        try {
            getController().registerRemoteAnimations(mInterface, definition);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    /**
     * Unregisters remote animations per transition type for the organizer.
     * @hide
     */
    @CallSuper
    public void unregisterRemoteAnimations() {
        try {
            getController().unregisterRemoteAnimations(mInterface);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    /**
    /**
     * Notifies the server that the organizer has finished handling the given transaction. The
     * Notifies the server that the organizer has finished handling the given transaction. The
     * server should apply the given {@link WindowContainerTransaction} for the necessary changes.
     * server should apply the given {@link WindowContainerTransaction} for the necessary changes.
+0 −23
Original line number Original line Diff line number Diff line
@@ -70,10 +70,6 @@ class JetpackTaskFragmentOrganizer extends TaskFragmentOrganizer {
    @NonNull
    @NonNull
    private final TaskFragmentCallback mCallback;
    private final TaskFragmentCallback mCallback;


    @VisibleForTesting
    @Nullable
    TaskFragmentAnimationController mAnimationController;

    /**
    /**
     * Callback that notifies the controller about changes to task fragments.
     * Callback that notifies the controller about changes to task fragments.
     */
     */
@@ -91,25 +87,6 @@ class JetpackTaskFragmentOrganizer extends TaskFragmentOrganizer {
        mCallback = callback;
        mCallback = callback;
    }
    }


    @Override
    public void unregisterOrganizer() {
        if (mAnimationController != null) {
            mAnimationController.unregisterRemoteAnimations();
            mAnimationController = null;
        }
        super.unregisterOrganizer();
    }

    /**
     * Overrides the animation for transitions of embedded activities organized by this organizer.
     */
    void overrideSplitAnimation() {
        if (mAnimationController == null) {
            mAnimationController = new TaskFragmentAnimationController(this);
        }
        mAnimationController.registerRemoteAnimations();
    }

    /**
    /**
     * Starts a new Activity and puts it into split with an existing Activity side-by-side.
     * Starts a new Activity and puts it into split with an existing Activity side-by-side.
     * @param launchingFragmentToken    token for the launching TaskFragment. If it exists, it will
     * @param launchingFragmentToken    token for the launching TaskFragment. If it exists, it will
+0 −1
Original line number Original line Diff line number Diff line
@@ -114,7 +114,6 @@ import java.util.function.BiConsumer;
public class SplitController implements JetpackTaskFragmentOrganizer.TaskFragmentCallback,
public class SplitController implements JetpackTaskFragmentOrganizer.TaskFragmentCallback,
        ActivityEmbeddingComponent, DividerPresenter.DragEventCallback {
        ActivityEmbeddingComponent, DividerPresenter.DragEventCallback {
    static final String TAG = "SplitController";
    static final String TAG = "SplitController";
    static final boolean ENABLE_SHELL_TRANSITIONS = true;


    // TODO(b/243518738): Move to WM Extensions if we have requirement of overlay without
    // TODO(b/243518738): Move to WM Extensions if we have requirement of overlay without
    //  association. It's not set in WM Extensions nor Wm Jetpack library currently.
    //  association. It's not set in WM Extensions nor Wm Jetpack library currently.
+0 −5
Original line number Original line Diff line number Diff line
@@ -166,11 +166,6 @@ class SplitPresenter extends JetpackTaskFragmentOrganizer {
        mWindowLayoutComponent = windowLayoutComponent;
        mWindowLayoutComponent = windowLayoutComponent;
        mController = controller;
        mController = controller;
        registerOrganizer();
        registerOrganizer();
        if (!SplitController.ENABLE_SHELL_TRANSITIONS) {
            // TODO(b/207070762): cleanup with legacy app transition
            // Animation will be handled by WM Shell when Shell transition is enabled.
            overrideSplitAnimation();
        }
    }
    }


    /**
    /**
Loading