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; |
Dianne Hackborn | ac8dea1 | 2011-04-20 18:18:51 -0700 | [diff] [blame] | 28 | import android.graphics.Point; |
Svetoslav Ganov | c9c9a48 | 2012-07-16 08:46:07 -0700 | [diff] [blame] | 29 | import android.graphics.Rect; |
Albert Chaulk | 56162a0 | 2017-06-05 19:35:23 -0400 | [diff] [blame] | 30 | import android.graphics.Region; |
Adam Cohen | f752202 | 2012-10-03 20:03:18 -0700 | [diff] [blame] | 31 | import android.os.Bundle; |
Dianne Hackborn | 38e29a6 | 2011-09-18 14:43:08 -0700 | [diff] [blame] | 32 | import android.os.IRemoteCallback; |
Robert Carr | 3b71624 | 2016-08-16 16:02:21 -0700 | [diff] [blame] | 33 | import android.os.ParcelFileDescriptor; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 34 | import android.view.IApplicationToken; |
Jorim Jaggi | 2f7d292 | 2015-10-29 13:08:29 +0100 | [diff] [blame] | 35 | import android.view.IAppTransitionAnimationSpecsFuture; |
Jorim Jaggi | a6c934e | 2015-12-21 13:22:31 +0100 | [diff] [blame] | 36 | import android.view.IDockedStackListener; |
Adrian Roos | 962017e | 2018-11-27 15:11:46 +0100 | [diff] [blame] | 37 | import android.view.IDisplayFoldListener; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 38 | import android.view.IOnKeyguardExitResult; |
Winson Chung | 655332c | 2016-10-31 13:14:28 -0700 | [diff] [blame] | 39 | import android.view.IPinnedStackListener; |
Jorim Jaggi | 33a701a | 2017-12-01 14:58:18 +0100 | [diff] [blame] | 40 | import android.view.RemoteAnimationAdapter; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 41 | import android.view.IRotationWatcher; |
Lucas Dupin | e157170 | 2017-05-24 14:14:44 -0700 | [diff] [blame] | 42 | import android.view.IWallpaperVisibilityListener; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 43 | import android.view.IWindowSession; |
Dianne Hackborn | eb94fa7 | 2014-06-03 17:48:12 -0700 | [diff] [blame] | 44 | import android.view.IWindowSessionCallback; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 45 | import android.view.KeyEvent; |
Jeff Brown | 6ec402b | 2010-07-28 15:48:59 -0700 | [diff] [blame] | 46 | import android.view.InputEvent; |
Svetoslav Ganov | 152e9bb | 2012-10-12 20:15:29 -0700 | [diff] [blame] | 47 | import android.view.MagnificationSpec; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 48 | import android.view.MotionEvent; |
Jeff Brown | a41ca77 | 2010-08-11 14:46:32 -0700 | [diff] [blame] | 49 | import android.view.InputChannel; |
Jeff Brown | 8d60866 | 2010-08-30 03:02:23 -0700 | [diff] [blame] | 50 | import android.view.InputDevice; |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 51 | import android.view.IInputFilter; |
Filip Gruszczynski | 170192a | 2015-08-16 17:46:34 -0700 | [diff] [blame] | 52 | import android.view.AppTransitionAnimationSpec; |
Svetoslav | 1376d60 | 2014-03-13 11:17:26 -0700 | [diff] [blame] | 53 | import android.view.WindowContentFrameStats; |
Jorim Jaggi | e2c77f9 | 2016-12-29 14:57:22 +0100 | [diff] [blame] | 54 | import android.view.WindowManager; |
Robert Carr | 10584fa | 2019-01-14 15:55:19 -0800 | [diff] [blame] | 55 | import android.view.SurfaceControl; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 56 | |
| 57 | /** |
| 58 | * System private interface to the window manager. |
| 59 | * |
| 60 | * {@hide} |
| 61 | */ |
| 62 | interface IWindowManager |
| 63 | { |
| 64 | /** |
| 65 | * ===== NOTICE ===== |
| 66 | * The first three methods must remain the first three methods. Scripts |
| 67 | * and tools rely on their transaction number to work properly. |
| 68 | */ |
| 69 | // This is used for debugging |
| 70 | boolean startViewServer(int port); // Transaction #1 |
| 71 | boolean stopViewServer(); // Transaction #2 |
| 72 | boolean isViewServerRunning(); // Transaction #3 |
| 73 | |
Yohei Yukawa | a71bb25 | 2018-09-19 19:21:24 -0700 | [diff] [blame] | 74 | IWindowSession openSession(in IWindowSessionCallback callback); |
Dianne Hackborn | ac8dea1 | 2011-04-20 18:18:51 -0700 | [diff] [blame] | 75 | |
Dianne Hackborn | 672cf45 | 2013-03-26 15:24:24 -0700 | [diff] [blame] | 76 | void getInitialDisplaySize(int displayId, out Point size); |
| 77 | void getBaseDisplaySize(int displayId, out Point size); |
Jeff Brown | 43aa159 | 2012-09-10 17:36:31 -0700 | [diff] [blame] | 78 | void setForcedDisplaySize(int displayId, int width, int height); |
Craig Mautner | 59c0097 | 2012-07-30 12:10:24 -0700 | [diff] [blame] | 79 | void clearForcedDisplaySize(int displayId); |
Dianne Hackborn | 672cf45 | 2013-03-26 15:24:24 -0700 | [diff] [blame] | 80 | int getInitialDisplayDensity(int displayId); |
| 81 | int getBaseDisplayDensity(int displayId); |
Alan Viverette | df3a7ca | 2016-09-06 17:13:41 -0400 | [diff] [blame] | 82 | void setForcedDisplayDensityForUser(int displayId, int density, int userId); |
| 83 | void clearForcedDisplayDensityForUser(int displayId, int userId); |
Jeff Brown | d46747a | 2015-04-15 19:02:36 -0700 | [diff] [blame] | 84 | void setForcedDisplayScalingMode(int displayId, int mode); // 0 = auto, 1 = disable |
Dianne Hackborn | 7916ac6 | 2011-05-16 20:45:48 -0700 | [diff] [blame] | 85 | |
Dianne Hackborn | c652de8 | 2013-02-15 16:32:56 -0800 | [diff] [blame] | 86 | void setOverscan(int displayId, int left, int top, int right, int bottom); |
| 87 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 88 | // 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] | 89 | void setEventDispatching(boolean enabled); |
Wale Ogunwale | ac2561e | 2016-11-01 15:43:46 -0700 | [diff] [blame] | 90 | void addWindowToken(IBinder token, int type, int displayId); |
| 91 | void removeWindowToken(IBinder token, int displayId); |
Dianne Hackborn | 7da6ac3 | 2010-12-09 19:22:04 -0800 | [diff] [blame] | 92 | void prepareAppTransition(int transit, boolean alwaysKeepCurrent); |
Jorim Jaggi | 2f7d292 | 2015-10-29 13:08:29 +0100 | [diff] [blame] | 93 | |
| 94 | /** |
| 95 | * Like overridePendingAppTransitionMultiThumb, but uses a future to supply the specs. This is |
| 96 | * used for recents, where generating the thumbnails of the specs takes a non-trivial amount of |
| 97 | * time, so we want to move that off the critical path for starting the new activity. |
| 98 | */ |
| 99 | void overridePendingAppTransitionMultiThumbFuture( |
| 100 | IAppTransitionAnimationSpecsFuture specsFuture, IRemoteCallback startedCallback, |
lumark | a483f31 | 2018-11-20 15:24:05 +0800 | [diff] [blame] | 101 | boolean scaleUp, int displayId); |
| 102 | void overridePendingAppTransitionRemote(in RemoteAnimationAdapter remoteAnimationAdapter, |
| 103 | int displayId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 104 | void executeAppTransition(); |
Wale Ogunwale | 3b23239 | 2016-05-13 15:37:13 -0700 | [diff] [blame] | 105 | |
Jorim Jaggi | 66b48df | 2018-04-20 16:23:48 +0200 | [diff] [blame] | 106 | /** |
| 107 | * Used by system ui to report that recents has shown itself. |
| 108 | * @deprecated to be removed once prebuilts are updated |
| 109 | */ |
Filip Gruszczynski | 14b4e57 | 2015-11-03 15:53:55 -0800 | [diff] [blame] | 110 | void endProlongedAnimations(); |
| 111 | |
Dianne Hackborn | 9d9ece3 | 2012-09-10 15:33:52 -0700 | [diff] [blame] | 112 | void startFreezingScreen(int exitAnim, int enterAnim); |
| 113 | void stopFreezingScreen(); |
| 114 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 115 | // these require DISABLE_KEYGUARD permission |
Adrian Roos | 1c8e3c0 | 2018-11-20 20:07:55 +0100 | [diff] [blame] | 116 | /** @deprecated use Activity.setShowWhenLocked instead. */ |
| 117 | void disableKeyguard(IBinder token, String tag, int userId); |
| 118 | /** @deprecated use Activity.setShowWhenLocked instead. */ |
| 119 | void reenableKeyguard(IBinder token, int userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 120 | void exitKeyguardSecurely(IOnKeyguardExitResult callback); |
Mike Lockwood | 520d8bc | 2011-02-18 13:23:13 -0500 | [diff] [blame] | 121 | boolean isKeyguardLocked(); |
| 122 | boolean isKeyguardSecure(); |
Lucas Dupin | c80c67e | 2017-12-04 14:29:10 -0800 | [diff] [blame] | 123 | void dismissKeyguard(IKeyguardDismissCallback callback, CharSequence message); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 124 | |
Evan Rosky | 1839645 | 2016-07-27 15:19:37 -0700 | [diff] [blame] | 125 | // Requires INTERACT_ACROSS_USERS_FULL permission |
| 126 | void setSwitchingUser(boolean switching); |
| 127 | |
Dianne Hackborn | ffa4248 | 2009-09-23 22:20:11 -0700 | [diff] [blame] | 128 | void closeSystemDialogs(String reason); |
Jim Miller | 4eeb4f6 | 2012-11-08 00:04:29 -0800 | [diff] [blame] | 129 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 130 | // These can only be called with the SET_ANIMATON_SCALE permission. |
| 131 | float getAnimationScale(int which); |
| 132 | float[] getAnimationScales(); |
| 133 | void setAnimationScale(int which, float scale); |
| 134 | void setAnimationScales(in float[] scales); |
Jim Miller | 4eeb4f6 | 2012-11-08 00:04:29 -0800 | [diff] [blame] | 135 | |
Dianne Hackborn | eb94fa7 | 2014-06-03 17:48:12 -0700 | [diff] [blame] | 136 | float getCurrentAnimatorScale(); |
| 137 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 138 | // For testing |
| 139 | void setInTouchMode(boolean showFocus); |
Brad Fitzpatrick | 6804433 | 2010-11-22 18:19:48 -0800 | [diff] [blame] | 140 | |
| 141 | // For StrictMode flashing a red border on violations from the UI |
| 142 | // thread. The uid/pid is implicit from the Binder call, and the Window |
| 143 | // Manager uses that to determine whether or not the red border should |
| 144 | // actually be shown. (it will be ignored that pid doesn't have windows |
| 145 | // on screen) |
| 146 | void showStrictModeViolation(boolean on); |
| 147 | |
Brad Fitzpatrick | c1a968a | 2010-11-24 08:56:40 -0800 | [diff] [blame] | 148 | // Proxy to set the system property for whether the flashing |
| 149 | // should be enabled. The 'enabled' value is null or blank for |
| 150 | // the system default (differs per build variant) or any valid |
| 151 | // boolean string as parsed by SystemProperties.getBoolean(). |
| 152 | void setStrictModeVisualIndicatorPreference(String enabled); |
| 153 | |
Sander Alewijnse | d2a1eec | 2014-07-09 12:57:05 +0100 | [diff] [blame] | 154 | /** |
Makoto Onuki | 04ef447 | 2018-03-12 17:29:49 -0700 | [diff] [blame] | 155 | * Set whether screen capture is disabled for all windows of a specific user from |
| 156 | * the device policy cache. |
Sander Alewijnse | d2a1eec | 2014-07-09 12:57:05 +0100 | [diff] [blame] | 157 | */ |
Makoto Onuki | 04ef447 | 2018-03-12 17:29:49 -0700 | [diff] [blame] | 158 | void refreshScreenCaptureDisabled(int userId); |
Sander Alewijnse | d2a1eec | 2014-07-09 12:57:05 +0100 | [diff] [blame] | 159 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 160 | // These can only be called with the SET_ORIENTATION permission. |
| 161 | /** |
Jeff Brown | 01a98dd | 2011-09-20 15:08:29 -0700 | [diff] [blame] | 162 | * Update the current screen rotation based on the current state of |
| 163 | * the world. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 164 | * @param alwaysSendConfiguration Flag to force a new configuration to |
| 165 | * be evaluated. This can be used when there are other parameters in |
| 166 | * configuration that are changing. |
Dianne Hackborn | f87d196 | 2012-04-04 12:48:24 -0700 | [diff] [blame] | 167 | * @param forceRelayout If true, the window manager will always do a relayout |
| 168 | * 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] | 169 | */ |
Dianne Hackborn | f87d196 | 2012-04-04 12:48:24 -0700 | [diff] [blame] | 170 | void updateRotation(boolean alwaysSendConfiguration, boolean forceRelayout); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 171 | |
| 172 | /** |
Andrii Kulian | 8ee7285 | 2017-03-10 10:36:45 -0800 | [diff] [blame] | 173 | * Retrieve the current orientation of the primary screen. |
| 174 | * @return Constant as per {@link android.view.Surface.Rotation}. |
| 175 | * |
| 176 | * @see android.view.Display#DEFAULT_DISPLAY |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 177 | */ |
Andrii Kulian | 8ee7285 | 2017-03-10 10:36:45 -0800 | [diff] [blame] | 178 | int getDefaultDisplayRotation(); |
Jim Miller | 4eeb4f6 | 2012-11-08 00:04:29 -0800 | [diff] [blame] | 179 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 180 | /** |
Andrii Kulian | 35fa3c2 | 2017-03-11 09:37:28 -0800 | [diff] [blame] | 181 | * 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] | 182 | * calls back when it changes. |
| 183 | */ |
Andrii Kulian | 35fa3c2 | 2017-03-11 09:37:28 -0800 | [diff] [blame] | 184 | int watchRotation(IRotationWatcher watcher, int displayId); |
Daniel Sandler | b73617d | 2010-08-17 00:41:00 -0400 | [diff] [blame] | 185 | |
Adam Powell | dfee59a | 2011-08-05 20:48:30 -0700 | [diff] [blame] | 186 | /** |
Brian Colonna | b1b9a8a | 2013-03-29 11:52:42 -0400 | [diff] [blame] | 187 | * Remove a rotation watcher set using watchRotation. |
| 188 | * @hide |
| 189 | */ |
| 190 | void removeRotationWatcher(IRotationWatcher watcher); |
| 191 | |
| 192 | /** |
Adam Powell | dfee59a | 2011-08-05 20:48:30 -0700 | [diff] [blame] | 193 | * 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] | 194 | * |
| 195 | * @param displayId Id of the display where the menu window currently resides. |
| 196 | * @return a Gravity value for the options menu panel. |
Adam Powell | dfee59a | 2011-08-05 20:48:30 -0700 | [diff] [blame] | 197 | * @hide |
| 198 | */ |
Riddle Hsu | a4d6fa2 | 2018-08-11 00:50:39 +0800 | [diff] [blame] | 199 | int getPreferredOptionsPanelGravity(int displayId); |
Adam Powell | dfee59a | 2011-08-05 20:48:30 -0700 | [diff] [blame] | 200 | |
Jim Miller | 4eeb4f6 | 2012-11-08 00:04:29 -0800 | [diff] [blame] | 201 | /** |
Garfield Tan | 90c9005 | 2018-10-08 12:29:41 -0700 | [diff] [blame] | 202 | * Equivalent to calling {@link #freezeDisplayRotation(int, int)} with {@link |
| 203 | * android.view.Display#DEFAULT_DISPLAY} and given rotation. |
Jim Miller | 4eeb4f6 | 2012-11-08 00:04:29 -0800 | [diff] [blame] | 204 | */ |
| 205 | void freezeRotation(int rotation); |
Daniel Sandler | b73617d | 2010-08-17 00:41:00 -0400 | [diff] [blame] | 206 | |
Jim Miller | 4eeb4f6 | 2012-11-08 00:04:29 -0800 | [diff] [blame] | 207 | /** |
Garfield Tan | 90c9005 | 2018-10-08 12:29:41 -0700 | [diff] [blame] | 208 | * Equivalent to calling {@link #thawDisplayRotation(int)} with {@link |
| 209 | * android.view.Display#DEFAULT_DISPLAY}. |
Jim Miller | 4eeb4f6 | 2012-11-08 00:04:29 -0800 | [diff] [blame] | 210 | */ |
| 211 | void thawRotation(); |
Dianne Hackborn | 0aae2d4 | 2010-12-07 23:51:29 -0800 | [diff] [blame] | 212 | |
Jim Miller | 4eeb4f6 | 2012-11-08 00:04:29 -0800 | [diff] [blame] | 213 | /** |
Garfield Tan | 90c9005 | 2018-10-08 12:29:41 -0700 | [diff] [blame] | 214 | * Equivelant to call {@link #isDisplayRotationFrozen(int)} with {@link |
| 215 | * android.view.Display#DEFAULT_DISPLAY}. |
Svetoslav Ganov | 80943d8 | 2013-01-02 10:25:37 -0800 | [diff] [blame] | 216 | */ |
| 217 | boolean isRotationFrozen(); |
| 218 | |
| 219 | /** |
Garfield Tan | 90c9005 | 2018-10-08 12:29:41 -0700 | [diff] [blame] | 220 | * Lock the display orientation to the specified rotation, or to the current |
| 221 | * rotation if -1. Sensor input will be ignored until thawRotation() is called. |
| 222 | * |
| 223 | * @param displayId the ID of display which rotation should be frozen. |
| 224 | * @param rotation one of {@link android.view.Surface#ROTATION_0}, |
| 225 | * {@link android.view.Surface#ROTATION_90}, {@link android.view.Surface#ROTATION_180}, |
| 226 | * {@link android.view.Surface#ROTATION_270} or -1 to freeze it to current rotation. |
| 227 | * @hide |
| 228 | */ |
| 229 | void freezeDisplayRotation(int displayId, int rotation); |
| 230 | |
| 231 | /** |
| 232 | * Release the orientation lock imposed by freezeRotation() on the display. |
| 233 | * |
| 234 | * @param displayId the ID of display which rotation should be thawed. |
| 235 | * @hide |
| 236 | */ |
| 237 | void thawDisplayRotation(int displayId); |
| 238 | |
| 239 | /** |
| 240 | * Gets whether the rotation is frozen on the display. |
| 241 | * |
| 242 | * @param displayId the ID of display which frozen is needed. |
| 243 | * @return Whether the rotation is frozen. |
| 244 | */ |
| 245 | boolean isDisplayRotationFrozen(int displayId); |
| 246 | |
| 247 | /** |
Zak Cohen | 3683fb1 | 2016-07-11 19:47:37 +0100 | [diff] [blame] | 248 | * Screenshot the current wallpaper layer, including the whole screen. |
| 249 | */ |
| 250 | Bitmap screenshotWallpaper(); |
| 251 | |
| 252 | /** |
Lucas Dupin | e157170 | 2017-05-24 14:14:44 -0700 | [diff] [blame] | 253 | * Registers a wallpaper visibility listener. |
| 254 | * @return Current visibility. |
| 255 | */ |
| 256 | boolean registerWallpaperVisibilityListener(IWallpaperVisibilityListener listener, |
| 257 | int displayId); |
| 258 | |
| 259 | /** |
| 260 | * Remove a visibility watcher that was added using registerWallpaperVisibilityListener. |
| 261 | */ |
| 262 | void unregisterWallpaperVisibilityListener(IWallpaperVisibilityListener listener, |
| 263 | int displayId); |
| 264 | |
| 265 | /** |
Dianne Hackborn | 27eac1d | 2015-03-16 17:15:53 -0700 | [diff] [blame] | 266 | * Used only for assist -- request a screenshot of the current application. |
| 267 | */ |
Winson Chung | da2818f | 2017-10-23 16:25:49 -0700 | [diff] [blame] | 268 | boolean requestAssistScreenshot(IAssistDataReceiver receiver); |
Dianne Hackborn | 27eac1d | 2015-03-16 17:15:53 -0700 | [diff] [blame] | 269 | |
| 270 | /** |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 271 | * Called by the status bar to notify Views of changes to System UI visiblity. |
| 272 | */ |
Tiger Huang | 7c610aa | 2018-10-27 00:01:01 +0800 | [diff] [blame] | 273 | oneway void statusBarVisibilityChanged(int displayId, int visibility); |
Jeff Brown | 1a84fd1 | 2011-06-02 01:26:32 -0700 | [diff] [blame] | 274 | |
| 275 | /** |
Winson | ab21660 | 2016-08-09 14:05:20 -0700 | [diff] [blame] | 276 | * Called by System UI to notify of changes to the visibility of Recents. |
| 277 | */ |
| 278 | oneway void setRecentsVisibility(boolean visible); |
| 279 | |
| 280 | /** |
| 281 | * Called by System UI to notify of changes to the visibility of PIP. |
| 282 | */ |
Winson Chung | ac52f28 | 2017-03-30 14:44:52 -0700 | [diff] [blame] | 283 | oneway void setPipVisibility(boolean visible); |
Winson | ab21660 | 2016-08-09 14:05:20 -0700 | [diff] [blame] | 284 | |
Tracy Zhou | 4351308 | 2018-03-08 21:58:36 -0800 | [diff] [blame] | 285 | /** |
| 286 | * Called by System UI to notify of changes to the visibility and height of the shelf. |
| 287 | */ |
| 288 | void setShelfHeight(boolean visible, int shelfHeight); |
| 289 | |
| 290 | /** |
Matthew Ng | 64543e6 | 2018-02-28 17:35:10 -0800 | [diff] [blame] | 291 | * Called by System UI to enable or disable haptic feedback on the navigation bar buttons. |
| 292 | */ |
| 293 | void setNavBarVirtualKeyHapticFeedbackEnabled(boolean enabled); |
| 294 | |
Winson | ab21660 | 2016-08-09 14:05:20 -0700 | [diff] [blame] | 295 | /** |
Charles Chen | ea6e7f0 | 2018-11-19 21:37:45 +0800 | [diff] [blame] | 296 | * Device has a software navigation bar (separate from the status bar) on specific display. |
| 297 | * |
| 298 | * @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] | 299 | */ |
Charles Chen | ea6e7f0 | 2018-11-19 21:37:45 +0800 | [diff] [blame] | 300 | boolean hasNavigationBar(int displayId); |
Jim Miller | 93c518e | 2012-01-17 15:55:31 -0800 | [diff] [blame] | 301 | |
| 302 | /** |
Tracy Zhou | 4351308 | 2018-03-08 21:58:36 -0800 | [diff] [blame] | 303 | * Get the position of the nav bar |
| 304 | */ |
Tiger Huang | 44c0455 | 2018-11-29 20:06:45 +0800 | [diff] [blame] | 305 | int getNavBarPosition(int displayId); |
Matthew Ng | a8f2426 | 2017-12-19 11:54:24 -0800 | [diff] [blame] | 306 | |
| 307 | /** |
Adam Cohen | f752202 | 2012-10-03 20:03:18 -0700 | [diff] [blame] | 308 | * Lock the device immediately with the specified options (can be null). |
Jim Miller | 93c518e | 2012-01-17 15:55:31 -0800 | [diff] [blame] | 309 | */ |
Adam Cohen | f752202 | 2012-10-03 20:03:18 -0700 | [diff] [blame] | 310 | void lockNow(in Bundle options); |
Svetoslav Ganov | c9c9a48 | 2012-07-16 08:46:07 -0700 | [diff] [blame] | 311 | |
| 312 | /** |
Jim Miller | bfec0a8 | 2012-11-05 20:05:22 -0800 | [diff] [blame] | 313 | * Device is in safe mode. |
| 314 | */ |
| 315 | boolean isSafeModeEnabled(); |
Jorim Jaggi | cff0acb | 2014-03-31 16:35:15 +0200 | [diff] [blame] | 316 | |
| 317 | /** |
| 318 | * Enables the screen if all conditions are met. |
| 319 | */ |
| 320 | void enableScreenIfNeeded(); |
Svetoslav | dd137a8 | 2014-04-10 12:48:07 -0700 | [diff] [blame] | 321 | |
| 322 | /** |
Svetoslav | 1376d60 | 2014-03-13 11:17:26 -0700 | [diff] [blame] | 323 | * Clears the frame statistics for a given window. |
| 324 | * |
| 325 | * @param token The window token. |
| 326 | * @return Whether the frame statistics were cleared. |
| 327 | */ |
| 328 | boolean clearWindowContentFrameStats(IBinder token); |
| 329 | |
| 330 | /** |
| 331 | * Gets the content frame statistics for a given window. |
| 332 | * |
| 333 | * @param token The window token. |
| 334 | * @return The frame statistics or null if the window does not exist. |
| 335 | */ |
| 336 | WindowContentFrameStats getWindowContentFrameStats(IBinder token); |
Jorim Jaggi | 61f39a7 | 2015-10-29 16:54:18 +0100 | [diff] [blame] | 337 | |
| 338 | /** |
| 339 | * @return the dock side the current docked stack is at; must be one of the |
| 340 | * WindowManagerGlobal.DOCKED_* values |
| 341 | */ |
| 342 | int getDockedStackSide(); |
| 343 | |
| 344 | /** |
Jorim Jaggi | d47e7e1 | 2016-03-01 09:57:38 +0100 | [diff] [blame] | 345 | * Sets the region the user can touch the divider. This region will be excluded from the region |
| 346 | * which is used to cause a focus switch when dispatching touch. |
| 347 | */ |
| 348 | void setDockedStackDividerTouchRegion(in Rect touchableRegion); |
| 349 | |
| 350 | /** |
Jorim Jaggi | a6c934e | 2015-12-21 13:22:31 +0100 | [diff] [blame] | 351 | * Registers a listener that will be called when the dock divider changes its visibility or when |
| 352 | * the docked stack gets added/removed. |
Filip Gruszczynski | 64cdc14 | 2015-11-29 21:10:07 -0800 | [diff] [blame] | 353 | */ |
Jorim Jaggi | a6c934e | 2015-12-21 13:22:31 +0100 | [diff] [blame] | 354 | void registerDockedStackListener(IDockedStackListener listener); |
Jorim Jaggi | 5098159 | 2015-12-29 17:54:12 +0100 | [diff] [blame] | 355 | |
| 356 | /** |
Winson Chung | 655332c | 2016-10-31 13:14:28 -0700 | [diff] [blame] | 357 | * Registers a listener that will be called when the pinned stack state changes. |
| 358 | */ |
| 359 | void registerPinnedStackListener(int displayId, IPinnedStackListener listener); |
| 360 | |
| 361 | /** |
Jorim Jaggi | 5098159 | 2015-12-29 17:54:12 +0100 | [diff] [blame] | 362 | * Updates the dim layer used while resizing. |
| 363 | * |
| 364 | * @param visible Whether the dim layer should be visible. |
Wale Ogunwale | 6827856 | 2017-09-23 17:13:55 -0700 | [diff] [blame] | 365 | * @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] | 366 | * @param alpha The translucency of the dim layer, between 0 and 1. |
| 367 | */ |
Wale Ogunwale | 6827856 | 2017-09-23 17:13:55 -0700 | [diff] [blame] | 368 | void setResizeDimLayer(boolean visible, int targetWindowingMode, float alpha); |
Clara Bayarri | 75e0979 | 2015-07-29 16:20:40 +0100 | [diff] [blame] | 369 | |
| 370 | /** |
| 371 | * Requests Keyboard Shortcuts from the displayed window. |
| 372 | * |
| 373 | * @param receiver The receiver to deliver the results to. |
| 374 | */ |
Clara Bayarri | fcd7e80 | 2016-03-10 12:58:18 +0000 | [diff] [blame] | 375 | void requestAppKeyboardShortcuts(IResultReceiver receiver, int deviceId); |
Jorim Jaggi | c6c89a8 | 2016-01-28 17:48:21 -0800 | [diff] [blame] | 376 | |
| 377 | /** |
| 378 | * Retrieves the current stable insets from the primary display. |
| 379 | */ |
Winson Chung | 303c6b7 | 2016-10-24 17:12:49 -0700 | [diff] [blame] | 380 | void getStableInsets(int displayId, out Rect outInsets); |
Muyuan Li | 94ce94e | 2016-02-24 16:20:54 -0800 | [diff] [blame] | 381 | |
| 382 | /** |
| 383 | * Register shortcut key. Shortcut code is packed as: |
| 384 | * (MetaState << Integer.SIZE) | KeyCode |
| 385 | * @hide |
| 386 | */ |
| 387 | void registerShortcutKey(in long shortcutCode, IShortcutService keySubscriber); |
Vladislav Kaznacheev | 0d50d86 | 2016-03-29 15:43:28 -0700 | [diff] [blame] | 388 | |
| 389 | /** |
Arthur Hung | 39134b2 | 2018-08-14 11:58:28 +0800 | [diff] [blame] | 390 | * Create an input consumer by name and display id. |
Vladislav Kaznacheev | 0d50d86 | 2016-03-29 15:43:28 -0700 | [diff] [blame] | 391 | */ |
Arthur Hung | 39134b2 | 2018-08-14 11:58:28 +0800 | [diff] [blame] | 392 | void createInputConsumer(IBinder token, String name, int displayId, |
| 393 | out InputChannel inputChannel); |
Vladislav Kaznacheev | 0d50d86 | 2016-03-29 15:43:28 -0700 | [diff] [blame] | 394 | |
| 395 | /** |
Arthur Hung | 39134b2 | 2018-08-14 11:58:28 +0800 | [diff] [blame] | 396 | * Destroy an input consumer by name and display id. |
| 397 | * This method will also dispose the input channels associated with that InputConsumer. |
Vladislav Kaznacheev | 0d50d86 | 2016-03-29 15:43:28 -0700 | [diff] [blame] | 398 | */ |
Arthur Hung | 39134b2 | 2018-08-14 11:58:28 +0800 | [diff] [blame] | 399 | boolean destroyInputConsumer(String name, int displayId); |
Albert Chaulk | 56162a0 | 2017-06-05 19:35:23 -0400 | [diff] [blame] | 400 | |
| 401 | /** |
| 402 | * Return the touch region for the current IME window, or an empty region if there is none. |
| 403 | */ |
| 404 | Region getCurrentImeTouchRegion(); |
Vishnu Nair | c961504 | 2018-01-09 07:23:31 -0800 | [diff] [blame] | 405 | |
| 406 | /** |
Adrian Roos | 962017e | 2018-11-27 15:11:46 +0100 | [diff] [blame] | 407 | * Registers an IDisplayFoldListener. |
| 408 | */ |
| 409 | void registerDisplayFoldListener(IDisplayFoldListener listener); |
| 410 | |
| 411 | /** |
| 412 | * Unregisters an IDisplayFoldListener. |
| 413 | */ |
| 414 | void unregisterDisplayFoldListener(IDisplayFoldListener listener); |
| 415 | |
| 416 | /** |
Vishnu Nair | c961504 | 2018-01-09 07:23:31 -0800 | [diff] [blame] | 417 | * Starts a window trace. |
| 418 | */ |
| 419 | void startWindowTrace(); |
| 420 | |
| 421 | /** |
| 422 | * Stops a window trace. |
| 423 | */ |
| 424 | void stopWindowTrace(); |
| 425 | |
| 426 | /** |
| 427 | * Returns true if window trace is enabled. |
| 428 | */ |
| 429 | boolean isWindowTraceEnabled(); |
Yoshiaki Naka | e1bdfc82 | 2017-09-15 15:24:34 +0900 | [diff] [blame] | 430 | |
| 431 | /** |
Jordan Liu | c022876 | 2018-07-13 11:39:42 -0700 | [diff] [blame] | 432 | * Requests that the WindowManager sends |
| 433 | * WindowManagerPolicyConstants#ACTION_USER_ACTIVITY_NOTIFICATION on the next user activity. |
Yoshiaki Naka | e1bdfc82 | 2017-09-15 15:24:34 +0900 | [diff] [blame] | 434 | */ |
| 435 | void requestUserActivityNotification(); |
Andrii Kulian | f0379de | 2018-03-14 16:24:07 -0700 | [diff] [blame] | 436 | |
| 437 | /** |
| 438 | * Notify WindowManager that it should not override the info in DisplayManager for the specified |
| 439 | * display. This can disable letter- or pillar-boxing applied in DisplayManager when the metrics |
| 440 | * of the logical display reported from WindowManager do not correspond to the metrics of the |
| 441 | * physical display it is based on. |
| 442 | * |
| 443 | * @param displayId The id of the display. |
| 444 | */ |
| 445 | void dontOverrideDisplayInfo(int displayId); |
Chilun | 8753ad3 | 2018-10-09 15:56:45 +0800 | [diff] [blame] | 446 | |
| 447 | /** |
| 448 | * Gets the windowing mode of the display. |
| 449 | * |
| 450 | * @param displayId The id of the display. |
| 451 | * @return {@link WindowConfiguration.WindowingMode} |
| 452 | */ |
| 453 | int getWindowingMode(int displayId); |
| 454 | |
| 455 | /** |
| 456 | * Sets the windowing mode of the display. |
| 457 | * |
| 458 | * @param displayId The id of the display. |
| 459 | * @param mode {@link WindowConfiguration.WindowingMode} |
| 460 | */ |
| 461 | void setWindowingMode(int displayId, int mode); |
| 462 | |
| 463 | /** |
| 464 | * Gets current remove content mode of the display. |
| 465 | * <p> |
| 466 | * What actions should be performed with the display's content when it is removed. Default |
| 467 | * behavior for public displays in this case is to move all activities to the primary display |
| 468 | * and make it focused. For private display is to destroy all activities. |
| 469 | * </p> |
| 470 | * |
| 471 | * @param displayId The id of the display. |
| 472 | * @return The remove content mode of the display. |
| 473 | * @see WindowManager#REMOVE_CONTENT_MODE_MOVE_TO_PRIMARY |
| 474 | * @see WindowManager#REMOVE_CONTENT_MODE_DESTROY |
| 475 | */ |
| 476 | int getRemoveContentMode(int displayId); |
| 477 | |
| 478 | /** |
| 479 | * Sets the remove content mode of the display. |
| 480 | * <p> |
| 481 | * This mode indicates what actions should be performed with the display's content when it is |
| 482 | * removed. |
| 483 | * </p> |
| 484 | * |
| 485 | * @param displayId The id of the display. |
| 486 | * @param mode Remove content mode. |
| 487 | * @see WindowManager#REMOVE_CONTENT_MODE_MOVE_TO_PRIMARY |
| 488 | * @see WindowManager#REMOVE_CONTENT_MODE_DESTROY |
| 489 | */ |
| 490 | void setRemoveContentMode(int displayId, int mode); |
| 491 | |
| 492 | /** |
| 493 | * Indicates that the display should show its content when non-secure keyguard is shown. |
| 494 | * <p> |
| 495 | * This flag identifies secondary displays that will continue showing content if keyguard can be |
| 496 | * dismissed without entering credentials. |
| 497 | * </p><p> |
| 498 | * An example of usage is a virtual display which content is displayed on external hardware |
| 499 | * display that is not visible to the system directly. |
| 500 | * </p> |
| 501 | * |
| 502 | * @param displayId The id of the display. |
| 503 | * @return {@code true} if the display should show its content when non-secure keyguard is |
| 504 | * shown. |
| 505 | * @see KeyguardManager#isDeviceSecure() |
| 506 | * @see KeyguardManager#isDeviceLocked() |
| 507 | */ |
| 508 | boolean shouldShowWithInsecureKeyguard(int displayId); |
| 509 | |
| 510 | /** |
| 511 | * Sets that the display should show its content when non-secure keyguard is shown. |
| 512 | * |
| 513 | * @param displayId The id of the display. |
| 514 | * @param shouldShow Indicates that the display should show its content when non-secure keyguard |
| 515 | * is shown. |
| 516 | * @see KeyguardManager#isDeviceSecure() |
| 517 | * @see KeyguardManager#isDeviceLocked() |
| 518 | */ |
| 519 | void setShouldShowWithInsecureKeyguard(int displayId, boolean shouldShow); |
| 520 | |
| 521 | /** |
| 522 | * Indicates the display should show system decors. |
| 523 | * <p> |
| 524 | * System decors include status bar, navigation bar, launcher. |
| 525 | * </p> |
| 526 | * |
| 527 | * @param displayId The id of the display. |
| 528 | * @return {@code true} if the display should show system decors. |
| 529 | */ |
| 530 | boolean shouldShowSystemDecors(int displayId); |
| 531 | |
| 532 | /** |
| 533 | * Sets that the display should show system decors. |
| 534 | * <p> |
| 535 | * System decors include status bar, navigation bar, launcher. |
| 536 | * </p> |
| 537 | * |
| 538 | * @param displayId The id of the display. |
| 539 | * @param shouldShow Indicates that the display should show system decors. |
| 540 | */ |
| 541 | void setShouldShowSystemDecors(int displayId, boolean shouldShow); |
| 542 | |
| 543 | /** |
| 544 | * Indicates that the display should show IME. |
| 545 | * |
| 546 | * @param displayId The id of the display. |
| 547 | * @return {@code true} if the display should show IME. |
| 548 | * @see KeyguardManager#isDeviceSecure() |
| 549 | * @see KeyguardManager#isDeviceLocked() |
| 550 | */ |
| 551 | boolean shouldShowIme(int displayId); |
| 552 | |
| 553 | /** |
| 554 | * Sets that the display should show IME. |
| 555 | * |
| 556 | * @param displayId The id of the display. |
| 557 | * @param shouldShow Indicates that the display should show IME. |
| 558 | * @see KeyguardManager#isDeviceSecure() |
| 559 | * @see KeyguardManager#isDeviceLocked() |
| 560 | */ |
| 561 | void setShouldShowIme(int displayId, boolean shouldShow); |
chaviw | ff2e7d8 | 2018-11-02 11:11:27 -0700 | [diff] [blame] | 562 | |
| 563 | /** |
| 564 | * Reparent the top layers for a display to the requested surfaceControl. The display that |
| 565 | * is going to be re-parented (the displayId passed in) needs to have been created by the same |
| 566 | * process that is requesting the re-parent. This is to ensure clients can't just re-parent |
| 567 | * display content info to any SurfaceControl, as this would be a security issue. |
| 568 | * |
| 569 | * @param displayId The id of the display. |
Robert Carr | 10584fa | 2019-01-14 15:55:19 -0800 | [diff] [blame] | 570 | * @param surfaceControlHandle The SurfaceControl that the top level layers for the |
chaviw | ff2e7d8 | 2018-11-02 11:11:27 -0700 | [diff] [blame] | 571 | * display should be re-parented to. |
| 572 | */ |
Robert Carr | 10584fa | 2019-01-14 15:55:19 -0800 | [diff] [blame] | 573 | void reparentDisplayContent(int displayId, in SurfaceControl sc); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 574 | } |