• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
21 import android.os.IBinder;
22 import android.view.RemoteAnimationAdapter;
23 import android.window.IDisplayAreaOrganizerController;
24 import android.window.ITaskFragmentOrganizerController;
25 import android.window.ITaskOrganizerController;
26 import android.window.ITransitionMetricsReporter;
27 import android.window.ITransitionPlayer;
28 import android.window.IWindowContainerTransactionCallback;
29 import android.window.WindowContainerToken;
30 import android.window.WindowContainerTransaction;
31 
32 /** @hide */
33 interface IWindowOrganizerController {
34 
35     /**
36      * Apply multiple WindowContainer operations at once.
37      * @param t The transaction to apply.
38      */
applyTransaction(in WindowContainerTransaction t)39     void applyTransaction(in WindowContainerTransaction t);
40 
41     /**
42      * Apply multiple WindowContainer operations at once.
43      * @param t The transaction to apply.
44      * @param callback This transaction will use the synchronization scheme described in
45      *        BLASTSyncEngine.java. The SurfaceControl transaction containing the effects of this
46      *        WindowContainer transaction will be passed to this callback when ready.
47      * @return An ID for the sync operation which will later be passed to transactionReady callback.
48      *         This lets the caller differentiate overlapping sync operations.
49      */
applySyncTransaction(in WindowContainerTransaction t, in IWindowContainerTransactionCallback callback)50     int applySyncTransaction(in WindowContainerTransaction t,
51             in IWindowContainerTransactionCallback callback);
52 
53     /**
54      * Starts a new transition.
55      * @param type The transition type.
56      * @param t Operations that are part of the transition.
57      * @return a token representing the transition.
58      */
startNewTransition(int type, in @nullable WindowContainerTransaction t)59     IBinder startNewTransition(int type, in @nullable WindowContainerTransaction t);
60 
61     /**
62      * Starts the given transition.
63      * @param transitionToken A token associated with the transition to start.
64      * @param t Operations that are part of the transition.
65      */
startTransition(IBinder transitionToken, in @nullable WindowContainerTransaction t)66     void startTransition(IBinder transitionToken, in @nullable WindowContainerTransaction t);
67 
68     /**
69      * Finishes a transition. This must be called for all created transitions.
70      * @param transitionToken Which transition to finish
71      * @param t Changes to make before finishing but in the same SF Transaction. Can be null.
72      */
finishTransition(in IBinder transitionToken, in @nullable WindowContainerTransaction t)73     void finishTransition(in IBinder transitionToken, in @nullable WindowContainerTransaction t);
74 
75     /** @return An interface enabling the management of task organizers. */
getTaskOrganizerController()76     ITaskOrganizerController getTaskOrganizerController();
77 
78     /** @return An interface enabling the management of display area organizers. */
getDisplayAreaOrganizerController()79     IDisplayAreaOrganizerController getDisplayAreaOrganizerController();
80 
81     /** @return An interface enabling the management of task fragment organizers. */
getTaskFragmentOrganizerController()82     ITaskFragmentOrganizerController getTaskFragmentOrganizerController();
83 
84     /**
85      * Registers a transition player with Core. There is only one of these active at a time so
86      * calling this will replace the existing one (if set) until it is unregistered.
87      */
registerTransitionPlayer(in ITransitionPlayer player)88     void registerTransitionPlayer(in ITransitionPlayer player);
89 
90     /**
91      * Un-registers a transition player from Core. This will restore whichever player was active
92      * prior to registering this one.
93      */
unregisterTransitionPlayer(in ITransitionPlayer player)94     void unregisterTransitionPlayer(in ITransitionPlayer player);
95 
96     /** @return An interface enabling the transition players to report its metrics. */
getTransitionMetricsReporter()97     ITransitionMetricsReporter getTransitionMetricsReporter();
98 
99     /** @return The transaction queue token used by WM. */
getApplyToken()100     IBinder getApplyToken();
101 }
102