• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.Bundle;
20 import android.os.IBinder;
21 import android.view.RemoteAnimationDefinition;
22 import android.window.ITaskFragmentOrganizer;
23 import android.window.RemoteTransition;
24 import android.window.WindowContainerTransaction;
25 
26 /** @hide */
27 interface ITaskFragmentOrganizerController {
28     /**
29      * Registers a TaskFragmentOrganizer to manage TaskFragments. Registering a system
30      * organizer requires MANAGE_ACTIVITY_TASKS permission, and the organizer will have additional
31      * system capabilities.
32      *
33      * @param organizer          The TaskFragmentOrganizer to register
34      * @param isSystemOrganizer  If it is a system organizer
35      * @param outSavedState      Returning the saved state (if any) that previously saved. This is
36      *                           useful when retrieve the state from the same TaskFragmentOrganizer
37      *                           that was killed by the system (e.g. to reclaim memory). Note that
38      *                           the save state is dropped and unable to retrieve once the system
39      *                           restarts or the organizer is unregistered.
40      */
41     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(value=android.Manifest.permission.MANAGE_ACTIVITY_TASKS, conditional=true)")
registerOrganizer(in ITaskFragmentOrganizer organizer, in boolean isSystemOrganizer, out Bundle outSavedState)42     void registerOrganizer(in ITaskFragmentOrganizer organizer, in boolean isSystemOrganizer, out Bundle outSavedState);
43 
44     /**
45      * Unregisters a previously registered TaskFragmentOrganizer.
46      */
unregisterOrganizer(in ITaskFragmentOrganizer organizer)47     void unregisterOrganizer(in ITaskFragmentOrganizer organizer);
48 
49     /**
50      * Registers remote animations per transition type for the organizer. It will override the
51      * animations if the transition only contains windows that belong to the organized
52      * TaskFragments in the given Task.
53      */
registerRemoteAnimations(in ITaskFragmentOrganizer organizer, in RemoteAnimationDefinition definition)54     void registerRemoteAnimations(in ITaskFragmentOrganizer organizer,
55         in RemoteAnimationDefinition definition);
56 
57     /**
58      * Unregisters remote animations per transition type for the organizer.
59      */
unregisterRemoteAnimations(in ITaskFragmentOrganizer organizer)60     void unregisterRemoteAnimations(in ITaskFragmentOrganizer organizer);
61 
62     /**
63      * Saves the state in the system, where the state can be restored if the process of
64      * the TaskFragmentOrganizer is restarted.
65      */
setSavedState(in ITaskFragmentOrganizer organizer, in Bundle savedState)66     void setSavedState(in ITaskFragmentOrganizer organizer, in Bundle savedState);
67 
68     /**
69      * Notifies the server that the organizer has finished handling the given transaction. The
70      * server should apply the given {@link WindowContainerTransaction} for the necessary changes.
71      */
onTransactionHandled(in IBinder transactionToken, in WindowContainerTransaction wct, int transitionType, boolean shouldApplyIndependently)72     void onTransactionHandled(in IBinder transactionToken, in WindowContainerTransaction wct,
73         int transitionType, boolean shouldApplyIndependently);
74 
75     /**
76      * Requests the server to apply the given {@link WindowContainerTransaction}.
77      *
78      * {@link RemoteTransition} can only be used by a system organizer and
79      * {@code shouldApplyIndependently} must be {@code true}. See {@link registerOrganizer}.
80      */
applyTransaction(in WindowContainerTransaction wct, int transitionType, boolean shouldApplyIndependently, in RemoteTransition remoteTransition)81     void applyTransaction(in WindowContainerTransaction wct, int transitionType,
82         boolean shouldApplyIndependently, in RemoteTransition remoteTransition);
83 }
84