Debian Codegraph @

libs/WindowManager/Shell/src/com/android/wm/shell/pip/IPip.aidl

raw
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 com.android.wm.shell.pip;
18
19 import android.app.PictureInPictureParams;
20 import android.view.SurfaceControl;
21 import android.content.ComponentName;
22 import android.content.pm.ActivityInfo;
23 import android.graphics.Rect;
24
25 import com.android.wm.shell.pip.IPipAnimationListener;
26
27 /**
28 * Interface that is exposed to remote callers to manipulate the Pip feature.
29 */
30 interface IPip {
31
32 /**
33 * Notifies that Activity is about to be swiped to home with entering PiP transition and
34 * queries the destination bounds for PiP depends on Launcher's rotation and shelf height.
35 *
36 * @param componentName ComponentName represents the Activity
37 * @param activityInfo ActivityInfo tied to the Activity
38 * @param pictureInPictureParams PictureInPictureParams tied to the Activity
39 * @param launcherRotation Launcher rotation to calculate the PiP destination bounds
40 * @param hotseatKeepClearArea Bounds of Hotseat to avoid used to calculate PiP destination
41 bounds
42 * @return destination bounds the PiP window should land into
43 */
44 Rect startSwipePipToHome(in ComponentName componentName, in ActivityInfo activityInfo,
45 in PictureInPictureParams pictureInPictureParams,
46 int launcherRotation, in Rect hotseatKeepClearArea) = 1;
47
48 /**
49 * Notifies the swiping Activity to PiP onto home transition is finished
50 *
51 * @param taskId the Task id that the Activity and overlay are currently in.
52 * @param componentName ComponentName represents the Activity
53 * @param destinationBounds the destination bounds the PiP window lands into
54 * @param overlay an optional overlay to fade out after entering PiP
55 */
56 oneway void stopSwipePipToHome(int taskId, in ComponentName componentName,
57 in Rect destinationBounds, in SurfaceControl overlay) = 2;
58
59 /**
60 * Sets listener to get pinned stack animation callbacks.
61 */
62 oneway void setPipAnimationListener(IPipAnimationListener listener) = 3;
63
64 /**
65 * Sets the shelf height and visibility.
66 */
67 oneway void setShelfHeight(boolean visible, int shelfHeight) = 4;
68
69 /**
70 * Sets the next pip animation type to be the alpha animation.
71 */
72 oneway void setPipAnimationTypeToAlpha() = 5;
73 }