• 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.window.IDisplayAreaOrganizerController;
23 import android.window.ITaskOrganizerController;
24 import android.window.ITransitionPlayer;
25 import android.window.IWindowContainerTransactionCallback;
26 import android.window.WindowContainerToken;
27 import android.window.WindowContainerTransaction;
28 
29 /** @hide */
30 interface IWindowOrganizerController {
31 
32     /**
33      * Apply multiple WindowContainer operations at once.
34      * @param t The transaction to apply.
35      */
applyTransaction(in WindowContainerTransaction t)36     void applyTransaction(in WindowContainerTransaction t);
37 
38     /**
39      * Apply multiple WindowContainer operations at once.
40      * @param t The transaction to apply.
41      * @param callback This transaction will use the synchronization scheme described in
42      *        BLASTSyncEngine.java. The SurfaceControl transaction containing the effects of this
43      *        WindowContainer transaction will be passed to this callback when ready.
44      * @return An ID for the sync operation which will later be passed to transactionReady callback.
45      *         This lets the caller differentiate overlapping sync operations.
46      */
applySyncTransaction(in WindowContainerTransaction t, in IWindowContainerTransactionCallback callback)47     int applySyncTransaction(in WindowContainerTransaction t,
48             in IWindowContainerTransactionCallback callback);
49 
50     /**
51      * Starts a transition.
52      * @param type The transition type.
53      * @param transitionToken A token associated with the transition to start. If null, a new
54      *                        transition will be created of the provided type.
55      * @param t Operations that are part of the transition.
56      * @return a token representing the transition. This will just be transitionToken if it was
57      *         non-null.
58      */
startTransition(int type, in @nullable IBinder transitionToken, in @nullable WindowContainerTransaction t)59     IBinder startTransition(int type, in @nullable IBinder transitionToken,
60             in @nullable WindowContainerTransaction t);
61 
62     /**
63      * Finishes a transition. This must be called for all created transitions.
64      * @param transitionToken Which transition to finish
65      * @param t Changes to make before finishing but in the same SF Transaction. Can be null.
66      * @param callback Called when t is finished applying.
67      * @return An ID for the sync operation (see {@link #applySyncTransaction}. This will be
68      *         negative if no sync transaction was attached (null t or callback)
69      */
finishTransition(in IBinder transitionToken, in @nullable WindowContainerTransaction t, in IWindowContainerTransactionCallback callback)70     int finishTransition(in IBinder transitionToken,
71             in @nullable WindowContainerTransaction t,
72             in IWindowContainerTransactionCallback callback);
73 
74     /** @return An interface enabling the management of task organizers. */
getTaskOrganizerController()75     ITaskOrganizerController getTaskOrganizerController();
76 
77     /** @return An interface enabling the management of display area organizers. */
getDisplayAreaOrganizerController()78     IDisplayAreaOrganizerController getDisplayAreaOrganizerController();
79 
80     /**
81      * Registers a transition player with Core. There is only one of these at a time and calling
82      * this will replace the existing one if set.
83      */
registerTransitionPlayer(in ITransitionPlayer player)84     void registerTransitionPlayer(in ITransitionPlayer player);
85 }
86