| 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 |
*/ |
| 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 |
*/ |
| 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 |
*/ |
| 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 |
*/ |
| 66 |
oneway void startTransition(IBinder transitionToken, in @nullable WindowContainerTransaction t); |
| 67 |
|
| 68 |
/** |
| 69 |
* Starts a legacy transition. |
| 70 |
* @param type The transition type. |
| 71 |
* @param adapter The animation to use. |
| 72 |
* @param syncCallback A sync callback for the contents of `t` |
| 73 |
* @param t Operations that are part of the transition. |
| 74 |
* @return sync-id or -1 if this no-op'd because a transition is already running. |
| 75 |
*/ |
| 76 |
int startLegacyTransition(int type, in RemoteAnimationAdapter adapter, |
| 77 |
in IWindowContainerTransactionCallback syncCallback, in WindowContainerTransaction t); |
| 78 |
|
| 79 |
/** |
| 80 |
* Finishes a transition. This must be called for all created transitions. |
| 81 |
* @param transitionToken Which transition to finish |
| 82 |
* @param t Changes to make before finishing but in the same SF Transaction. Can be null. |
| 83 |
* @param callback Called when t is finished applying. |
| 84 |
* @return An ID for the sync operation (see {@link #applySyncTransaction}. This will be |
| 85 |
* negative if no sync transaction was attached (null t or callback) |
| 86 |
*/ |
| 87 |
int finishTransition(in IBinder transitionToken, |
| 88 |
in @nullable WindowContainerTransaction t, |
| 89 |
in IWindowContainerTransactionCallback callback); |
| 90 |
|
| 91 |
/** @return An interface enabling the management of task organizers. */ |
| 92 |
ITaskOrganizerController getTaskOrganizerController(); |
| 93 |
|
| 94 |
/** @return An interface enabling the management of display area organizers. */ |
| 95 |
IDisplayAreaOrganizerController getDisplayAreaOrganizerController(); |
| 96 |
|
| 97 |
/** @return An interface enabling the management of task fragment organizers. */ |
| 98 |
ITaskFragmentOrganizerController getTaskFragmentOrganizerController(); |
| 99 |
|
| 100 |
/** |
| 101 |
* Registers a transition player with Core. There is only one of these at a time and calling |
| 102 |
* this will replace the existing one if set. |
| 103 |
*/ |
| 104 |
void registerTransitionPlayer(in ITransitionPlayer player); |
| 105 |
|
| 106 |
/** @return An interface enabling the transition players to report its metrics. */ |
| 107 |
ITransitionMetricsReporter getTransitionMetricsReporter(); |
| 108 |
} |