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