1 /**
2  * Copyright (c) 2021 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.os.IBinder;
20 import android.view.RemoteAnimationDefinition;
21 import android.window.ITaskFragmentOrganizer;
22 import android.window.WindowContainerTransaction;
23 
24 /** @hide */
25 interface ITaskFragmentOrganizerController {
26 
27     /**
28      * Registers a TaskFragmentOrganizer to manage TaskFragments.
29      */
registerOrganizer(in ITaskFragmentOrganizer organizer)30     void registerOrganizer(in ITaskFragmentOrganizer organizer);
31 
32     /**
33      * Unregisters a previously registered TaskFragmentOrganizer.
34      */
unregisterOrganizer(in ITaskFragmentOrganizer organizer)35     void unregisterOrganizer(in ITaskFragmentOrganizer organizer);
36 
37     /**
38      * Registers remote animations per transition type for the organizer. It will override the
39      * animations if the transition only contains windows that belong to the organized
40      * TaskFragments in the given Task.
41      */
registerRemoteAnimations(in ITaskFragmentOrganizer organizer, in RemoteAnimationDefinition definition)42     void registerRemoteAnimations(in ITaskFragmentOrganizer organizer,
43         in RemoteAnimationDefinition definition);
44 
45     /**
46      * Unregisters remote animations per transition type for the organizer.
47      */
unregisterRemoteAnimations(in ITaskFragmentOrganizer organizer)48     void unregisterRemoteAnimations(in ITaskFragmentOrganizer organizer);
49 
50     /**
51      * Checks if an activity organized by a {@link android.window.TaskFragmentOrganizer} and
52      * only occupies a portion of Task bounds.
53      */
isActivityEmbedded(in IBinder activityToken)54     boolean isActivityEmbedded(in IBinder activityToken);
55 
56     /**
57      * Notifies the server that the organizer has finished handling the given transaction. The
58      * server should apply the given {@link WindowContainerTransaction} for the necessary changes.
59      */
onTransactionHandled(in IBinder transactionToken, in WindowContainerTransaction wct, int transitionType, boolean shouldApplyIndependently)60     void onTransactionHandled(in IBinder transactionToken, in WindowContainerTransaction wct,
61         int transitionType, boolean shouldApplyIndependently);
62 
63     /**
64      * Requests the server to apply the given {@link WindowContainerTransaction}.
65      */
applyTransaction(in WindowContainerTransaction wct, int transitionType, boolean shouldApplyIndependently)66     void applyTransaction(in WindowContainerTransaction wct, int transitionType,
67         boolean shouldApplyIndependently);
68 }
69