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.RemoteTransition; 23 import android.window.WindowContainerTransaction; 24 25 /** @hide */ 26 interface ITaskFragmentOrganizerController { 27 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 @JavaPassthrough(annotation="@android.annotation.RequiresPermission(value=android.Manifest.permission.MANAGE_ACTIVITY_TASKS, conditional=true)") registerOrganizer(in ITaskFragmentOrganizer organizer, in boolean isSystemOrganizer)34 void registerOrganizer(in ITaskFragmentOrganizer organizer, in boolean isSystemOrganizer); 35 36 /** 37 * Unregisters a previously registered TaskFragmentOrganizer. 38 */ unregisterOrganizer(in ITaskFragmentOrganizer organizer)39 void unregisterOrganizer(in ITaskFragmentOrganizer organizer); 40 41 /** 42 * Registers remote animations per transition type for the organizer. It will override the 43 * animations if the transition only contains windows that belong to the organized 44 * TaskFragments in the given Task. 45 */ registerRemoteAnimations(in ITaskFragmentOrganizer organizer, in RemoteAnimationDefinition definition)46 void registerRemoteAnimations(in ITaskFragmentOrganizer organizer, 47 in RemoteAnimationDefinition definition); 48 49 /** 50 * Unregisters remote animations per transition type for the organizer. 51 */ unregisterRemoteAnimations(in ITaskFragmentOrganizer organizer)52 void unregisterRemoteAnimations(in ITaskFragmentOrganizer organizer); 53 54 /** 55 * Checks if an activity organized by a {@link android.window.TaskFragmentOrganizer} and 56 * only occupies a portion of Task bounds. 57 */ isActivityEmbedded(in IBinder activityToken)58 boolean isActivityEmbedded(in IBinder activityToken); 59 60 /** 61 * Notifies the server that the organizer has finished handling the given transaction. The 62 * server should apply the given {@link WindowContainerTransaction} for the necessary changes. 63 */ onTransactionHandled(in IBinder transactionToken, in WindowContainerTransaction wct, int transitionType, boolean shouldApplyIndependently)64 void onTransactionHandled(in IBinder transactionToken, in WindowContainerTransaction wct, 65 int transitionType, boolean shouldApplyIndependently); 66 67 /** 68 * Requests the server to apply the given {@link WindowContainerTransaction}. 69 * 70 * {@link RemoteTransition} can only be used by a system organizer and 71 * {@code shouldApplyIndependently} must be {@code true}. See {@link registerOrganizer}. 72 */ applyTransaction(in WindowContainerTransaction wct, int transitionType, boolean shouldApplyIndependently, in RemoteTransition remoteTransition)73 void applyTransaction(in WindowContainerTransaction wct, int transitionType, 74 boolean shouldApplyIndependently, in RemoteTransition remoteTransition); 75 } 76