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