Debian Codegraph @

core/java/android/window/ITransitionPlayer.aidl

raw
1 /*
2 * Copyright (C) 2020 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 package android.window;
18
19 import android.view.SurfaceControl;
20 import android.window.TransitionInfo;
21 import android.window.TransitionRequestInfo;
22
23 /**
24 * Implemented by WMShell to initiate and play transition animations.
25 * The flow (with {@link IWindowOrganizerController}) looks like this:
26 * <p><ol>
27 * <li>Core starts an activity and calls {@link #requestStartTransition}
28 * <li>This TransitionPlayer impl does whatever, then calls
29 * {@link IWindowOrganizerController#startTransition} to tell Core to formally start (until
30 * this happens, Core will collect changes on the transition, but won't consider it ready to
31 * animate).
32 * <li>Once all collected changes on the transition have finished drawing, Core will then call
33 * {@link #onTransitionReady} here to delegate the actual animation.
34 * <li>Once this TransitionPlayer impl finishes animating, it notifies Core via
35 * {@link IWindowOrganizerController#finishTransition}. At this point, ITransitionPlayer's
36 * responsibilities end.
37 * </ul>
38 *
39 * {@hide}
40 */
41 oneway interface ITransitionPlayer {
42
43 /**
44 * Called when all participants of a transition are ready to animate. This is in response to
45 * {@link IWindowOrganizerController#startTransition}.
46 *
47 * @param transitionToken An identifying token for the transition that is now ready to animate.
48 * @param info A collection of all the changes encapsulated by this transition.
49 * @param t A surface transaction containing the surface state prior to animating.
50 * @param finishT A surface transaction that will reset parenting/layering and generally put
51 * surfaces into their final (post-transition) state. Apply this after playing
52 * the animation but before calling finish.
53 */
54 void onTransitionReady(in IBinder transitionToken, in TransitionInfo info,
55 in SurfaceControl.Transaction t, in SurfaceControl.Transaction finishT);
56
57 /**
58 * Called when something in WMCore requires a transition to play -- for example when an Activity
59 * is started in a new Task.
60 *
61 * @param transitionToken An identifying token for the transition that needs to be started.
62 * Pass this to {@link IWindowOrganizerController#startTransition}.
63 * @param request Information about this particular request.
64 */
65 void requestStartTransition(in IBinder transitionToken, in TransitionRequestInfo request);
66 }