1 /*
2  * Copyright (C) 2018 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.view;
18 
19 import android.app.ActivityManager;
20 import android.view.IRemoteAnimationFinishedCallback;
21 import android.graphics.GraphicBuffer;
22 
23 /**
24  * Passed to the {@link IRecentsAnimationRunner} in order for the runner to control to let the
25  * runner control certain aspects of the recents animation, and to notify window manager when the
26  * animation has completed.
27  *
28  * {@hide}
29  */
30 interface IRecentsAnimationController {
31 
32     /**
33      * Takes a screenshot of the task associated with the given {@param taskId}. Only valid for the
34      * current set of task ids provided to the handler.
35      */
screenshotTask(int taskId)36     ActivityManager.TaskSnapshot screenshotTask(int taskId);
37 
38     /**
39      * Notifies to the system that the animation into Recents should end, and all leashes associated
40      * with remote animation targets should be relinquished. If {@param moveHomeToTop} is true, then
41      * the home activity should be moved to the top. Otherwise, the home activity is hidden and the
42      * user is returned to the app.
43      */
finish(boolean moveHomeToTop)44     void finish(boolean moveHomeToTop);
45 
46     /**
47      * Called by the handler to indicate that the recents animation input consumer should be
48      * enabled. This is currently used to work around an issue where registering an input consumer
49      * mid-animation causes the existing motion event chain to be canceled. Instead, the caller
50      * may register the recents animation input consumer prior to starting the recents animation
51      * and then enable it mid-animation to start receiving touch events.
52      */
setInputConsumerEnabled(boolean enabled)53     void setInputConsumerEnabled(boolean enabled);
54 
55     /**
56     * Informs the system whether the animation targets passed into
57     * IRecentsAnimationRunner.onAnimationStart are currently behind the system bars. If they are,
58     * they can control the SystemUI flags, otherwise the SystemUI flags from home activity will be
59     * taken.
60     */
setAnimationTargetsBehindSystemBars(boolean behindSystemBars)61     void setAnimationTargetsBehindSystemBars(boolean behindSystemBars);
62 
63     /**
64      * Informs the system that the primary split-screen stack should be minimized.
65      */
setSplitScreenMinimized(boolean minimized)66     void setSplitScreenMinimized(boolean minimized);
67 
68     /**
69      * Hides the current input method if one is showing.
70      */
hideCurrentInputMethod()71     void hideCurrentInputMethod();
72 }
73