1e2d721781fc024cbd9a14929741e5b476242291fWinson Chung/*
2e2d721781fc024cbd9a14929741e5b476242291fWinson Chung * Copyright (C) 2018 The Android Open Source Project
3e2d721781fc024cbd9a14929741e5b476242291fWinson Chung *
4e2d721781fc024cbd9a14929741e5b476242291fWinson Chung * Licensed under the Apache License, Version 2.0 (the "License");
5e2d721781fc024cbd9a14929741e5b476242291fWinson Chung * you may not use this file except in compliance with the License.
6e2d721781fc024cbd9a14929741e5b476242291fWinson Chung * You may obtain a copy of the License at
7e2d721781fc024cbd9a14929741e5b476242291fWinson Chung *
8e2d721781fc024cbd9a14929741e5b476242291fWinson Chung *      http://www.apache.org/licenses/LICENSE-2.0
9e2d721781fc024cbd9a14929741e5b476242291fWinson Chung *
10e2d721781fc024cbd9a14929741e5b476242291fWinson Chung * Unless required by applicable law or agreed to in writing, software
11e2d721781fc024cbd9a14929741e5b476242291fWinson Chung * distributed under the License is distributed on an "AS IS" BASIS,
12e2d721781fc024cbd9a14929741e5b476242291fWinson Chung * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13e2d721781fc024cbd9a14929741e5b476242291fWinson Chung * See the License for the specific language governing permissions and
14e2d721781fc024cbd9a14929741e5b476242291fWinson Chung * limitations under the License.
15e2d721781fc024cbd9a14929741e5b476242291fWinson Chung */
16e2d721781fc024cbd9a14929741e5b476242291fWinson Chung
17e2d721781fc024cbd9a14929741e5b476242291fWinson Chungpackage android.view;
18e2d721781fc024cbd9a14929741e5b476242291fWinson Chung
19e2d721781fc024cbd9a14929741e5b476242291fWinson Chungimport android.app.ActivityManager;
20e2d721781fc024cbd9a14929741e5b476242291fWinson Chungimport android.view.IRemoteAnimationFinishedCallback;
21e2d721781fc024cbd9a14929741e5b476242291fWinson Chungimport android.graphics.GraphicBuffer;
22e2d721781fc024cbd9a14929741e5b476242291fWinson Chung
23e2d721781fc024cbd9a14929741e5b476242291fWinson Chung/**
24e2d721781fc024cbd9a14929741e5b476242291fWinson Chung * Passed to the {@link IRecentsAnimationRunner} in order for the runner to control to let the
25e2d721781fc024cbd9a14929741e5b476242291fWinson Chung * runner control certain aspects of the recents animation, and to notify window manager when the
26e2d721781fc024cbd9a14929741e5b476242291fWinson Chung * animation has completed.
27e2d721781fc024cbd9a14929741e5b476242291fWinson Chung *
28e2d721781fc024cbd9a14929741e5b476242291fWinson Chung * {@hide}
29e2d721781fc024cbd9a14929741e5b476242291fWinson Chung */
30e2d721781fc024cbd9a14929741e5b476242291fWinson Chunginterface IRecentsAnimationController {
31e2d721781fc024cbd9a14929741e5b476242291fWinson Chung
32e2d721781fc024cbd9a14929741e5b476242291fWinson Chung    /**
33e2d721781fc024cbd9a14929741e5b476242291fWinson Chung     * Takes a screenshot of the task associated with the given {@param taskId}. Only valid for the
34e2d721781fc024cbd9a14929741e5b476242291fWinson Chung     * current set of task ids provided to the handler.
35e2d721781fc024cbd9a14929741e5b476242291fWinson Chung     */
36e2d721781fc024cbd9a14929741e5b476242291fWinson Chung    ActivityManager.TaskSnapshot screenshotTask(int taskId);
37e2d721781fc024cbd9a14929741e5b476242291fWinson Chung
38e2d721781fc024cbd9a14929741e5b476242291fWinson Chung    /**
39e2d721781fc024cbd9a14929741e5b476242291fWinson Chung     * Notifies to the system that the animation into Recents should end, and all leashes associated
40e2d721781fc024cbd9a14929741e5b476242291fWinson Chung     * with remote animation targets should be relinquished. If {@param moveHomeToTop} is true, then
41e2d721781fc024cbd9a14929741e5b476242291fWinson Chung     * the home activity should be moved to the top. Otherwise, the home activity is hidden and the
42e2d721781fc024cbd9a14929741e5b476242291fWinson Chung     * user is returned to the app.
43e2d721781fc024cbd9a14929741e5b476242291fWinson Chung     */
44e2d721781fc024cbd9a14929741e5b476242291fWinson Chung    void finish(boolean moveHomeToTop);
45e2d721781fc024cbd9a14929741e5b476242291fWinson Chung
46e2d721781fc024cbd9a14929741e5b476242291fWinson Chung    /**
47e2d721781fc024cbd9a14929741e5b476242291fWinson Chung     * Called by the handler to indicate that the recents animation input consumer should be
48e2d721781fc024cbd9a14929741e5b476242291fWinson Chung     * enabled. This is currently used to work around an issue where registering an input consumer
49e2d721781fc024cbd9a14929741e5b476242291fWinson Chung     * mid-animation causes the existing motion event chain to be canceled. Instead, the caller
50e2d721781fc024cbd9a14929741e5b476242291fWinson Chung     * may register the recents animation input consumer prior to starting the recents animation
51e2d721781fc024cbd9a14929741e5b476242291fWinson Chung     * and then enable it mid-animation to start receiving touch events.
52e2d721781fc024cbd9a14929741e5b476242291fWinson Chung     */
53e2d721781fc024cbd9a14929741e5b476242291fWinson Chung    void setInputConsumerEnabled(boolean enabled);
5450bf59ca0d86d159c8338d4300d9bc0e74c24bfcJorim Jaggi
5550bf59ca0d86d159c8338d4300d9bc0e74c24bfcJorim Jaggi    /**
5650bf59ca0d86d159c8338d4300d9bc0e74c24bfcJorim Jaggi    * Informs the system whether the animation targets passed into
5750bf59ca0d86d159c8338d4300d9bc0e74c24bfcJorim Jaggi    * IRecentsAnimationRunner.onAnimationStart are currently behind the system bars. If they are,
5850bf59ca0d86d159c8338d4300d9bc0e74c24bfcJorim Jaggi    * they can control the SystemUI flags, otherwise the SystemUI flags from home activity will be
5950bf59ca0d86d159c8338d4300d9bc0e74c24bfcJorim Jaggi    * taken.
6050bf59ca0d86d159c8338d4300d9bc0e74c24bfcJorim Jaggi    */
6150bf59ca0d86d159c8338d4300d9bc0e74c24bfcJorim Jaggi    void setAnimationTargetsBehindSystemBars(boolean behindSystemBars);
62f557c3b56547de332b1f116f316b3a81dabd230dWinson Chung
63f557c3b56547de332b1f116f316b3a81dabd230dWinson Chung    /**
64f557c3b56547de332b1f116f316b3a81dabd230dWinson Chung     * Informs the system that the primary split-screen stack should be minimized.
65f557c3b56547de332b1f116f316b3a81dabd230dWinson Chung     */
66f557c3b56547de332b1f116f316b3a81dabd230dWinson Chung    void setSplitScreenMinimized(boolean minimized);
67a840c328e7305ba9492e699a8d6cc8794b2ab6baWinson Chung
68a840c328e7305ba9492e699a8d6cc8794b2ab6baWinson Chung    /**
69a840c328e7305ba9492e699a8d6cc8794b2ab6baWinson Chung     * Hides the current input method if one is showing.
70a840c328e7305ba9492e699a8d6cc8794b2ab6baWinson Chung     */
71a840c328e7305ba9492e699a8d6cc8794b2ab6baWinson Chung    void hideCurrentInputMethod();
72e2d721781fc024cbd9a14929741e5b476242291fWinson Chung}
73