Dianne Hackborn | 7da6ac3 | 2010-12-09 19:22:04 -0800 | [diff] [blame] | 1 | /* |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2 | ** Copyright 2006, The Android Open Source Project |
| 3 | ** |
Jim Miller | 4eeb4f6 | 2012-11-08 00:04:29 -0800 | [diff] [blame] | 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 |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7 | ** |
Jim Miller | 4eeb4f6 | 2012-11-08 00:04:29 -0800 | [diff] [blame] | 8 | ** http://www.apache.org/licenses/LICENSE-2.0 |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 9 | ** |
Jim Miller | 4eeb4f6 | 2012-11-08 00:04:29 -0800 | [diff] [blame] | 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 |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 14 | ** limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package android.view; |
| 18 | |
Clara Bayarri | 75e0979 | 2015-07-29 16:20:40 +0100 | [diff] [blame] | 19 | import com.android.internal.os.IResultReceiver; |
Jorim Jaggi | 241ae10 | 2016-11-02 21:57:33 -0700 | [diff] [blame] | 20 | import com.android.internal.policy.IKeyguardDismissCallback; |
Muyuan Li | 94ce94e | 2016-02-24 16:20:54 -0800 | [diff] [blame] | 21 | import com.android.internal.policy.IShortcutService; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 22 | |
Winson Chung | e210468 | 2017-11-08 17:31:14 -0800 | [diff] [blame] | 23 | import android.app.IAssistDataReceiver; |
Dianne Hackborn | 2f0b175 | 2011-05-31 17:59:49 -0700 | [diff] [blame] | 24 | import android.content.res.CompatibilityInfo; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 25 | import android.content.res.Configuration; |
Dianne Hackborn | 0aae2d4 | 2010-12-07 23:51:29 -0800 | [diff] [blame] | 26 | import android.graphics.Bitmap; |
Winson Chung | a31922f | 2017-05-24 15:50:06 -0700 | [diff] [blame] | 27 | import android.graphics.GraphicBuffer; |
Issei Suzuki | a5dbf52 | 2019-02-01 17:58:15 +0100 | [diff] [blame] | 28 | import android.graphics.Insets; |
Dianne Hackborn | ac8dea1 | 2011-04-20 18:18:51 -0700 | [diff] [blame] | 29 | import android.graphics.Point; |
Svetoslav Ganov | c9c9a48 | 2012-07-16 08:46:07 -0700 | [diff] [blame] | 30 | import android.graphics.Rect; |
Albert Chaulk | 56162a0 | 2017-06-05 19:35:23 -0400 | [diff] [blame] | 31 | import android.graphics.Region; |
Adam Cohen | f752202 | 2012-10-03 20:03:18 -0700 | [diff] [blame] | 32 | import android.os.Bundle; |
Dianne Hackborn | 38e29a6 | 2011-09-18 14:43:08 -0700 | [diff] [blame] | 33 | import android.os.IRemoteCallback; |
Robert Carr | 3b71624 | 2016-08-16 16:02:21 -0700 | [diff] [blame] | 34 | import android.os.ParcelFileDescriptor; |
Charles Chen | f65e022 | 2020-01-17 11:51:34 +0800 | [diff] [blame] | 35 | import android.view.DisplayCutout; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 36 | import android.view.IApplicationToken; |
Jorim Jaggi | 2f7d292 | 2015-10-29 13:08:29 +0100 | [diff] [blame] | 37 | import android.view.IAppTransitionAnimationSpecsFuture; |
Jorim Jaggi | a6c934e | 2015-12-21 13:22:31 +0100 | [diff] [blame] | 38 | import android.view.IDockedStackListener; |
Evan Rosky | 8d782e0 | 2019-10-14 15:43:53 -0700 | [diff] [blame] | 39 | import android.view.IDisplayWindowInsetsController; |
Evan Rosky | 69cace4 | 2019-09-20 16:28:13 -0700 | [diff] [blame] | 40 | import android.view.IDisplayWindowListener; |
Adrian Roos | 962017e | 2018-11-27 15:11:46 +0100 | [diff] [blame] | 41 | import android.view.IDisplayFoldListener; |
Evan Rosky | 69cace4 | 2019-09-20 16:28:13 -0700 | [diff] [blame] | 42 | import android.view.IDisplayWindowRotationController; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 43 | import android.view.IOnKeyguardExitResult; |
Winson Chung | 655332c | 2016-10-31 13:14:28 -0700 | [diff] [blame] | 44 | import android.view.IPinnedStackListener; |
Jorim Jaggi | 33a701a | 2017-12-01 14:58:18 +0100 | [diff] [blame] | 45 | import android.view.RemoteAnimationAdapter; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 46 | import android.view.IRotationWatcher; |
Adrian Roos | 4ffc897 | 2019-02-07 20:45:11 +0100 | [diff] [blame] | 47 | import android.view.ISystemGestureExclusionListener; |
Lucas Dupin | e157170 | 2017-05-24 14:14:44 -0700 | [diff] [blame] | 48 | import android.view.IWallpaperVisibilityListener; |
Evan Rosky | 22b6bbd | 2019-09-26 14:29:57 -0700 | [diff] [blame] | 49 | import android.view.IWindow; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 50 | import android.view.IWindowSession; |
Dianne Hackborn | eb94fa7 | 2014-06-03 17:48:12 -0700 | [diff] [blame] | 51 | import android.view.IWindowSessionCallback; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 52 | import android.view.KeyEvent; |
Jeff Brown | 6ec402b | 2010-07-28 15:48:59 -0700 | [diff] [blame] | 53 | import android.view.InputEvent; |
Evan Rosky | 8d782e0 | 2019-10-14 15:43:53 -0700 | [diff] [blame] | 54 | import android.view.InsetsState; |
Svetoslav Ganov | 152e9bb | 2012-10-12 20:15:29 -0700 | [diff] [blame] | 55 | import android.view.MagnificationSpec; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 56 | import android.view.MotionEvent; |
Jeff Brown | a41ca77 | 2010-08-11 14:46:32 -0700 | [diff] [blame] | 57 | import android.view.InputChannel; |
Jeff Brown | 8d60866 | 2010-08-30 03:02:23 -0700 | [diff] [blame] | 58 | import android.view.InputDevice; |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 59 | import android.view.IInputFilter; |
Filip Gruszczynski | 170192a | 2015-08-16 17:46:34 -0700 | [diff] [blame] | 60 | import android.view.AppTransitionAnimationSpec; |
Svetoslav | 1376d60 | 2014-03-13 11:17:26 -0700 | [diff] [blame] | 61 | import android.view.WindowContentFrameStats; |
Jorim Jaggi | e2c77f9 | 2016-12-29 14:57:22 +0100 | [diff] [blame] | 62 | import android.view.WindowManager; |
Robert Carr | 10584fa | 2019-01-14 15:55:19 -0800 | [diff] [blame] | 63 | import android.view.SurfaceControl; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 64 | |
| 65 | /** |
| 66 | * System private interface to the window manager. |
| 67 | * |
| 68 | * {@hide} |
| 69 | */ |
| 70 | interface IWindowManager |
| 71 | { |
| 72 | /** |
Garfield Tan | a3f1903 | 2019-11-19 18:04:50 -0800 | [diff] [blame] | 73 | * No overridden behavior is provided in terms of fixing rotation to user rotation. Use |
| 74 | * other flags to derive the default behavior, such as {@link WindowManagerService#mIsPc} |
| 75 | * and {@link WindowManagerService#mForceDesktopModeOnExternalDisplays}. |
| 76 | */ |
| 77 | const int FIXED_TO_USER_ROTATION_DEFAULT = 0; |
| 78 | /** |
| 79 | * Don't fix display rotation to {@link DisplayRotation#mUserRotation} only. Always allow |
| 80 | * other factors to play a role in deciding display rotation. |
| 81 | */ |
| 82 | const int FIXED_TO_USER_ROTATION_DISABLED = 1; |
| 83 | /** |
| 84 | * Only use {@link DisplayRotation#mUserRotation} as the display rotation. |
| 85 | */ |
| 86 | const int FIXED_TO_USER_ROTATION_ENABLED = 2; |
| 87 | |
| 88 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 89 | * ===== NOTICE ===== |
| 90 | * The first three methods must remain the first three methods. Scripts |
| 91 | * and tools rely on their transaction number to work properly. |
| 92 | */ |
| 93 | // This is used for debugging |
| 94 | boolean startViewServer(int port); // Transaction #1 |
| 95 | boolean stopViewServer(); // Transaction #2 |
| 96 | boolean isViewServerRunning(); // Transaction #3 |
| 97 | |
Yohei Yukawa | a71bb25 | 2018-09-19 19:21:24 -0700 | [diff] [blame] | 98 | IWindowSession openSession(in IWindowSessionCallback callback); |
Dianne Hackborn | ac8dea1 | 2011-04-20 18:18:51 -0700 | [diff] [blame] | 99 | |
Valerie Hau | 779af29 | 2020-02-07 10:53:32 -0800 | [diff] [blame] | 100 | boolean useBLAST(); |
| 101 | |
Andrei Onea | f4fb6fb | 2019-02-27 14:46:52 +0000 | [diff] [blame] | 102 | @UnsupportedAppUsage |
Dianne Hackborn | 672cf45 | 2013-03-26 15:24:24 -0700 | [diff] [blame] | 103 | void getInitialDisplaySize(int displayId, out Point size); |
Andrei Onea | f4fb6fb | 2019-02-27 14:46:52 +0000 | [diff] [blame] | 104 | @UnsupportedAppUsage |
Dianne Hackborn | 672cf45 | 2013-03-26 15:24:24 -0700 | [diff] [blame] | 105 | void getBaseDisplaySize(int displayId, out Point size); |
Jeff Brown | 43aa159 | 2012-09-10 17:36:31 -0700 | [diff] [blame] | 106 | void setForcedDisplaySize(int displayId, int width, int height); |
Craig Mautner | 59c0097 | 2012-07-30 12:10:24 -0700 | [diff] [blame] | 107 | void clearForcedDisplaySize(int displayId); |
Andrei Onea | f4fb6fb | 2019-02-27 14:46:52 +0000 | [diff] [blame] | 108 | @UnsupportedAppUsage |
Dianne Hackborn | 672cf45 | 2013-03-26 15:24:24 -0700 | [diff] [blame] | 109 | int getInitialDisplayDensity(int displayId); |
| 110 | int getBaseDisplayDensity(int displayId); |
Alan Viverette | df3a7ca | 2016-09-06 17:13:41 -0400 | [diff] [blame] | 111 | void setForcedDisplayDensityForUser(int displayId, int density, int userId); |
| 112 | void clearForcedDisplayDensityForUser(int displayId, int userId); |
Jeff Brown | d46747a | 2015-04-15 19:02:36 -0700 | [diff] [blame] | 113 | void setForcedDisplayScalingMode(int displayId, int mode); // 0 = auto, 1 = disable |
Dianne Hackborn | 7916ac6 | 2011-05-16 20:45:48 -0700 | [diff] [blame] | 114 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 115 | // These can only be called when holding the MANAGE_APP_TOKENS permission. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 116 | void setEventDispatching(boolean enabled); |
Andrii Kulian | 4a31697 | 2020-01-21 21:41:38 -0800 | [diff] [blame] | 117 | |
| 118 | /** @return {@code true} if this binder is a registered window token. */ |
| 119 | boolean isWindowToken(in IBinder binder); |
| 120 | /** |
| 121 | * Adds window token for a given type. |
| 122 | * |
| 123 | * @param token Token to be registered. |
| 124 | * @param type Window type to be used with this token. |
Andrii Kulian | ea32563 | 2020-01-28 17:52:57 -0800 | [diff] [blame] | 125 | * @param options A bundle used to pass window-related options. |
Andrii Kulian | 4a31697 | 2020-01-21 21:41:38 -0800 | [diff] [blame] | 126 | * @param displayId The ID of the display where this token should be added. |
| 127 | * @param packageName The name of package to request to add window token. |
| 128 | * @return {@link WindowManagerGlobal#ADD_OKAY} if the addition was successful, an error code |
| 129 | * otherwise. |
| 130 | */ |
Andrii Kulian | ea32563 | 2020-01-28 17:52:57 -0800 | [diff] [blame] | 131 | int addWindowTokenWithOptions(IBinder token, int type, int displayId, in Bundle options, |
| 132 | String packageName); |
Wale Ogunwale | ac2561e | 2016-11-01 15:43:46 -0700 | [diff] [blame] | 133 | void addWindowToken(IBinder token, int type, int displayId); |
| 134 | void removeWindowToken(IBinder token, int displayId); |
Dianne Hackborn | 7da6ac3 | 2010-12-09 19:22:04 -0800 | [diff] [blame] | 135 | void prepareAppTransition(int transit, boolean alwaysKeepCurrent); |
Jorim Jaggi | 2f7d292 | 2015-10-29 13:08:29 +0100 | [diff] [blame] | 136 | |
| 137 | /** |
Evan Rosky | 69cace4 | 2019-09-20 16:28:13 -0700 | [diff] [blame] | 138 | * Sets a singular remote controller of display rotations. There can only be one. The |
| 139 | * controller is called after the display has "frozen" for a rotation and display rotation will |
| 140 | * only continue once the controller has finished calculating associated configurations. |
| 141 | */ |
| 142 | void setDisplayWindowRotationController(IDisplayWindowRotationController controller); |
| 143 | |
| 144 | /** |
Evan Rosky | 22b6bbd | 2019-09-26 14:29:57 -0700 | [diff] [blame] | 145 | * Adds a root container that a client shell can populate with its own windows (usually via |
| 146 | * WindowlessWindowManager). |
| 147 | * |
| 148 | * @param client an IWindow used for window-level communication (ime, finish draw, etc.). |
| 149 | * @param windowType used by WM to determine the z-order. This is the same as the window type |
| 150 | * used in {@link WindowManager.LayoutParams}. |
| 151 | * @return a SurfaceControl to add things to. |
| 152 | */ |
| 153 | SurfaceControl addShellRoot(int displayId, IWindow client, int windowType); |
| 154 | |
| 155 | /** |
Jorim Jaggi | 2f7d292 | 2015-10-29 13:08:29 +0100 | [diff] [blame] | 156 | * Like overridePendingAppTransitionMultiThumb, but uses a future to supply the specs. This is |
| 157 | * used for recents, where generating the thumbnails of the specs takes a non-trivial amount of |
| 158 | * time, so we want to move that off the critical path for starting the new activity. |
| 159 | */ |
Andrei Onea | f4fb6fb | 2019-02-27 14:46:52 +0000 | [diff] [blame] | 160 | @UnsupportedAppUsage |
Jorim Jaggi | 2f7d292 | 2015-10-29 13:08:29 +0100 | [diff] [blame] | 161 | void overridePendingAppTransitionMultiThumbFuture( |
| 162 | IAppTransitionAnimationSpecsFuture specsFuture, IRemoteCallback startedCallback, |
lumark | a483f31 | 2018-11-20 15:24:05 +0800 | [diff] [blame] | 163 | boolean scaleUp, int displayId); |
Andrei Onea | f4fb6fb | 2019-02-27 14:46:52 +0000 | [diff] [blame] | 164 | @UnsupportedAppUsage |
lumark | a483f31 | 2018-11-20 15:24:05 +0800 | [diff] [blame] | 165 | void overridePendingAppTransitionRemote(in RemoteAnimationAdapter remoteAnimationAdapter, |
| 166 | int displayId); |
Andrei Onea | f4fb6fb | 2019-02-27 14:46:52 +0000 | [diff] [blame] | 167 | @UnsupportedAppUsage |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 168 | void executeAppTransition(); |
Wale Ogunwale | 3b23239 | 2016-05-13 15:37:13 -0700 | [diff] [blame] | 169 | |
Jorim Jaggi | 66b48df | 2018-04-20 16:23:48 +0200 | [diff] [blame] | 170 | /** |
| 171 | * Used by system ui to report that recents has shown itself. |
| 172 | * @deprecated to be removed once prebuilts are updated |
| 173 | */ |
Andrei Onea | f4fb6fb | 2019-02-27 14:46:52 +0000 | [diff] [blame] | 174 | @UnsupportedAppUsage |
Filip Gruszczynski | 14b4e57 | 2015-11-03 15:53:55 -0800 | [diff] [blame] | 175 | void endProlongedAnimations(); |
| 176 | |
Dianne Hackborn | 9d9ece3 | 2012-09-10 15:33:52 -0700 | [diff] [blame] | 177 | void startFreezingScreen(int exitAnim, int enterAnim); |
| 178 | void stopFreezingScreen(); |
| 179 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 180 | // these require DISABLE_KEYGUARD permission |
Adrian Roos | 1c8e3c0 | 2018-11-20 20:07:55 +0100 | [diff] [blame] | 181 | /** @deprecated use Activity.setShowWhenLocked instead. */ |
| 182 | void disableKeyguard(IBinder token, String tag, int userId); |
| 183 | /** @deprecated use Activity.setShowWhenLocked instead. */ |
| 184 | void reenableKeyguard(IBinder token, int userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 185 | void exitKeyguardSecurely(IOnKeyguardExitResult callback); |
Andrei Onea | f4fb6fb | 2019-02-27 14:46:52 +0000 | [diff] [blame] | 186 | @UnsupportedAppUsage |
Mike Lockwood | 520d8bc | 2011-02-18 13:23:13 -0500 | [diff] [blame] | 187 | boolean isKeyguardLocked(); |
Andrei Onea | f4fb6fb | 2019-02-27 14:46:52 +0000 | [diff] [blame] | 188 | @UnsupportedAppUsage |
Brad Stenning | 2bdc21e | 2019-03-11 14:33:22 -0700 | [diff] [blame] | 189 | boolean isKeyguardSecure(int userId); |
Lucas Dupin | c80c67e | 2017-12-04 14:29:10 -0800 | [diff] [blame] | 190 | void dismissKeyguard(IKeyguardDismissCallback callback, CharSequence message); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 191 | |
Evan Rosky | 1839645 | 2016-07-27 15:19:37 -0700 | [diff] [blame] | 192 | // Requires INTERACT_ACROSS_USERS_FULL permission |
| 193 | void setSwitchingUser(boolean switching); |
| 194 | |
Dianne Hackborn | ffa4248 | 2009-09-23 22:20:11 -0700 | [diff] [blame] | 195 | void closeSystemDialogs(String reason); |
Jim Miller | 4eeb4f6 | 2012-11-08 00:04:29 -0800 | [diff] [blame] | 196 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 197 | // These can only be called with the SET_ANIMATON_SCALE permission. |
Andrei Onea | f4fb6fb | 2019-02-27 14:46:52 +0000 | [diff] [blame] | 198 | @UnsupportedAppUsage |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 199 | float getAnimationScale(int which); |
Andrei Onea | f4fb6fb | 2019-02-27 14:46:52 +0000 | [diff] [blame] | 200 | @UnsupportedAppUsage |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 201 | float[] getAnimationScales(); |
Andrei Onea | f4fb6fb | 2019-02-27 14:46:52 +0000 | [diff] [blame] | 202 | @UnsupportedAppUsage |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 203 | void setAnimationScale(int which, float scale); |
Andrei Onea | f4fb6fb | 2019-02-27 14:46:52 +0000 | [diff] [blame] | 204 | @UnsupportedAppUsage |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 205 | void setAnimationScales(in float[] scales); |
Jim Miller | 4eeb4f6 | 2012-11-08 00:04:29 -0800 | [diff] [blame] | 206 | |
Dianne Hackborn | eb94fa7 | 2014-06-03 17:48:12 -0700 | [diff] [blame] | 207 | float getCurrentAnimatorScale(); |
| 208 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 209 | // For testing |
Artur Satayev | 70507ed | 2019-07-29 13:18:27 +0100 | [diff] [blame] | 210 | @UnsupportedAppUsage(maxTargetSdk = 28) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 211 | void setInTouchMode(boolean showFocus); |
Brad Fitzpatrick | 6804433 | 2010-11-22 18:19:48 -0800 | [diff] [blame] | 212 | |
| 213 | // For StrictMode flashing a red border on violations from the UI |
| 214 | // thread. The uid/pid is implicit from the Binder call, and the Window |
| 215 | // Manager uses that to determine whether or not the red border should |
| 216 | // actually be shown. (it will be ignored that pid doesn't have windows |
| 217 | // on screen) |
Artur Satayev | 70507ed | 2019-07-29 13:18:27 +0100 | [diff] [blame] | 218 | @UnsupportedAppUsage(maxTargetSdk = 28) |
Brad Fitzpatrick | 6804433 | 2010-11-22 18:19:48 -0800 | [diff] [blame] | 219 | void showStrictModeViolation(boolean on); |
| 220 | |
Brad Fitzpatrick | c1a968a | 2010-11-24 08:56:40 -0800 | [diff] [blame] | 221 | // Proxy to set the system property for whether the flashing |
| 222 | // should be enabled. The 'enabled' value is null or blank for |
| 223 | // the system default (differs per build variant) or any valid |
| 224 | // boolean string as parsed by SystemProperties.getBoolean(). |
Andrei Onea | f4fb6fb | 2019-02-27 14:46:52 +0000 | [diff] [blame] | 225 | @UnsupportedAppUsage |
Brad Fitzpatrick | c1a968a | 2010-11-24 08:56:40 -0800 | [diff] [blame] | 226 | void setStrictModeVisualIndicatorPreference(String enabled); |
| 227 | |
Sander Alewijnse | d2a1eec | 2014-07-09 12:57:05 +0100 | [diff] [blame] | 228 | /** |
Makoto Onuki | 04ef447 | 2018-03-12 17:29:49 -0700 | [diff] [blame] | 229 | * Set whether screen capture is disabled for all windows of a specific user from |
| 230 | * the device policy cache. |
Sander Alewijnse | d2a1eec | 2014-07-09 12:57:05 +0100 | [diff] [blame] | 231 | */ |
Makoto Onuki | 04ef447 | 2018-03-12 17:29:49 -0700 | [diff] [blame] | 232 | void refreshScreenCaptureDisabled(int userId); |
Sander Alewijnse | d2a1eec | 2014-07-09 12:57:05 +0100 | [diff] [blame] | 233 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 234 | // These can only be called with the SET_ORIENTATION permission. |
| 235 | /** |
Jeff Brown | 01a98dd | 2011-09-20 15:08:29 -0700 | [diff] [blame] | 236 | * Update the current screen rotation based on the current state of |
| 237 | * the world. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 238 | * @param alwaysSendConfiguration Flag to force a new configuration to |
| 239 | * be evaluated. This can be used when there are other parameters in |
| 240 | * configuration that are changing. |
Dianne Hackborn | f87d196 | 2012-04-04 12:48:24 -0700 | [diff] [blame] | 241 | * @param forceRelayout If true, the window manager will always do a relayout |
| 242 | * of its windows even if the rotation hasn't changed. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 243 | */ |
Dianne Hackborn | f87d196 | 2012-04-04 12:48:24 -0700 | [diff] [blame] | 244 | void updateRotation(boolean alwaysSendConfiguration, boolean forceRelayout); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 245 | |
| 246 | /** |
Andrii Kulian | 8ee7285 | 2017-03-10 10:36:45 -0800 | [diff] [blame] | 247 | * Retrieve the current orientation of the primary screen. |
| 248 | * @return Constant as per {@link android.view.Surface.Rotation}. |
| 249 | * |
| 250 | * @see android.view.Display#DEFAULT_DISPLAY |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 251 | */ |
Andrii Kulian | 8ee7285 | 2017-03-10 10:36:45 -0800 | [diff] [blame] | 252 | int getDefaultDisplayRotation(); |
Jim Miller | 4eeb4f6 | 2012-11-08 00:04:29 -0800 | [diff] [blame] | 253 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 254 | /** |
Andrii Kulian | 35fa3c2 | 2017-03-11 09:37:28 -0800 | [diff] [blame] | 255 | * Watch the rotation of the specified screen. Returns the current rotation, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 256 | * calls back when it changes. |
| 257 | */ |
Andrii Kulian | 35fa3c2 | 2017-03-11 09:37:28 -0800 | [diff] [blame] | 258 | int watchRotation(IRotationWatcher watcher, int displayId); |
Daniel Sandler | b73617d | 2010-08-17 00:41:00 -0400 | [diff] [blame] | 259 | |
Adam Powell | dfee59a | 2011-08-05 20:48:30 -0700 | [diff] [blame] | 260 | /** |
Brian Colonna | b1b9a8a | 2013-03-29 11:52:42 -0400 | [diff] [blame] | 261 | * Remove a rotation watcher set using watchRotation. |
| 262 | * @hide |
| 263 | */ |
Andrei Onea | f4fb6fb | 2019-02-27 14:46:52 +0000 | [diff] [blame] | 264 | @UnsupportedAppUsage |
Brian Colonna | b1b9a8a | 2013-03-29 11:52:42 -0400 | [diff] [blame] | 265 | void removeRotationWatcher(IRotationWatcher watcher); |
| 266 | |
| 267 | /** |
Adam Powell | dfee59a | 2011-08-05 20:48:30 -0700 | [diff] [blame] | 268 | * Determine the preferred edge of the screen to pin the compact options menu against. |
Riddle Hsu | a4d6fa2 | 2018-08-11 00:50:39 +0800 | [diff] [blame] | 269 | * |
| 270 | * @param displayId Id of the display where the menu window currently resides. |
| 271 | * @return a Gravity value for the options menu panel. |
Adam Powell | dfee59a | 2011-08-05 20:48:30 -0700 | [diff] [blame] | 272 | * @hide |
| 273 | */ |
Riddle Hsu | a4d6fa2 | 2018-08-11 00:50:39 +0800 | [diff] [blame] | 274 | int getPreferredOptionsPanelGravity(int displayId); |
Adam Powell | dfee59a | 2011-08-05 20:48:30 -0700 | [diff] [blame] | 275 | |
Jim Miller | 4eeb4f6 | 2012-11-08 00:04:29 -0800 | [diff] [blame] | 276 | /** |
Garfield Tan | 90c9005 | 2018-10-08 12:29:41 -0700 | [diff] [blame] | 277 | * Equivalent to calling {@link #freezeDisplayRotation(int, int)} with {@link |
| 278 | * android.view.Display#DEFAULT_DISPLAY} and given rotation. |
Jim Miller | 4eeb4f6 | 2012-11-08 00:04:29 -0800 | [diff] [blame] | 279 | */ |
Andrei Onea | f4fb6fb | 2019-02-27 14:46:52 +0000 | [diff] [blame] | 280 | @UnsupportedAppUsage |
Jim Miller | 4eeb4f6 | 2012-11-08 00:04:29 -0800 | [diff] [blame] | 281 | void freezeRotation(int rotation); |
Daniel Sandler | b73617d | 2010-08-17 00:41:00 -0400 | [diff] [blame] | 282 | |
Jim Miller | 4eeb4f6 | 2012-11-08 00:04:29 -0800 | [diff] [blame] | 283 | /** |
Garfield Tan | 90c9005 | 2018-10-08 12:29:41 -0700 | [diff] [blame] | 284 | * Equivalent to calling {@link #thawDisplayRotation(int)} with {@link |
| 285 | * android.view.Display#DEFAULT_DISPLAY}. |
Jim Miller | 4eeb4f6 | 2012-11-08 00:04:29 -0800 | [diff] [blame] | 286 | */ |
Andrei Onea | f4fb6fb | 2019-02-27 14:46:52 +0000 | [diff] [blame] | 287 | @UnsupportedAppUsage |
Jim Miller | 4eeb4f6 | 2012-11-08 00:04:29 -0800 | [diff] [blame] | 288 | void thawRotation(); |
Dianne Hackborn | 0aae2d4 | 2010-12-07 23:51:29 -0800 | [diff] [blame] | 289 | |
Jim Miller | 4eeb4f6 | 2012-11-08 00:04:29 -0800 | [diff] [blame] | 290 | /** |
Garfield Tan | 90c9005 | 2018-10-08 12:29:41 -0700 | [diff] [blame] | 291 | * Equivelant to call {@link #isDisplayRotationFrozen(int)} with {@link |
| 292 | * android.view.Display#DEFAULT_DISPLAY}. |
Svetoslav Ganov | 80943d8 | 2013-01-02 10:25:37 -0800 | [diff] [blame] | 293 | */ |
| 294 | boolean isRotationFrozen(); |
| 295 | |
| 296 | /** |
Garfield Tan | 90c9005 | 2018-10-08 12:29:41 -0700 | [diff] [blame] | 297 | * Lock the display orientation to the specified rotation, or to the current |
| 298 | * rotation if -1. Sensor input will be ignored until thawRotation() is called. |
| 299 | * |
| 300 | * @param displayId the ID of display which rotation should be frozen. |
| 301 | * @param rotation one of {@link android.view.Surface#ROTATION_0}, |
| 302 | * {@link android.view.Surface#ROTATION_90}, {@link android.view.Surface#ROTATION_180}, |
| 303 | * {@link android.view.Surface#ROTATION_270} or -1 to freeze it to current rotation. |
| 304 | * @hide |
| 305 | */ |
| 306 | void freezeDisplayRotation(int displayId, int rotation); |
| 307 | |
| 308 | /** |
| 309 | * Release the orientation lock imposed by freezeRotation() on the display. |
| 310 | * |
| 311 | * @param displayId the ID of display which rotation should be thawed. |
| 312 | * @hide |
| 313 | */ |
| 314 | void thawDisplayRotation(int displayId); |
| 315 | |
| 316 | /** |
| 317 | * Gets whether the rotation is frozen on the display. |
| 318 | * |
| 319 | * @param displayId the ID of display which frozen is needed. |
| 320 | * @return Whether the rotation is frozen. |
| 321 | */ |
| 322 | boolean isDisplayRotationFrozen(int displayId); |
| 323 | |
| 324 | /** |
Garfield Tan | a3f1903 | 2019-11-19 18:04:50 -0800 | [diff] [blame] | 325 | * Sets if display rotation is fixed to user specified value for given displayId. |
| 326 | */ |
| 327 | void setFixedToUserRotation(int displayId, int fixedToUserRotation); |
| 328 | |
| 329 | /** |
Zak Cohen | 3683fb1 | 2016-07-11 19:47:37 +0100 | [diff] [blame] | 330 | * Screenshot the current wallpaper layer, including the whole screen. |
| 331 | */ |
| 332 | Bitmap screenshotWallpaper(); |
| 333 | |
| 334 | /** |
Lucas Dupin | e157170 | 2017-05-24 14:14:44 -0700 | [diff] [blame] | 335 | * Registers a wallpaper visibility listener. |
| 336 | * @return Current visibility. |
| 337 | */ |
| 338 | boolean registerWallpaperVisibilityListener(IWallpaperVisibilityListener listener, |
| 339 | int displayId); |
| 340 | |
| 341 | /** |
| 342 | * Remove a visibility watcher that was added using registerWallpaperVisibilityListener. |
| 343 | */ |
| 344 | void unregisterWallpaperVisibilityListener(IWallpaperVisibilityListener listener, |
| 345 | int displayId); |
| 346 | |
| 347 | /** |
Adrian Roos | 4ffc897 | 2019-02-07 20:45:11 +0100 | [diff] [blame] | 348 | * Registers a system gesture exclusion listener for a given display. |
| 349 | */ |
| 350 | void registerSystemGestureExclusionListener(ISystemGestureExclusionListener listener, |
| 351 | int displayId); |
| 352 | |
| 353 | /** |
| 354 | * Unregisters a system gesture exclusion listener for a given display. |
| 355 | */ |
| 356 | void unregisterSystemGestureExclusionListener(ISystemGestureExclusionListener listener, |
| 357 | int displayId); |
| 358 | |
| 359 | /** |
Dianne Hackborn | 27eac1d | 2015-03-16 17:15:53 -0700 | [diff] [blame] | 360 | * Used only for assist -- request a screenshot of the current application. |
| 361 | */ |
Winson Chung | da2818f | 2017-10-23 16:25:49 -0700 | [diff] [blame] | 362 | boolean requestAssistScreenshot(IAssistDataReceiver receiver); |
Dianne Hackborn | 27eac1d | 2015-03-16 17:15:53 -0700 | [diff] [blame] | 363 | |
| 364 | /** |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 365 | * Called by the status bar to notify Views of changes to System UI visiblity. |
| 366 | */ |
Tiger Huang | 7c610aa | 2018-10-27 00:01:01 +0800 | [diff] [blame] | 367 | oneway void statusBarVisibilityChanged(int displayId, int visibility); |
Jeff Brown | 1a84fd1 | 2011-06-02 01:26:32 -0700 | [diff] [blame] | 368 | |
| 369 | /** |
Jorim Jaggi | 956ca41 | 2019-01-07 14:49:14 +0100 | [diff] [blame] | 370 | * Called by System UI to notify Window Manager to hide transient bars. |
| 371 | */ |
| 372 | oneway void hideTransientBars(int displayId); |
| 373 | |
| 374 | /** |
Brad Stenning | e057369 | 2019-03-11 13:52:46 -0700 | [diff] [blame] | 375 | * When set to {@code true} the system bars will always be shown. This is true even if an app |
| 376 | * requests to be fullscreen by setting the system ui visibility flags. The |
| 377 | * functionality was added for the automotive case as a way to guarantee required content stays |
| 378 | * on screen at all times. |
| 379 | * |
| 380 | * @hide |
| 381 | */ |
| 382 | oneway void setForceShowSystemBars(boolean show); |
| 383 | |
| 384 | /** |
Winson | ab21660 | 2016-08-09 14:05:20 -0700 | [diff] [blame] | 385 | * Called by System UI to notify of changes to the visibility of Recents. |
| 386 | */ |
| 387 | oneway void setRecentsVisibility(boolean visible); |
| 388 | |
| 389 | /** |
| 390 | * Called by System UI to notify of changes to the visibility of PIP. |
| 391 | */ |
Winson Chung | ac52f28 | 2017-03-30 14:44:52 -0700 | [diff] [blame] | 392 | oneway void setPipVisibility(boolean visible); |
Winson | ab21660 | 2016-08-09 14:05:20 -0700 | [diff] [blame] | 393 | |
Tracy Zhou | 4351308 | 2018-03-08 21:58:36 -0800 | [diff] [blame] | 394 | /** |
Matthew Ng | 64543e6 | 2018-02-28 17:35:10 -0800 | [diff] [blame] | 395 | * Called by System UI to enable or disable haptic feedback on the navigation bar buttons. |
| 396 | */ |
Andrei Onea | f4fb6fb | 2019-02-27 14:46:52 +0000 | [diff] [blame] | 397 | @UnsupportedAppUsage |
Matthew Ng | 64543e6 | 2018-02-28 17:35:10 -0800 | [diff] [blame] | 398 | void setNavBarVirtualKeyHapticFeedbackEnabled(boolean enabled); |
| 399 | |
Winson | ab21660 | 2016-08-09 14:05:20 -0700 | [diff] [blame] | 400 | /** |
Charles Chen | ea6e7f0 | 2018-11-19 21:37:45 +0800 | [diff] [blame] | 401 | * Device has a software navigation bar (separate from the status bar) on specific display. |
| 402 | * |
| 403 | * @param displayId the id of display to check if there is a software navigation bar. |
Daniel Sandler | 0c4ccff | 2011-10-19 16:39:14 -0400 | [diff] [blame] | 404 | */ |
Andrei Onea | f4fb6fb | 2019-02-27 14:46:52 +0000 | [diff] [blame] | 405 | @UnsupportedAppUsage |
Charles Chen | ea6e7f0 | 2018-11-19 21:37:45 +0800 | [diff] [blame] | 406 | boolean hasNavigationBar(int displayId); |
Jim Miller | 93c518e | 2012-01-17 15:55:31 -0800 | [diff] [blame] | 407 | |
| 408 | /** |
Tracy Zhou | 4351308 | 2018-03-08 21:58:36 -0800 | [diff] [blame] | 409 | * Get the position of the nav bar |
| 410 | */ |
Tiger Huang | 44c0455 | 2018-11-29 20:06:45 +0800 | [diff] [blame] | 411 | int getNavBarPosition(int displayId); |
Matthew Ng | a8f2426 | 2017-12-19 11:54:24 -0800 | [diff] [blame] | 412 | |
| 413 | /** |
Adam Cohen | f752202 | 2012-10-03 20:03:18 -0700 | [diff] [blame] | 414 | * Lock the device immediately with the specified options (can be null). |
Jim Miller | 93c518e | 2012-01-17 15:55:31 -0800 | [diff] [blame] | 415 | */ |
Andrei Onea | f4fb6fb | 2019-02-27 14:46:52 +0000 | [diff] [blame] | 416 | @UnsupportedAppUsage |
Adam Cohen | f752202 | 2012-10-03 20:03:18 -0700 | [diff] [blame] | 417 | void lockNow(in Bundle options); |
Svetoslav Ganov | c9c9a48 | 2012-07-16 08:46:07 -0700 | [diff] [blame] | 418 | |
| 419 | /** |
Jim Miller | bfec0a8 | 2012-11-05 20:05:22 -0800 | [diff] [blame] | 420 | * Device is in safe mode. |
| 421 | */ |
Andrei Onea | f4fb6fb | 2019-02-27 14:46:52 +0000 | [diff] [blame] | 422 | @UnsupportedAppUsage |
Jim Miller | bfec0a8 | 2012-11-05 20:05:22 -0800 | [diff] [blame] | 423 | boolean isSafeModeEnabled(); |
Jorim Jaggi | cff0acb | 2014-03-31 16:35:15 +0200 | [diff] [blame] | 424 | |
| 425 | /** |
| 426 | * Enables the screen if all conditions are met. |
| 427 | */ |
| 428 | void enableScreenIfNeeded(); |
Svetoslav | dd137a8 | 2014-04-10 12:48:07 -0700 | [diff] [blame] | 429 | |
| 430 | /** |
Svetoslav | 1376d60 | 2014-03-13 11:17:26 -0700 | [diff] [blame] | 431 | * Clears the frame statistics for a given window. |
| 432 | * |
| 433 | * @param token The window token. |
| 434 | * @return Whether the frame statistics were cleared. |
| 435 | */ |
| 436 | boolean clearWindowContentFrameStats(IBinder token); |
| 437 | |
| 438 | /** |
| 439 | * Gets the content frame statistics for a given window. |
| 440 | * |
| 441 | * @param token The window token. |
| 442 | * @return The frame statistics or null if the window does not exist. |
| 443 | */ |
| 444 | WindowContentFrameStats getWindowContentFrameStats(IBinder token); |
Jorim Jaggi | 61f39a7 | 2015-10-29 16:54:18 +0100 | [diff] [blame] | 445 | |
| 446 | /** |
Evan Rosky | 73a7fe9 | 2019-11-18 18:28:01 -0800 | [diff] [blame] | 447 | * This is a no-op. |
Jorim Jaggi | 61f39a7 | 2015-10-29 16:54:18 +0100 | [diff] [blame] | 448 | */ |
Andrei Onea | f4fb6fb | 2019-02-27 14:46:52 +0000 | [diff] [blame] | 449 | @UnsupportedAppUsage |
Jorim Jaggi | 61f39a7 | 2015-10-29 16:54:18 +0100 | [diff] [blame] | 450 | int getDockedStackSide(); |
| 451 | |
| 452 | /** |
Jorim Jaggi | d47e7e1 | 2016-03-01 09:57:38 +0100 | [diff] [blame] | 453 | * Sets the region the user can touch the divider. This region will be excluded from the region |
| 454 | * which is used to cause a focus switch when dispatching touch. |
| 455 | */ |
| 456 | void setDockedStackDividerTouchRegion(in Rect touchableRegion); |
| 457 | |
| 458 | /** |
Winson Chung | 655332c | 2016-10-31 13:14:28 -0700 | [diff] [blame] | 459 | * Registers a listener that will be called when the pinned stack state changes. |
| 460 | */ |
| 461 | void registerPinnedStackListener(int displayId, IPinnedStackListener listener); |
| 462 | |
| 463 | /** |
Clara Bayarri | 75e0979 | 2015-07-29 16:20:40 +0100 | [diff] [blame] | 464 | * Requests Keyboard Shortcuts from the displayed window. |
| 465 | * |
| 466 | * @param receiver The receiver to deliver the results to. |
| 467 | */ |
Clara Bayarri | fcd7e80 | 2016-03-10 12:58:18 +0000 | [diff] [blame] | 468 | void requestAppKeyboardShortcuts(IResultReceiver receiver, int deviceId); |
Jorim Jaggi | c6c89a8 | 2016-01-28 17:48:21 -0800 | [diff] [blame] | 469 | |
| 470 | /** |
| 471 | * Retrieves the current stable insets from the primary display. |
| 472 | */ |
Andrei Onea | f4fb6fb | 2019-02-27 14:46:52 +0000 | [diff] [blame] | 473 | @UnsupportedAppUsage |
Winson Chung | 303c6b7 | 2016-10-24 17:12:49 -0700 | [diff] [blame] | 474 | void getStableInsets(int displayId, out Rect outInsets); |
Muyuan Li | 94ce94e | 2016-02-24 16:20:54 -0800 | [diff] [blame] | 475 | |
| 476 | /** |
Issei Suzuki | a5dbf52 | 2019-02-01 17:58:15 +0100 | [diff] [blame] | 477 | * Set the forwarded insets on the display. |
| 478 | * <p> |
| 479 | * This is only used in case a virtual display is displayed on another display that has insets, |
| 480 | * and the bounds of the virtual display is overlapping with the insets from the host display. |
| 481 | * In that case, the contents on the virtual display won't be placed over the forwarded insets. |
| 482 | * Only the owner of the display is permitted to set the forwarded insets on it. |
| 483 | */ |
| 484 | void setForwardedInsets(int displayId, in Insets insets); |
| 485 | |
| 486 | /** |
Muyuan Li | 94ce94e | 2016-02-24 16:20:54 -0800 | [diff] [blame] | 487 | * Register shortcut key. Shortcut code is packed as: |
| 488 | * (MetaState << Integer.SIZE) | KeyCode |
| 489 | * @hide |
| 490 | */ |
| 491 | void registerShortcutKey(in long shortcutCode, IShortcutService keySubscriber); |
Vladislav Kaznacheev | 0d50d86 | 2016-03-29 15:43:28 -0700 | [diff] [blame] | 492 | |
| 493 | /** |
Arthur Hung | 39134b2 | 2018-08-14 11:58:28 +0800 | [diff] [blame] | 494 | * Create an input consumer by name and display id. |
Vladislav Kaznacheev | 0d50d86 | 2016-03-29 15:43:28 -0700 | [diff] [blame] | 495 | */ |
Andrei Onea | f4fb6fb | 2019-02-27 14:46:52 +0000 | [diff] [blame] | 496 | @UnsupportedAppUsage |
Arthur Hung | 39134b2 | 2018-08-14 11:58:28 +0800 | [diff] [blame] | 497 | void createInputConsumer(IBinder token, String name, int displayId, |
| 498 | out InputChannel inputChannel); |
Vladislav Kaznacheev | 0d50d86 | 2016-03-29 15:43:28 -0700 | [diff] [blame] | 499 | |
| 500 | /** |
Arthur Hung | 39134b2 | 2018-08-14 11:58:28 +0800 | [diff] [blame] | 501 | * Destroy an input consumer by name and display id. |
| 502 | * This method will also dispose the input channels associated with that InputConsumer. |
Vladislav Kaznacheev | 0d50d86 | 2016-03-29 15:43:28 -0700 | [diff] [blame] | 503 | */ |
Andrei Onea | f4fb6fb | 2019-02-27 14:46:52 +0000 | [diff] [blame] | 504 | @UnsupportedAppUsage |
Arthur Hung | 39134b2 | 2018-08-14 11:58:28 +0800 | [diff] [blame] | 505 | boolean destroyInputConsumer(String name, int displayId); |
Albert Chaulk | 56162a0 | 2017-06-05 19:35:23 -0400 | [diff] [blame] | 506 | |
| 507 | /** |
| 508 | * Return the touch region for the current IME window, or an empty region if there is none. |
| 509 | */ |
| 510 | Region getCurrentImeTouchRegion(); |
Vishnu Nair | c961504 | 2018-01-09 07:23:31 -0800 | [diff] [blame] | 511 | |
| 512 | /** |
Adrian Roos | 962017e | 2018-11-27 15:11:46 +0100 | [diff] [blame] | 513 | * Registers an IDisplayFoldListener. |
| 514 | */ |
| 515 | void registerDisplayFoldListener(IDisplayFoldListener listener); |
| 516 | |
| 517 | /** |
| 518 | * Unregisters an IDisplayFoldListener. |
| 519 | */ |
| 520 | void unregisterDisplayFoldListener(IDisplayFoldListener listener); |
| 521 | |
| 522 | /** |
Evan Rosky | 69cace4 | 2019-09-20 16:28:13 -0700 | [diff] [blame] | 523 | * Registers an IDisplayContainerListener |
| 524 | */ |
| 525 | void registerDisplayWindowListener(IDisplayWindowListener listener); |
| 526 | |
| 527 | /** |
| 528 | * Unregisters an IDisplayContainerListener. |
| 529 | */ |
| 530 | void unregisterDisplayWindowListener(IDisplayWindowListener listener); |
| 531 | |
| 532 | /** |
Vishnu Nair | c961504 | 2018-01-09 07:23:31 -0800 | [diff] [blame] | 533 | * Starts a window trace. |
| 534 | */ |
| 535 | void startWindowTrace(); |
| 536 | |
| 537 | /** |
| 538 | * Stops a window trace. |
| 539 | */ |
| 540 | void stopWindowTrace(); |
| 541 | |
| 542 | /** |
| 543 | * Returns true if window trace is enabled. |
| 544 | */ |
| 545 | boolean isWindowTraceEnabled(); |
Yoshiaki Naka | e1bdfc82 | 2017-09-15 15:24:34 +0900 | [diff] [blame] | 546 | |
| 547 | /** |
Andrii Kulian | f0379de | 2018-03-14 16:24:07 -0700 | [diff] [blame] | 548 | * Notify WindowManager that it should not override the info in DisplayManager for the specified |
| 549 | * display. This can disable letter- or pillar-boxing applied in DisplayManager when the metrics |
| 550 | * of the logical display reported from WindowManager do not correspond to the metrics of the |
| 551 | * physical display it is based on. |
| 552 | * |
| 553 | * @param displayId The id of the display. |
| 554 | */ |
| 555 | void dontOverrideDisplayInfo(int displayId); |
Chilun | 8753ad3 | 2018-10-09 15:56:45 +0800 | [diff] [blame] | 556 | |
| 557 | /** |
| 558 | * Gets the windowing mode of the display. |
| 559 | * |
| 560 | * @param displayId The id of the display. |
| 561 | * @return {@link WindowConfiguration.WindowingMode} |
| 562 | */ |
| 563 | int getWindowingMode(int displayId); |
| 564 | |
| 565 | /** |
| 566 | * Sets the windowing mode of the display. |
| 567 | * |
| 568 | * @param displayId The id of the display. |
| 569 | * @param mode {@link WindowConfiguration.WindowingMode} |
| 570 | */ |
| 571 | void setWindowingMode(int displayId, int mode); |
| 572 | |
| 573 | /** |
| 574 | * Gets current remove content mode of the display. |
| 575 | * <p> |
| 576 | * What actions should be performed with the display's content when it is removed. Default |
| 577 | * behavior for public displays in this case is to move all activities to the primary display |
| 578 | * and make it focused. For private display is to destroy all activities. |
| 579 | * </p> |
| 580 | * |
| 581 | * @param displayId The id of the display. |
| 582 | * @return The remove content mode of the display. |
| 583 | * @see WindowManager#REMOVE_CONTENT_MODE_MOVE_TO_PRIMARY |
| 584 | * @see WindowManager#REMOVE_CONTENT_MODE_DESTROY |
| 585 | */ |
| 586 | int getRemoveContentMode(int displayId); |
| 587 | |
| 588 | /** |
| 589 | * Sets the remove content mode of the display. |
| 590 | * <p> |
| 591 | * This mode indicates what actions should be performed with the display's content when it is |
| 592 | * removed. |
| 593 | * </p> |
| 594 | * |
| 595 | * @param displayId The id of the display. |
| 596 | * @param mode Remove content mode. |
| 597 | * @see WindowManager#REMOVE_CONTENT_MODE_MOVE_TO_PRIMARY |
| 598 | * @see WindowManager#REMOVE_CONTENT_MODE_DESTROY |
| 599 | */ |
| 600 | void setRemoveContentMode(int displayId, int mode); |
| 601 | |
| 602 | /** |
| 603 | * Indicates that the display should show its content when non-secure keyguard is shown. |
| 604 | * <p> |
| 605 | * This flag identifies secondary displays that will continue showing content if keyguard can be |
| 606 | * dismissed without entering credentials. |
| 607 | * </p><p> |
| 608 | * An example of usage is a virtual display which content is displayed on external hardware |
| 609 | * display that is not visible to the system directly. |
| 610 | * </p> |
| 611 | * |
| 612 | * @param displayId The id of the display. |
| 613 | * @return {@code true} if the display should show its content when non-secure keyguard is |
| 614 | * shown. |
| 615 | * @see KeyguardManager#isDeviceSecure() |
| 616 | * @see KeyguardManager#isDeviceLocked() |
| 617 | */ |
| 618 | boolean shouldShowWithInsecureKeyguard(int displayId); |
| 619 | |
| 620 | /** |
| 621 | * Sets that the display should show its content when non-secure keyguard is shown. |
| 622 | * |
| 623 | * @param displayId The id of the display. |
| 624 | * @param shouldShow Indicates that the display should show its content when non-secure keyguard |
| 625 | * is shown. |
| 626 | * @see KeyguardManager#isDeviceSecure() |
| 627 | * @see KeyguardManager#isDeviceLocked() |
| 628 | */ |
| 629 | void setShouldShowWithInsecureKeyguard(int displayId, boolean shouldShow); |
| 630 | |
| 631 | /** |
| 632 | * Indicates the display should show system decors. |
| 633 | * <p> |
| 634 | * System decors include status bar, navigation bar, launcher. |
| 635 | * </p> |
| 636 | * |
| 637 | * @param displayId The id of the display. |
| 638 | * @return {@code true} if the display should show system decors. |
| 639 | */ |
| 640 | boolean shouldShowSystemDecors(int displayId); |
| 641 | |
| 642 | /** |
| 643 | * Sets that the display should show system decors. |
| 644 | * <p> |
| 645 | * System decors include status bar, navigation bar, launcher. |
| 646 | * </p> |
| 647 | * |
| 648 | * @param displayId The id of the display. |
| 649 | * @param shouldShow Indicates that the display should show system decors. |
| 650 | */ |
| 651 | void setShouldShowSystemDecors(int displayId, boolean shouldShow); |
| 652 | |
| 653 | /** |
| 654 | * Indicates that the display should show IME. |
| 655 | * |
| 656 | * @param displayId The id of the display. |
| 657 | * @return {@code true} if the display should show IME. |
| 658 | * @see KeyguardManager#isDeviceSecure() |
| 659 | * @see KeyguardManager#isDeviceLocked() |
| 660 | */ |
| 661 | boolean shouldShowIme(int displayId); |
| 662 | |
| 663 | /** |
| 664 | * Sets that the display should show IME. |
| 665 | * |
| 666 | * @param displayId The id of the display. |
| 667 | * @param shouldShow Indicates that the display should show IME. |
| 668 | * @see KeyguardManager#isDeviceSecure() |
| 669 | * @see KeyguardManager#isDeviceLocked() |
| 670 | */ |
| 671 | void setShouldShowIme(int displayId, boolean shouldShow); |
chaviw | ff2e7d8 | 2018-11-02 11:11:27 -0700 | [diff] [blame] | 672 | |
chaviw | 504715c | 2019-02-14 11:02:43 -0800 | [diff] [blame] | 673 | /** |
| 674 | * Waits for transactions to get applied before injecting input. |
| 675 | * This includes waiting for the input windows to get sent to InputManager. |
| 676 | * |
| 677 | * This is needed for testing since the system add windows and injects input |
| 678 | * quick enough that the windows don't have time to get sent to InputManager. |
| 679 | */ |
chaviw | 84dec9f | 2019-04-22 13:39:46 -0700 | [diff] [blame] | 680 | boolean injectInputAfterTransactionsApplied(in InputEvent ev, int mode); |
| 681 | |
| 682 | /** |
| 683 | * Waits until all animations have completed and input information has been sent from |
| 684 | * WindowManager to native InputManager. |
| 685 | * |
| 686 | * This is needed for testing since we need to ensure input information has been propagated to |
| 687 | * native InputManager before proceeding with tests. |
| 688 | */ |
| 689 | void syncInputTransactions(); |
Winson Chung | be2bdb03 | 2019-08-30 16:49:13 -0700 | [diff] [blame] | 690 | |
| 691 | /** |
| 692 | * Returns whether SurfaceFlinger layer tracing is enabled. |
| 693 | */ |
| 694 | boolean isLayerTracing(); |
| 695 | |
| 696 | /** |
| 697 | * Enables/disables SurfaceFlinger layer tracing. |
| 698 | */ |
| 699 | void setLayerTracing(boolean enabled); |
chaviw | a51724f | 2019-09-19 09:50:11 -0700 | [diff] [blame] | 700 | |
| 701 | /** |
| 702 | * Mirrors a specified display. The root of the mirrored hierarchy will be stored in |
| 703 | * outSurfaceControl. |
| 704 | * Requires the ACCESS_SURFACE_FLINGER permission. |
| 705 | * |
| 706 | * @param displayId The id of the display to mirror |
| 707 | * @param outSurfaceControl The SurfaceControl for the root of the mirrored hierarchy. |
| 708 | * |
| 709 | * @return true if the display was successfully mirrored. |
| 710 | */ |
| 711 | boolean mirrorDisplay(int displayId, out SurfaceControl outSurfaceControl); |
Evan Rosky | 8d782e0 | 2019-10-14 15:43:53 -0700 | [diff] [blame] | 712 | |
| 713 | /** |
| 714 | * When in multi-window mode, the provided displayWindowInsetsController will control insets |
| 715 | * animations. |
| 716 | */ |
| 717 | void setDisplayWindowInsetsController( |
| 718 | int displayId, in IDisplayWindowInsetsController displayWindowInsetsController); |
| 719 | |
| 720 | /** |
| 721 | * Called when a remote process modifies insets on a display window container. |
| 722 | */ |
| 723 | void modifyDisplayWindowInsets(int displayId, in InsetsState state); |
Charles Chen | f65e022 | 2020-01-17 11:51:34 +0800 | [diff] [blame] | 724 | |
| 725 | /** |
| 726 | * Called to get the expected window insets. |
Charles Chen | b8070fb | 2020-02-24 15:42:59 +0800 | [diff] [blame] | 727 | * |
| 728 | * @return {@code true} if system bars are always comsumed. |
Charles Chen | f65e022 | 2020-01-17 11:51:34 +0800 | [diff] [blame] | 729 | */ |
Charles Chen | b8070fb | 2020-02-24 15:42:59 +0800 | [diff] [blame] | 730 | boolean getWindowInsets(in WindowManager.LayoutParams attrs, int displayId, |
Charles Chen | f65e022 | 2020-01-17 11:51:34 +0800 | [diff] [blame] | 731 | out Rect outContentInsets, out Rect outStableInsets, |
Charles Chen | b8070fb | 2020-02-24 15:42:59 +0800 | [diff] [blame] | 732 | out DisplayCutout.ParcelableWrapper outDisplayCutout, out InsetsState outInsetsState); |
Hongming Jin | e0ab6b1 | 2020-01-16 14:52:19 -0800 | [diff] [blame] | 733 | |
| 734 | /** |
| 735 | * Called to show global actions. |
| 736 | */ |
| 737 | void showGlobalActions(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 738 | } |