Loading core/java/android/window/ITaskFragmentOrganizerController.aidl +13 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,19 @@ interface ITaskFragmentOrganizerController { */ 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); /** * Saves the state in the system, where the state can be restored if the process of * the TaskFragmentOrganizer is restarted. Loading core/java/android/window/TaskFragmentOrganizer.java +29 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ import android.app.Activity; import android.os.Bundle; import android.os.IBinder; import android.os.RemoteException; import android.view.RemoteAnimationDefinition; import android.view.WindowManager; import com.android.window.flags.Flags; Loading Loading @@ -224,6 +225,34 @@ 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(); } } /** * Saves the state in the system, where the state can be restored if the process of * the TaskFragmentOrganizer is restarted. Loading libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/JetpackTaskFragmentOrganizer.java +23 −0 Original line number Diff line number Diff line Loading @@ -70,6 +70,10 @@ class JetpackTaskFragmentOrganizer extends TaskFragmentOrganizer { @NonNull private final TaskFragmentCallback mCallback; @VisibleForTesting @Nullable TaskFragmentAnimationController mAnimationController; /** * Callback that notifies the controller about changes to task fragments. */ Loading @@ -87,6 +91,25 @@ class JetpackTaskFragmentOrganizer extends TaskFragmentOrganizer { 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. * @param launchingFragmentToken token for the launching TaskFragment. If it exists, it will Loading libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/SplitController.java +1 −0 Original line number Diff line number Diff line Loading @@ -116,6 +116,7 @@ import java.util.function.BiConsumer; public class SplitController implements JetpackTaskFragmentOrganizer.TaskFragmentCallback, ActivityEmbeddingComponent, DividerPresenter.DragEventCallback { 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 // association. It's not set in WM Extensions nor Wm Jetpack library currently. Loading libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/SplitPresenter.java +5 −0 Original line number Diff line number Diff line Loading @@ -175,6 +175,11 @@ class SplitPresenter extends JetpackTaskFragmentOrganizer { registerOrganizer(); } mBackupHelper = new BackupHelper(controller, outSavedState); 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(); } } void scheduleBackup() { Loading Loading
core/java/android/window/ITaskFragmentOrganizerController.aidl +13 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,19 @@ interface ITaskFragmentOrganizerController { */ 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); /** * Saves the state in the system, where the state can be restored if the process of * the TaskFragmentOrganizer is restarted. Loading
core/java/android/window/TaskFragmentOrganizer.java +29 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ import android.app.Activity; import android.os.Bundle; import android.os.IBinder; import android.os.RemoteException; import android.view.RemoteAnimationDefinition; import android.view.WindowManager; import com.android.window.flags.Flags; Loading Loading @@ -224,6 +225,34 @@ 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(); } } /** * Saves the state in the system, where the state can be restored if the process of * the TaskFragmentOrganizer is restarted. Loading
libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/JetpackTaskFragmentOrganizer.java +23 −0 Original line number Diff line number Diff line Loading @@ -70,6 +70,10 @@ class JetpackTaskFragmentOrganizer extends TaskFragmentOrganizer { @NonNull private final TaskFragmentCallback mCallback; @VisibleForTesting @Nullable TaskFragmentAnimationController mAnimationController; /** * Callback that notifies the controller about changes to task fragments. */ Loading @@ -87,6 +91,25 @@ class JetpackTaskFragmentOrganizer extends TaskFragmentOrganizer { 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. * @param launchingFragmentToken token for the launching TaskFragment. If it exists, it will Loading
libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/SplitController.java +1 −0 Original line number Diff line number Diff line Loading @@ -116,6 +116,7 @@ import java.util.function.BiConsumer; public class SplitController implements JetpackTaskFragmentOrganizer.TaskFragmentCallback, ActivityEmbeddingComponent, DividerPresenter.DragEventCallback { 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 // association. It's not set in WM Extensions nor Wm Jetpack library currently. Loading
libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/SplitPresenter.java +5 −0 Original line number Diff line number Diff line Loading @@ -175,6 +175,11 @@ class SplitPresenter extends JetpackTaskFragmentOrganizer { registerOrganizer(); } mBackupHelper = new BackupHelper(controller, outSavedState); 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(); } } void scheduleBackup() { Loading