Loading core/java/android/app/ActivityOptions.java +12 −0 Original line number Diff line number Diff line Loading @@ -987,6 +987,18 @@ public class ActivityOptions { return opts; } /** * Create an {@link ActivityOptions} instance that lets the application control the entire * transition using a {@link IRemoteTransition}. * @hide */ @RequiresPermission(CONTROL_REMOTE_APP_TRANSITION_ANIMATIONS) public static ActivityOptions makeRemoteTransition(IRemoteTransition remoteTransition) { final ActivityOptions opts = new ActivityOptions(); opts.mRemoteTransition = remoteTransition; return opts; } /** @hide */ public boolean getLaunchTaskBehind() { return mAnimationType == ANIM_LAUNCH_TASK_BEHIND; Loading core/java/android/window/IRemoteTransition.aidl +2 −2 Original line number Diff line number Diff line Loading @@ -16,8 +16,8 @@ package android.window; import android.view.IRemoteAnimationFinishedCallback; import android.view.SurfaceControl; import android.window.IRemoteTransitionFinishedCallback; import android.window.TransitionInfo; /** Loading @@ -42,5 +42,5 @@ oneway interface IRemoteTransition { * `finishCallback`. */ void startAnimation(in TransitionInfo info, in SurfaceControl.Transaction t, in IRemoteAnimationFinishedCallback finishCallback); in IRemoteTransitionFinishedCallback finishCallback); } core/java/android/window/IRemoteTransitionFinishedCallback.aidl 0 → 100644 +29 −0 Original line number Diff line number Diff line /* * Copyright (C) 2020 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License */ package android.window; import android.window.WindowContainerTransaction; /** * Interface to be invoked by the controlling process when a remote transition has finished. * * @see IRemoteTransition * {@hide} */ interface IRemoteTransitionFinishedCallback { void onTransitionFinished(in WindowContainerTransaction wct); } libs/WindowManager/Shell/src/com/android/wm/shell/legacysplitscreen/SplitScreenTransitions.java +4 −3 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ public class SplitScreenTransitions implements Transitions.TransitionHandler { /** Keeps track of currently running animations */ private final ArrayList<Animator> mAnimations = new ArrayList<>(); private Runnable mFinishCallback = null; private Transitions.TransitionFinishCallback mFinishCallback = null; private SurfaceControl.Transaction mFinishTransaction; SplitScreenTransitions(@NonNull TransactionPool pool, @NonNull Transitions transitions, Loading Loading @@ -203,7 +203,8 @@ public class SplitScreenTransitions implements Transitions.TransitionHandler { @Override public boolean startAnimation(@NonNull IBinder transition, @NonNull TransitionInfo info, @NonNull SurfaceControl.Transaction t, @NonNull Runnable finishCallback) { @NonNull SurfaceControl.Transaction t, @NonNull Transitions.TransitionFinishCallback finishCallback) { if (transition != mPendingDismiss && transition != mPendingEnter) { // If we're not in split-mode, just abort if (!mSplitScreen.isDividerVisible()) return false; Loading Loading @@ -330,7 +331,7 @@ public class SplitScreenTransitions implements Transitions.TransitionHandler { mFinishTransaction.apply(); mTransactionPool.release(mFinishTransaction); mFinishTransaction = null; mFinishCallback.run(); mFinishCallback.onTransitionFinished(null /* wct */, null /* wctCB */); mFinishCallback = null; if (mAnimatingTransition == mPendingEnter) { mPendingEnter = null; Loading libs/WindowManager/Shell/src/com/android/wm/shell/transition/DefaultTransitionHandler.java +3 −2 Original line number Diff line number Diff line Loading @@ -56,7 +56,8 @@ public class DefaultTransitionHandler implements Transitions.TransitionHandler { @Override public boolean startAnimation(@NonNull IBinder transition, @NonNull TransitionInfo info, @NonNull SurfaceControl.Transaction t, @NonNull Runnable finishCallback) { @NonNull SurfaceControl.Transaction t, @NonNull Transitions.TransitionFinishCallback finishCallback) { if (mAnimations.containsKey(transition)) { throw new IllegalStateException("Got a duplicate startAnimation call for " + transition); Loading @@ -68,7 +69,7 @@ public class DefaultTransitionHandler implements Transitions.TransitionHandler { final Runnable onAnimFinish = () -> { if (!animations.isEmpty()) return; mAnimations.remove(transition); finishCallback.run(); finishCallback.onTransitionFinished(null /* wct */, null /* wctCB */); }; for (int i = info.getChanges().size() - 1; i >= 0; --i) { final TransitionInfo.Change change = info.getChanges().get(i); Loading Loading
core/java/android/app/ActivityOptions.java +12 −0 Original line number Diff line number Diff line Loading @@ -987,6 +987,18 @@ public class ActivityOptions { return opts; } /** * Create an {@link ActivityOptions} instance that lets the application control the entire * transition using a {@link IRemoteTransition}. * @hide */ @RequiresPermission(CONTROL_REMOTE_APP_TRANSITION_ANIMATIONS) public static ActivityOptions makeRemoteTransition(IRemoteTransition remoteTransition) { final ActivityOptions opts = new ActivityOptions(); opts.mRemoteTransition = remoteTransition; return opts; } /** @hide */ public boolean getLaunchTaskBehind() { return mAnimationType == ANIM_LAUNCH_TASK_BEHIND; Loading
core/java/android/window/IRemoteTransition.aidl +2 −2 Original line number Diff line number Diff line Loading @@ -16,8 +16,8 @@ package android.window; import android.view.IRemoteAnimationFinishedCallback; import android.view.SurfaceControl; import android.window.IRemoteTransitionFinishedCallback; import android.window.TransitionInfo; /** Loading @@ -42,5 +42,5 @@ oneway interface IRemoteTransition { * `finishCallback`. */ void startAnimation(in TransitionInfo info, in SurfaceControl.Transaction t, in IRemoteAnimationFinishedCallback finishCallback); in IRemoteTransitionFinishedCallback finishCallback); }
core/java/android/window/IRemoteTransitionFinishedCallback.aidl 0 → 100644 +29 −0 Original line number Diff line number Diff line /* * Copyright (C) 2020 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License */ package android.window; import android.window.WindowContainerTransaction; /** * Interface to be invoked by the controlling process when a remote transition has finished. * * @see IRemoteTransition * {@hide} */ interface IRemoteTransitionFinishedCallback { void onTransitionFinished(in WindowContainerTransaction wct); }
libs/WindowManager/Shell/src/com/android/wm/shell/legacysplitscreen/SplitScreenTransitions.java +4 −3 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ public class SplitScreenTransitions implements Transitions.TransitionHandler { /** Keeps track of currently running animations */ private final ArrayList<Animator> mAnimations = new ArrayList<>(); private Runnable mFinishCallback = null; private Transitions.TransitionFinishCallback mFinishCallback = null; private SurfaceControl.Transaction mFinishTransaction; SplitScreenTransitions(@NonNull TransactionPool pool, @NonNull Transitions transitions, Loading Loading @@ -203,7 +203,8 @@ public class SplitScreenTransitions implements Transitions.TransitionHandler { @Override public boolean startAnimation(@NonNull IBinder transition, @NonNull TransitionInfo info, @NonNull SurfaceControl.Transaction t, @NonNull Runnable finishCallback) { @NonNull SurfaceControl.Transaction t, @NonNull Transitions.TransitionFinishCallback finishCallback) { if (transition != mPendingDismiss && transition != mPendingEnter) { // If we're not in split-mode, just abort if (!mSplitScreen.isDividerVisible()) return false; Loading Loading @@ -330,7 +331,7 @@ public class SplitScreenTransitions implements Transitions.TransitionHandler { mFinishTransaction.apply(); mTransactionPool.release(mFinishTransaction); mFinishTransaction = null; mFinishCallback.run(); mFinishCallback.onTransitionFinished(null /* wct */, null /* wctCB */); mFinishCallback = null; if (mAnimatingTransition == mPendingEnter) { mPendingEnter = null; Loading
libs/WindowManager/Shell/src/com/android/wm/shell/transition/DefaultTransitionHandler.java +3 −2 Original line number Diff line number Diff line Loading @@ -56,7 +56,8 @@ public class DefaultTransitionHandler implements Transitions.TransitionHandler { @Override public boolean startAnimation(@NonNull IBinder transition, @NonNull TransitionInfo info, @NonNull SurfaceControl.Transaction t, @NonNull Runnable finishCallback) { @NonNull SurfaceControl.Transaction t, @NonNull Transitions.TransitionFinishCallback finishCallback) { if (mAnimations.containsKey(transition)) { throw new IllegalStateException("Got a duplicate startAnimation call for " + transition); Loading @@ -68,7 +69,7 @@ public class DefaultTransitionHandler implements Transitions.TransitionHandler { final Runnable onAnimFinish = () -> { if (!animations.isEmpty()) return; mAnimations.remove(transition); finishCallback.run(); finishCallback.onTransitionFinished(null /* wct */, null /* wctCB */); }; for (int i = info.getChanges().size() - 1; i >= 0; --i) { final TransitionInfo.Change change = info.getChanges().get(i); Loading