blob: e32c4e136a6ee7656279ba2e38b780a5935a02a1 [file] [log] [blame]
Dianne Hackborn7da6ac32010-12-09 19:22:04 -08001/*
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002** Copyright 2006, The Android Open Source Project
3**
Jim Miller4eeb4f62012-11-08 00:04:29 -08004** 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 Project9066cfe2009-03-03 19:31:44 -08007**
Jim Miller4eeb4f62012-11-08 00:04:29 -08008** http://www.apache.org/licenses/LICENSE-2.0
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08009**
Jim Miller4eeb4f62012-11-08 00:04:29 -080010** 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 Project9066cfe2009-03-03 19:31:44 -080014** limitations under the License.
15*/
16
17package android.view;
18
Clara Bayarri75e09792015-07-29 16:20:40 +010019import com.android.internal.os.IResultReceiver;
Jorim Jaggi241ae102016-11-02 21:57:33 -070020import com.android.internal.policy.IKeyguardDismissCallback;
Muyuan Li94ce94e2016-02-24 16:20:54 -080021import com.android.internal.policy.IShortcutService;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080022
Winson Chunge2104682017-11-08 17:31:14 -080023import android.app.IAssistDataReceiver;
Dianne Hackborn2f0b1752011-05-31 17:59:49 -070024import android.content.res.CompatibilityInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080025import android.content.res.Configuration;
Dianne Hackborn0aae2d42010-12-07 23:51:29 -080026import android.graphics.Bitmap;
Winson Chunga31922f2017-05-24 15:50:06 -070027import android.graphics.GraphicBuffer;
Issei Suzukia5dbf522019-02-01 17:58:15 +010028import android.graphics.Insets;
Dianne Hackbornac8dea12011-04-20 18:18:51 -070029import android.graphics.Point;
Svetoslav Ganovc9c9a482012-07-16 08:46:07 -070030import android.graphics.Rect;
Albert Chaulk56162a02017-06-05 19:35:23 -040031import android.graphics.Region;
Adam Cohenf7522022012-10-03 20:03:18 -070032import android.os.Bundle;
Dianne Hackborn38e29a62011-09-18 14:43:08 -070033import android.os.IRemoteCallback;
Robert Carr3b716242016-08-16 16:02:21 -070034import android.os.ParcelFileDescriptor;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080035import android.view.IApplicationToken;
Jorim Jaggi2f7d2922015-10-29 13:08:29 +010036import android.view.IAppTransitionAnimationSpecsFuture;
Jorim Jaggia6c934e2015-12-21 13:22:31 +010037import android.view.IDockedStackListener;
Adrian Roos962017e2018-11-27 15:11:46 +010038import android.view.IDisplayFoldListener;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080039import android.view.IOnKeyguardExitResult;
Winson Chung655332c2016-10-31 13:14:28 -070040import android.view.IPinnedStackListener;
Jorim Jaggi33a701a2017-12-01 14:58:18 +010041import android.view.RemoteAnimationAdapter;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080042import android.view.IRotationWatcher;
Lucas Dupine1571702017-05-24 14:14:44 -070043import android.view.IWallpaperVisibilityListener;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080044import android.view.IWindowSession;
Dianne Hackborneb94fa72014-06-03 17:48:12 -070045import android.view.IWindowSessionCallback;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080046import android.view.KeyEvent;
Jeff Brown6ec402b2010-07-28 15:48:59 -070047import android.view.InputEvent;
Svetoslav Ganov152e9bb2012-10-12 20:15:29 -070048import android.view.MagnificationSpec;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080049import android.view.MotionEvent;
Jeff Browna41ca772010-08-11 14:46:32 -070050import android.view.InputChannel;
Jeff Brown8d608662010-08-30 03:02:23 -070051import android.view.InputDevice;
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -070052import android.view.IInputFilter;
Filip Gruszczynski170192a2015-08-16 17:46:34 -070053import android.view.AppTransitionAnimationSpec;
Svetoslav1376d602014-03-13 11:17:26 -070054import android.view.WindowContentFrameStats;
Jorim Jaggie2c77f92016-12-29 14:57:22 +010055import android.view.WindowManager;
Robert Carr10584fa2019-01-14 15:55:19 -080056import android.view.SurfaceControl;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080057
58/**
59 * System private interface to the window manager.
60 *
61 * {@hide}
62 */
63interface IWindowManager
64{
65 /**
66 * ===== NOTICE =====
67 * The first three methods must remain the first three methods. Scripts
68 * and tools rely on their transaction number to work properly.
69 */
70 // This is used for debugging
71 boolean startViewServer(int port); // Transaction #1
72 boolean stopViewServer(); // Transaction #2
73 boolean isViewServerRunning(); // Transaction #3
74
Yohei Yukawaa71bb252018-09-19 19:21:24 -070075 IWindowSession openSession(in IWindowSessionCallback callback);
Dianne Hackbornac8dea12011-04-20 18:18:51 -070076
Andrei Oneaf4fb6fb2019-02-27 14:46:52 +000077 @UnsupportedAppUsage
Dianne Hackborn672cf452013-03-26 15:24:24 -070078 void getInitialDisplaySize(int displayId, out Point size);
Andrei Oneaf4fb6fb2019-02-27 14:46:52 +000079 @UnsupportedAppUsage
Dianne Hackborn672cf452013-03-26 15:24:24 -070080 void getBaseDisplaySize(int displayId, out Point size);
Jeff Brown43aa1592012-09-10 17:36:31 -070081 void setForcedDisplaySize(int displayId, int width, int height);
Craig Mautner59c00972012-07-30 12:10:24 -070082 void clearForcedDisplaySize(int displayId);
Andrei Oneaf4fb6fb2019-02-27 14:46:52 +000083 @UnsupportedAppUsage
Dianne Hackborn672cf452013-03-26 15:24:24 -070084 int getInitialDisplayDensity(int displayId);
85 int getBaseDisplayDensity(int displayId);
Alan Viverettedf3a7ca2016-09-06 17:13:41 -040086 void setForcedDisplayDensityForUser(int displayId, int density, int userId);
87 void clearForcedDisplayDensityForUser(int displayId, int userId);
Jeff Brownd46747a2015-04-15 19:02:36 -070088 void setForcedDisplayScalingMode(int displayId, int mode); // 0 = auto, 1 = disable
Dianne Hackborn7916ac62011-05-16 20:45:48 -070089
Dianne Hackbornc652de82013-02-15 16:32:56 -080090 void setOverscan(int displayId, int left, int top, int right, int bottom);
91
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080092 // These can only be called when holding the MANAGE_APP_TOKENS permission.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080093 void setEventDispatching(boolean enabled);
Wale Ogunwaleac2561e2016-11-01 15:43:46 -070094 void addWindowToken(IBinder token, int type, int displayId);
95 void removeWindowToken(IBinder token, int displayId);
Dianne Hackborn7da6ac32010-12-09 19:22:04 -080096 void prepareAppTransition(int transit, boolean alwaysKeepCurrent);
Jorim Jaggi2f7d2922015-10-29 13:08:29 +010097
98 /**
99 * Like overridePendingAppTransitionMultiThumb, but uses a future to supply the specs. This is
100 * used for recents, where generating the thumbnails of the specs takes a non-trivial amount of
101 * time, so we want to move that off the critical path for starting the new activity.
102 */
Andrei Oneaf4fb6fb2019-02-27 14:46:52 +0000103 @UnsupportedAppUsage
Jorim Jaggi2f7d2922015-10-29 13:08:29 +0100104 void overridePendingAppTransitionMultiThumbFuture(
105 IAppTransitionAnimationSpecsFuture specsFuture, IRemoteCallback startedCallback,
lumarka483f312018-11-20 15:24:05 +0800106 boolean scaleUp, int displayId);
Andrei Oneaf4fb6fb2019-02-27 14:46:52 +0000107 @UnsupportedAppUsage
lumarka483f312018-11-20 15:24:05 +0800108 void overridePendingAppTransitionRemote(in RemoteAnimationAdapter remoteAnimationAdapter,
109 int displayId);
Andrei Oneaf4fb6fb2019-02-27 14:46:52 +0000110 @UnsupportedAppUsage
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800111 void executeAppTransition();
Wale Ogunwale3b232392016-05-13 15:37:13 -0700112
Jorim Jaggi66b48df2018-04-20 16:23:48 +0200113 /**
114 * Used by system ui to report that recents has shown itself.
115 * @deprecated to be removed once prebuilts are updated
116 */
Andrei Oneaf4fb6fb2019-02-27 14:46:52 +0000117 @UnsupportedAppUsage
Filip Gruszczynski14b4e572015-11-03 15:53:55 -0800118 void endProlongedAnimations();
119
Dianne Hackborn9d9ece32012-09-10 15:33:52 -0700120 void startFreezingScreen(int exitAnim, int enterAnim);
121 void stopFreezingScreen();
122
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800123 // these require DISABLE_KEYGUARD permission
Adrian Roos1c8e3c02018-11-20 20:07:55 +0100124 /** @deprecated use Activity.setShowWhenLocked instead. */
125 void disableKeyguard(IBinder token, String tag, int userId);
126 /** @deprecated use Activity.setShowWhenLocked instead. */
127 void reenableKeyguard(IBinder token, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800128 void exitKeyguardSecurely(IOnKeyguardExitResult callback);
Andrei Oneaf4fb6fb2019-02-27 14:46:52 +0000129 @UnsupportedAppUsage
Mike Lockwood520d8bc2011-02-18 13:23:13 -0500130 boolean isKeyguardLocked();
Andrei Oneaf4fb6fb2019-02-27 14:46:52 +0000131 @UnsupportedAppUsage
Mike Lockwood520d8bc2011-02-18 13:23:13 -0500132 boolean isKeyguardSecure();
Lucas Dupinc80c67e2017-12-04 14:29:10 -0800133 void dismissKeyguard(IKeyguardDismissCallback callback, CharSequence message);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800134
Evan Rosky18396452016-07-27 15:19:37 -0700135 // Requires INTERACT_ACROSS_USERS_FULL permission
136 void setSwitchingUser(boolean switching);
137
Dianne Hackbornffa42482009-09-23 22:20:11 -0700138 void closeSystemDialogs(String reason);
Jim Miller4eeb4f62012-11-08 00:04:29 -0800139
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800140 // These can only be called with the SET_ANIMATON_SCALE permission.
Andrei Oneaf4fb6fb2019-02-27 14:46:52 +0000141 @UnsupportedAppUsage
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800142 float getAnimationScale(int which);
Andrei Oneaf4fb6fb2019-02-27 14:46:52 +0000143 @UnsupportedAppUsage
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800144 float[] getAnimationScales();
Andrei Oneaf4fb6fb2019-02-27 14:46:52 +0000145 @UnsupportedAppUsage
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800146 void setAnimationScale(int which, float scale);
Andrei Oneaf4fb6fb2019-02-27 14:46:52 +0000147 @UnsupportedAppUsage
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800148 void setAnimationScales(in float[] scales);
Jim Miller4eeb4f62012-11-08 00:04:29 -0800149
Dianne Hackborneb94fa72014-06-03 17:48:12 -0700150 float getCurrentAnimatorScale();
151
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800152 // For testing
153 void setInTouchMode(boolean showFocus);
Brad Fitzpatrick68044332010-11-22 18:19:48 -0800154
155 // For StrictMode flashing a red border on violations from the UI
156 // thread. The uid/pid is implicit from the Binder call, and the Window
157 // Manager uses that to determine whether or not the red border should
158 // actually be shown. (it will be ignored that pid doesn't have windows
159 // on screen)
160 void showStrictModeViolation(boolean on);
161
Brad Fitzpatrickc1a968a2010-11-24 08:56:40 -0800162 // Proxy to set the system property for whether the flashing
163 // should be enabled. The 'enabled' value is null or blank for
164 // the system default (differs per build variant) or any valid
165 // boolean string as parsed by SystemProperties.getBoolean().
Andrei Oneaf4fb6fb2019-02-27 14:46:52 +0000166 @UnsupportedAppUsage
Brad Fitzpatrickc1a968a2010-11-24 08:56:40 -0800167 void setStrictModeVisualIndicatorPreference(String enabled);
168
Sander Alewijnsed2a1eec2014-07-09 12:57:05 +0100169 /**
Makoto Onuki04ef4472018-03-12 17:29:49 -0700170 * Set whether screen capture is disabled for all windows of a specific user from
171 * the device policy cache.
Sander Alewijnsed2a1eec2014-07-09 12:57:05 +0100172 */
Makoto Onuki04ef4472018-03-12 17:29:49 -0700173 void refreshScreenCaptureDisabled(int userId);
Sander Alewijnsed2a1eec2014-07-09 12:57:05 +0100174
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800175 // These can only be called with the SET_ORIENTATION permission.
176 /**
Jeff Brown01a98dd2011-09-20 15:08:29 -0700177 * Update the current screen rotation based on the current state of
178 * the world.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800179 * @param alwaysSendConfiguration Flag to force a new configuration to
180 * be evaluated. This can be used when there are other parameters in
181 * configuration that are changing.
Dianne Hackbornf87d1962012-04-04 12:48:24 -0700182 * @param forceRelayout If true, the window manager will always do a relayout
183 * of its windows even if the rotation hasn't changed.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800184 */
Dianne Hackbornf87d1962012-04-04 12:48:24 -0700185 void updateRotation(boolean alwaysSendConfiguration, boolean forceRelayout);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800186
187 /**
Andrii Kulian8ee72852017-03-10 10:36:45 -0800188 * Retrieve the current orientation of the primary screen.
189 * @return Constant as per {@link android.view.Surface.Rotation}.
190 *
191 * @see android.view.Display#DEFAULT_DISPLAY
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800192 */
Andrii Kulian8ee72852017-03-10 10:36:45 -0800193 int getDefaultDisplayRotation();
Jim Miller4eeb4f62012-11-08 00:04:29 -0800194
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800195 /**
Andrii Kulian35fa3c22017-03-11 09:37:28 -0800196 * Watch the rotation of the specified screen. Returns the current rotation,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800197 * calls back when it changes.
198 */
Andrii Kulian35fa3c22017-03-11 09:37:28 -0800199 int watchRotation(IRotationWatcher watcher, int displayId);
Daniel Sandlerb73617d2010-08-17 00:41:00 -0400200
Adam Powelldfee59a2011-08-05 20:48:30 -0700201 /**
Brian Colonnab1b9a8a2013-03-29 11:52:42 -0400202 * Remove a rotation watcher set using watchRotation.
203 * @hide
204 */
Andrei Oneaf4fb6fb2019-02-27 14:46:52 +0000205 @UnsupportedAppUsage
Brian Colonnab1b9a8a2013-03-29 11:52:42 -0400206 void removeRotationWatcher(IRotationWatcher watcher);
207
208 /**
Adam Powelldfee59a2011-08-05 20:48:30 -0700209 * Determine the preferred edge of the screen to pin the compact options menu against.
Riddle Hsua4d6fa22018-08-11 00:50:39 +0800210 *
211 * @param displayId Id of the display where the menu window currently resides.
212 * @return a Gravity value for the options menu panel.
Adam Powelldfee59a2011-08-05 20:48:30 -0700213 * @hide
214 */
Riddle Hsua4d6fa22018-08-11 00:50:39 +0800215 int getPreferredOptionsPanelGravity(int displayId);
Adam Powelldfee59a2011-08-05 20:48:30 -0700216
Jim Miller4eeb4f62012-11-08 00:04:29 -0800217 /**
Garfield Tan90c90052018-10-08 12:29:41 -0700218 * Equivalent to calling {@link #freezeDisplayRotation(int, int)} with {@link
219 * android.view.Display#DEFAULT_DISPLAY} and given rotation.
Jim Miller4eeb4f62012-11-08 00:04:29 -0800220 */
Andrei Oneaf4fb6fb2019-02-27 14:46:52 +0000221 @UnsupportedAppUsage
Jim Miller4eeb4f62012-11-08 00:04:29 -0800222 void freezeRotation(int rotation);
Daniel Sandlerb73617d2010-08-17 00:41:00 -0400223
Jim Miller4eeb4f62012-11-08 00:04:29 -0800224 /**
Garfield Tan90c90052018-10-08 12:29:41 -0700225 * Equivalent to calling {@link #thawDisplayRotation(int)} with {@link
226 * android.view.Display#DEFAULT_DISPLAY}.
Jim Miller4eeb4f62012-11-08 00:04:29 -0800227 */
Andrei Oneaf4fb6fb2019-02-27 14:46:52 +0000228 @UnsupportedAppUsage
Jim Miller4eeb4f62012-11-08 00:04:29 -0800229 void thawRotation();
Dianne Hackborn0aae2d42010-12-07 23:51:29 -0800230
Jim Miller4eeb4f62012-11-08 00:04:29 -0800231 /**
Garfield Tan90c90052018-10-08 12:29:41 -0700232 * Equivelant to call {@link #isDisplayRotationFrozen(int)} with {@link
233 * android.view.Display#DEFAULT_DISPLAY}.
Svetoslav Ganov80943d82013-01-02 10:25:37 -0800234 */
235 boolean isRotationFrozen();
236
237 /**
Garfield Tan90c90052018-10-08 12:29:41 -0700238 * Lock the display orientation to the specified rotation, or to the current
239 * rotation if -1. Sensor input will be ignored until thawRotation() is called.
240 *
241 * @param displayId the ID of display which rotation should be frozen.
242 * @param rotation one of {@link android.view.Surface#ROTATION_0},
243 * {@link android.view.Surface#ROTATION_90}, {@link android.view.Surface#ROTATION_180},
244 * {@link android.view.Surface#ROTATION_270} or -1 to freeze it to current rotation.
245 * @hide
246 */
247 void freezeDisplayRotation(int displayId, int rotation);
248
249 /**
250 * Release the orientation lock imposed by freezeRotation() on the display.
251 *
252 * @param displayId the ID of display which rotation should be thawed.
253 * @hide
254 */
255 void thawDisplayRotation(int displayId);
256
257 /**
258 * Gets whether the rotation is frozen on the display.
259 *
260 * @param displayId the ID of display which frozen is needed.
261 * @return Whether the rotation is frozen.
262 */
263 boolean isDisplayRotationFrozen(int displayId);
264
265 /**
Zak Cohen3683fb12016-07-11 19:47:37 +0100266 * Screenshot the current wallpaper layer, including the whole screen.
267 */
268 Bitmap screenshotWallpaper();
269
270 /**
Lucas Dupine1571702017-05-24 14:14:44 -0700271 * Registers a wallpaper visibility listener.
272 * @return Current visibility.
273 */
274 boolean registerWallpaperVisibilityListener(IWallpaperVisibilityListener listener,
275 int displayId);
276
277 /**
278 * Remove a visibility watcher that was added using registerWallpaperVisibilityListener.
279 */
280 void unregisterWallpaperVisibilityListener(IWallpaperVisibilityListener listener,
281 int displayId);
282
283 /**
Dianne Hackborn27eac1d2015-03-16 17:15:53 -0700284 * Used only for assist -- request a screenshot of the current application.
285 */
Winson Chungda2818f2017-10-23 16:25:49 -0700286 boolean requestAssistScreenshot(IAssistDataReceiver receiver);
Dianne Hackborn27eac1d2015-03-16 17:15:53 -0700287
288 /**
Joe Onorato664644d2011-01-23 17:53:23 -0800289 * Called by the status bar to notify Views of changes to System UI visiblity.
290 */
Tiger Huang7c610aa2018-10-27 00:01:01 +0800291 oneway void statusBarVisibilityChanged(int displayId, int visibility);
Jeff Brown1a84fd12011-06-02 01:26:32 -0700292
293 /**
Winsonab216602016-08-09 14:05:20 -0700294 * Called by System UI to notify of changes to the visibility of Recents.
295 */
296 oneway void setRecentsVisibility(boolean visible);
297
298 /**
299 * Called by System UI to notify of changes to the visibility of PIP.
300 */
Winson Chungac52f282017-03-30 14:44:52 -0700301 oneway void setPipVisibility(boolean visible);
Winsonab216602016-08-09 14:05:20 -0700302
Tracy Zhou43513082018-03-08 21:58:36 -0800303 /**
304 * Called by System UI to notify of changes to the visibility and height of the shelf.
305 */
Andrei Oneaf4fb6fb2019-02-27 14:46:52 +0000306 @UnsupportedAppUsage
Tracy Zhou43513082018-03-08 21:58:36 -0800307 void setShelfHeight(boolean visible, int shelfHeight);
308
309 /**
Matthew Ng64543e62018-02-28 17:35:10 -0800310 * Called by System UI to enable or disable haptic feedback on the navigation bar buttons.
311 */
Andrei Oneaf4fb6fb2019-02-27 14:46:52 +0000312 @UnsupportedAppUsage
Matthew Ng64543e62018-02-28 17:35:10 -0800313 void setNavBarVirtualKeyHapticFeedbackEnabled(boolean enabled);
314
Winsonab216602016-08-09 14:05:20 -0700315 /**
Charles Chenea6e7f02018-11-19 21:37:45 +0800316 * Device has a software navigation bar (separate from the status bar) on specific display.
317 *
318 * @param displayId the id of display to check if there is a software navigation bar.
Daniel Sandler0c4ccff2011-10-19 16:39:14 -0400319 */
Andrei Oneaf4fb6fb2019-02-27 14:46:52 +0000320 @UnsupportedAppUsage
Charles Chenea6e7f02018-11-19 21:37:45 +0800321 boolean hasNavigationBar(int displayId);
Jim Miller93c518e2012-01-17 15:55:31 -0800322
323 /**
Tracy Zhou43513082018-03-08 21:58:36 -0800324 * Get the position of the nav bar
325 */
Tiger Huang44c04552018-11-29 20:06:45 +0800326 int getNavBarPosition(int displayId);
Matthew Nga8f24262017-12-19 11:54:24 -0800327
328 /**
Adam Cohenf7522022012-10-03 20:03:18 -0700329 * Lock the device immediately with the specified options (can be null).
Jim Miller93c518e2012-01-17 15:55:31 -0800330 */
Andrei Oneaf4fb6fb2019-02-27 14:46:52 +0000331 @UnsupportedAppUsage
Adam Cohenf7522022012-10-03 20:03:18 -0700332 void lockNow(in Bundle options);
Svetoslav Ganovc9c9a482012-07-16 08:46:07 -0700333
334 /**
Jim Millerbfec0a82012-11-05 20:05:22 -0800335 * Device is in safe mode.
336 */
Andrei Oneaf4fb6fb2019-02-27 14:46:52 +0000337 @UnsupportedAppUsage
Jim Millerbfec0a82012-11-05 20:05:22 -0800338 boolean isSafeModeEnabled();
Jorim Jaggicff0acb2014-03-31 16:35:15 +0200339
340 /**
341 * Enables the screen if all conditions are met.
342 */
343 void enableScreenIfNeeded();
Svetoslavdd137a82014-04-10 12:48:07 -0700344
345 /**
Svetoslav1376d602014-03-13 11:17:26 -0700346 * Clears the frame statistics for a given window.
347 *
348 * @param token The window token.
349 * @return Whether the frame statistics were cleared.
350 */
351 boolean clearWindowContentFrameStats(IBinder token);
352
353 /**
354 * Gets the content frame statistics for a given window.
355 *
356 * @param token The window token.
357 * @return The frame statistics or null if the window does not exist.
358 */
359 WindowContentFrameStats getWindowContentFrameStats(IBinder token);
Jorim Jaggi61f39a72015-10-29 16:54:18 +0100360
361 /**
362 * @return the dock side the current docked stack is at; must be one of the
363 * WindowManagerGlobal.DOCKED_* values
364 */
Andrei Oneaf4fb6fb2019-02-27 14:46:52 +0000365 @UnsupportedAppUsage
Jorim Jaggi61f39a72015-10-29 16:54:18 +0100366 int getDockedStackSide();
367
368 /**
Jorim Jaggid47e7e12016-03-01 09:57:38 +0100369 * Sets the region the user can touch the divider. This region will be excluded from the region
370 * which is used to cause a focus switch when dispatching touch.
371 */
372 void setDockedStackDividerTouchRegion(in Rect touchableRegion);
373
374 /**
Jorim Jaggia6c934e2015-12-21 13:22:31 +0100375 * Registers a listener that will be called when the dock divider changes its visibility or when
376 * the docked stack gets added/removed.
Filip Gruszczynski64cdc142015-11-29 21:10:07 -0800377 */
Andrei Oneaf4fb6fb2019-02-27 14:46:52 +0000378 @UnsupportedAppUsage
Jorim Jaggia6c934e2015-12-21 13:22:31 +0100379 void registerDockedStackListener(IDockedStackListener listener);
Jorim Jaggi50981592015-12-29 17:54:12 +0100380
381 /**
Winson Chung655332c2016-10-31 13:14:28 -0700382 * Registers a listener that will be called when the pinned stack state changes.
383 */
384 void registerPinnedStackListener(int displayId, IPinnedStackListener listener);
385
386 /**
Jorim Jaggi50981592015-12-29 17:54:12 +0100387 * Updates the dim layer used while resizing.
388 *
389 * @param visible Whether the dim layer should be visible.
Wale Ogunwale68278562017-09-23 17:13:55 -0700390 * @param targetWindowingMode The windowing mode of the stack the dim layer should be placed on.
Jorim Jaggi50981592015-12-29 17:54:12 +0100391 * @param alpha The translucency of the dim layer, between 0 and 1.
392 */
Wale Ogunwale68278562017-09-23 17:13:55 -0700393 void setResizeDimLayer(boolean visible, int targetWindowingMode, float alpha);
Clara Bayarri75e09792015-07-29 16:20:40 +0100394
395 /**
396 * Requests Keyboard Shortcuts from the displayed window.
397 *
398 * @param receiver The receiver to deliver the results to.
399 */
Clara Bayarrifcd7e802016-03-10 12:58:18 +0000400 void requestAppKeyboardShortcuts(IResultReceiver receiver, int deviceId);
Jorim Jaggic6c89a82016-01-28 17:48:21 -0800401
402 /**
403 * Retrieves the current stable insets from the primary display.
404 */
Andrei Oneaf4fb6fb2019-02-27 14:46:52 +0000405 @UnsupportedAppUsage
Winson Chung303c6b72016-10-24 17:12:49 -0700406 void getStableInsets(int displayId, out Rect outInsets);
Muyuan Li94ce94e2016-02-24 16:20:54 -0800407
408 /**
Issei Suzukia5dbf522019-02-01 17:58:15 +0100409 * Set the forwarded insets on the display.
410 * <p>
411 * This is only used in case a virtual display is displayed on another display that has insets,
412 * and the bounds of the virtual display is overlapping with the insets from the host display.
413 * In that case, the contents on the virtual display won't be placed over the forwarded insets.
414 * Only the owner of the display is permitted to set the forwarded insets on it.
415 */
416 void setForwardedInsets(int displayId, in Insets insets);
417
418 /**
Muyuan Li94ce94e2016-02-24 16:20:54 -0800419 * Register shortcut key. Shortcut code is packed as:
420 * (MetaState << Integer.SIZE) | KeyCode
421 * @hide
422 */
423 void registerShortcutKey(in long shortcutCode, IShortcutService keySubscriber);
Vladislav Kaznacheev0d50d862016-03-29 15:43:28 -0700424
425 /**
Arthur Hung39134b22018-08-14 11:58:28 +0800426 * Create an input consumer by name and display id.
Vladislav Kaznacheev0d50d862016-03-29 15:43:28 -0700427 */
Andrei Oneaf4fb6fb2019-02-27 14:46:52 +0000428 @UnsupportedAppUsage
Arthur Hung39134b22018-08-14 11:58:28 +0800429 void createInputConsumer(IBinder token, String name, int displayId,
430 out InputChannel inputChannel);
Vladislav Kaznacheev0d50d862016-03-29 15:43:28 -0700431
432 /**
Arthur Hung39134b22018-08-14 11:58:28 +0800433 * Destroy an input consumer by name and display id.
434 * This method will also dispose the input channels associated with that InputConsumer.
Vladislav Kaznacheev0d50d862016-03-29 15:43:28 -0700435 */
Andrei Oneaf4fb6fb2019-02-27 14:46:52 +0000436 @UnsupportedAppUsage
Arthur Hung39134b22018-08-14 11:58:28 +0800437 boolean destroyInputConsumer(String name, int displayId);
Albert Chaulk56162a02017-06-05 19:35:23 -0400438
439 /**
440 * Return the touch region for the current IME window, or an empty region if there is none.
441 */
442 Region getCurrentImeTouchRegion();
Vishnu Nairc9615042018-01-09 07:23:31 -0800443
444 /**
Adrian Roos962017e2018-11-27 15:11:46 +0100445 * Registers an IDisplayFoldListener.
446 */
447 void registerDisplayFoldListener(IDisplayFoldListener listener);
448
449 /**
450 * Unregisters an IDisplayFoldListener.
451 */
452 void unregisterDisplayFoldListener(IDisplayFoldListener listener);
453
454 /**
Vishnu Nairc9615042018-01-09 07:23:31 -0800455 * Starts a window trace.
456 */
457 void startWindowTrace();
458
459 /**
460 * Stops a window trace.
461 */
462 void stopWindowTrace();
463
464 /**
465 * Returns true if window trace is enabled.
466 */
467 boolean isWindowTraceEnabled();
Yoshiaki Nakae1bdfc822017-09-15 15:24:34 +0900468
469 /**
Jordan Liuc0228762018-07-13 11:39:42 -0700470 * Requests that the WindowManager sends
471 * WindowManagerPolicyConstants#ACTION_USER_ACTIVITY_NOTIFICATION on the next user activity.
Yoshiaki Nakae1bdfc822017-09-15 15:24:34 +0900472 */
473 void requestUserActivityNotification();
Andrii Kulianf0379de2018-03-14 16:24:07 -0700474
475 /**
476 * Notify WindowManager that it should not override the info in DisplayManager for the specified
477 * display. This can disable letter- or pillar-boxing applied in DisplayManager when the metrics
478 * of the logical display reported from WindowManager do not correspond to the metrics of the
479 * physical display it is based on.
480 *
481 * @param displayId The id of the display.
482 */
483 void dontOverrideDisplayInfo(int displayId);
Chilun8753ad32018-10-09 15:56:45 +0800484
485 /**
486 * Gets the windowing mode of the display.
487 *
488 * @param displayId The id of the display.
489 * @return {@link WindowConfiguration.WindowingMode}
490 */
491 int getWindowingMode(int displayId);
492
493 /**
494 * Sets the windowing mode of the display.
495 *
496 * @param displayId The id of the display.
497 * @param mode {@link WindowConfiguration.WindowingMode}
498 */
499 void setWindowingMode(int displayId, int mode);
500
501 /**
502 * Gets current remove content mode of the display.
503 * <p>
504 * What actions should be performed with the display's content when it is removed. Default
505 * behavior for public displays in this case is to move all activities to the primary display
506 * and make it focused. For private display is to destroy all activities.
507 * </p>
508 *
509 * @param displayId The id of the display.
510 * @return The remove content mode of the display.
511 * @see WindowManager#REMOVE_CONTENT_MODE_MOVE_TO_PRIMARY
512 * @see WindowManager#REMOVE_CONTENT_MODE_DESTROY
513 */
514 int getRemoveContentMode(int displayId);
515
516 /**
517 * Sets the remove content mode of the display.
518 * <p>
519 * This mode indicates what actions should be performed with the display's content when it is
520 * removed.
521 * </p>
522 *
523 * @param displayId The id of the display.
524 * @param mode Remove content mode.
525 * @see WindowManager#REMOVE_CONTENT_MODE_MOVE_TO_PRIMARY
526 * @see WindowManager#REMOVE_CONTENT_MODE_DESTROY
527 */
528 void setRemoveContentMode(int displayId, int mode);
529
530 /**
531 * Indicates that the display should show its content when non-secure keyguard is shown.
532 * <p>
533 * This flag identifies secondary displays that will continue showing content if keyguard can be
534 * dismissed without entering credentials.
535 * </p><p>
536 * An example of usage is a virtual display which content is displayed on external hardware
537 * display that is not visible to the system directly.
538 * </p>
539 *
540 * @param displayId The id of the display.
541 * @return {@code true} if the display should show its content when non-secure keyguard is
542 * shown.
543 * @see KeyguardManager#isDeviceSecure()
544 * @see KeyguardManager#isDeviceLocked()
545 */
546 boolean shouldShowWithInsecureKeyguard(int displayId);
547
548 /**
549 * Sets that the display should show its content when non-secure keyguard is shown.
550 *
551 * @param displayId The id of the display.
552 * @param shouldShow Indicates that the display should show its content when non-secure keyguard
553 * is shown.
554 * @see KeyguardManager#isDeviceSecure()
555 * @see KeyguardManager#isDeviceLocked()
556 */
557 void setShouldShowWithInsecureKeyguard(int displayId, boolean shouldShow);
558
559 /**
560 * Indicates the display should show system decors.
561 * <p>
562 * System decors include status bar, navigation bar, launcher.
563 * </p>
564 *
565 * @param displayId The id of the display.
566 * @return {@code true} if the display should show system decors.
567 */
568 boolean shouldShowSystemDecors(int displayId);
569
570 /**
571 * Sets that the display should show system decors.
572 * <p>
573 * System decors include status bar, navigation bar, launcher.
574 * </p>
575 *
576 * @param displayId The id of the display.
577 * @param shouldShow Indicates that the display should show system decors.
578 */
579 void setShouldShowSystemDecors(int displayId, boolean shouldShow);
580
581 /**
582 * Indicates that the display should show IME.
583 *
584 * @param displayId The id of the display.
585 * @return {@code true} if the display should show IME.
586 * @see KeyguardManager#isDeviceSecure()
587 * @see KeyguardManager#isDeviceLocked()
588 */
589 boolean shouldShowIme(int displayId);
590
591 /**
592 * Sets that the display should show IME.
593 *
594 * @param displayId The id of the display.
595 * @param shouldShow Indicates that the display should show IME.
596 * @see KeyguardManager#isDeviceSecure()
597 * @see KeyguardManager#isDeviceLocked()
598 */
599 void setShouldShowIme(int displayId, boolean shouldShow);
chaviwff2e7d82018-11-02 11:11:27 -0700600
601 /**
602 * Reparent the top layers for a display to the requested surfaceControl. The display that
603 * is going to be re-parented (the displayId passed in) needs to have been created by the same
604 * process that is requesting the re-parent. This is to ensure clients can't just re-parent
605 * display content info to any SurfaceControl, as this would be a security issue.
606 *
607 * @param displayId The id of the display.
Robert Carr10584fa2019-01-14 15:55:19 -0800608 * @param surfaceControlHandle The SurfaceControl that the top level layers for the
chaviwff2e7d82018-11-02 11:11:27 -0700609 * display should be re-parented to.
610 */
Robert Carr10584fa2019-01-14 15:55:19 -0800611 void reparentDisplayContent(int displayId, in SurfaceControl sc);
chaviw504715c2019-02-14 11:02:43 -0800612
613 /**
614 * Waits for transactions to get applied before injecting input.
615 * This includes waiting for the input windows to get sent to InputManager.
616 *
617 * This is needed for testing since the system add windows and injects input
618 * quick enough that the windows don't have time to get sent to InputManager.
619 */
620 boolean injectInputAfterTransactionsApplied(in InputEvent ev, int mode);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800621}