blob: 5dc54a56667695f96ccc5438cf6379047f417ac4 [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
Dianne Hackborn672cf452013-03-26 15:24:24 -070077 void getInitialDisplaySize(int displayId, out Point size);
78 void getBaseDisplaySize(int displayId, out Point size);
Jeff Brown43aa1592012-09-10 17:36:31 -070079 void setForcedDisplaySize(int displayId, int width, int height);
Craig Mautner59c00972012-07-30 12:10:24 -070080 void clearForcedDisplaySize(int displayId);
Dianne Hackborn672cf452013-03-26 15:24:24 -070081 int getInitialDisplayDensity(int displayId);
82 int getBaseDisplayDensity(int displayId);
Alan Viverettedf3a7ca2016-09-06 17:13:41 -040083 void setForcedDisplayDensityForUser(int displayId, int density, int userId);
84 void clearForcedDisplayDensityForUser(int displayId, int userId);
Jeff Brownd46747a2015-04-15 19:02:36 -070085 void setForcedDisplayScalingMode(int displayId, int mode); // 0 = auto, 1 = disable
Dianne Hackborn7916ac62011-05-16 20:45:48 -070086
Dianne Hackbornc652de82013-02-15 16:32:56 -080087 void setOverscan(int displayId, int left, int top, int right, int bottom);
88
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080089 // These can only be called when holding the MANAGE_APP_TOKENS permission.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080090 void setEventDispatching(boolean enabled);
Wale Ogunwaleac2561e2016-11-01 15:43:46 -070091 void addWindowToken(IBinder token, int type, int displayId);
92 void removeWindowToken(IBinder token, int displayId);
Dianne Hackborn7da6ac32010-12-09 19:22:04 -080093 void prepareAppTransition(int transit, boolean alwaysKeepCurrent);
Jorim Jaggi2f7d2922015-10-29 13:08:29 +010094
95 /**
96 * Like overridePendingAppTransitionMultiThumb, but uses a future to supply the specs. This is
97 * used for recents, where generating the thumbnails of the specs takes a non-trivial amount of
98 * time, so we want to move that off the critical path for starting the new activity.
99 */
100 void overridePendingAppTransitionMultiThumbFuture(
101 IAppTransitionAnimationSpecsFuture specsFuture, IRemoteCallback startedCallback,
lumarka483f312018-11-20 15:24:05 +0800102 boolean scaleUp, int displayId);
103 void overridePendingAppTransitionRemote(in RemoteAnimationAdapter remoteAnimationAdapter,
104 int displayId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800105 void executeAppTransition();
Wale Ogunwale3b232392016-05-13 15:37:13 -0700106
Jorim Jaggi66b48df2018-04-20 16:23:48 +0200107 /**
108 * Used by system ui to report that recents has shown itself.
109 * @deprecated to be removed once prebuilts are updated
110 */
Filip Gruszczynski14b4e572015-11-03 15:53:55 -0800111 void endProlongedAnimations();
112
Dianne Hackborn9d9ece32012-09-10 15:33:52 -0700113 void startFreezingScreen(int exitAnim, int enterAnim);
114 void stopFreezingScreen();
115
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800116 // these require DISABLE_KEYGUARD permission
Adrian Roos1c8e3c02018-11-20 20:07:55 +0100117 /** @deprecated use Activity.setShowWhenLocked instead. */
118 void disableKeyguard(IBinder token, String tag, int userId);
119 /** @deprecated use Activity.setShowWhenLocked instead. */
120 void reenableKeyguard(IBinder token, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800121 void exitKeyguardSecurely(IOnKeyguardExitResult callback);
Mike Lockwood520d8bc2011-02-18 13:23:13 -0500122 boolean isKeyguardLocked();
123 boolean isKeyguardSecure();
Lucas Dupinc80c67e2017-12-04 14:29:10 -0800124 void dismissKeyguard(IKeyguardDismissCallback callback, CharSequence message);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800125
Evan Rosky18396452016-07-27 15:19:37 -0700126 // Requires INTERACT_ACROSS_USERS_FULL permission
127 void setSwitchingUser(boolean switching);
128
Dianne Hackbornffa42482009-09-23 22:20:11 -0700129 void closeSystemDialogs(String reason);
Jim Miller4eeb4f62012-11-08 00:04:29 -0800130
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800131 // 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 Miller4eeb4f62012-11-08 00:04:29 -0800136
Dianne Hackborneb94fa72014-06-03 17:48:12 -0700137 float getCurrentAnimatorScale();
138
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800139 // For testing
140 void setInTouchMode(boolean showFocus);
Brad Fitzpatrick68044332010-11-22 18:19:48 -0800141
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 Fitzpatrickc1a968a2010-11-24 08:56:40 -0800149 // 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 Alewijnsed2a1eec2014-07-09 12:57:05 +0100155 /**
Makoto Onuki04ef4472018-03-12 17:29:49 -0700156 * Set whether screen capture is disabled for all windows of a specific user from
157 * the device policy cache.
Sander Alewijnsed2a1eec2014-07-09 12:57:05 +0100158 */
Makoto Onuki04ef4472018-03-12 17:29:49 -0700159 void refreshScreenCaptureDisabled(int userId);
Sander Alewijnsed2a1eec2014-07-09 12:57:05 +0100160
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800161 // These can only be called with the SET_ORIENTATION permission.
162 /**
Jeff Brown01a98dd2011-09-20 15:08:29 -0700163 * Update the current screen rotation based on the current state of
164 * the world.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800165 * @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 Hackbornf87d1962012-04-04 12:48:24 -0700168 * @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 Project9066cfe2009-03-03 19:31:44 -0800170 */
Dianne Hackbornf87d1962012-04-04 12:48:24 -0700171 void updateRotation(boolean alwaysSendConfiguration, boolean forceRelayout);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800172
173 /**
Andrii Kulian8ee72852017-03-10 10:36:45 -0800174 * 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 Project9066cfe2009-03-03 19:31:44 -0800178 */
Andrii Kulian8ee72852017-03-10 10:36:45 -0800179 int getDefaultDisplayRotation();
Jim Miller4eeb4f62012-11-08 00:04:29 -0800180
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800181 /**
Andrii Kulian35fa3c22017-03-11 09:37:28 -0800182 * Watch the rotation of the specified screen. Returns the current rotation,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800183 * calls back when it changes.
184 */
Andrii Kulian35fa3c22017-03-11 09:37:28 -0800185 int watchRotation(IRotationWatcher watcher, int displayId);
Daniel Sandlerb73617d2010-08-17 00:41:00 -0400186
Adam Powelldfee59a2011-08-05 20:48:30 -0700187 /**
Brian Colonnab1b9a8a2013-03-29 11:52:42 -0400188 * Remove a rotation watcher set using watchRotation.
189 * @hide
190 */
191 void removeRotationWatcher(IRotationWatcher watcher);
192
193 /**
Adam Powelldfee59a2011-08-05 20:48:30 -0700194 * Determine the preferred edge of the screen to pin the compact options menu against.
Riddle Hsua4d6fa22018-08-11 00:50:39 +0800195 *
196 * @param displayId Id of the display where the menu window currently resides.
197 * @return a Gravity value for the options menu panel.
Adam Powelldfee59a2011-08-05 20:48:30 -0700198 * @hide
199 */
Riddle Hsua4d6fa22018-08-11 00:50:39 +0800200 int getPreferredOptionsPanelGravity(int displayId);
Adam Powelldfee59a2011-08-05 20:48:30 -0700201
Jim Miller4eeb4f62012-11-08 00:04:29 -0800202 /**
Garfield Tan90c90052018-10-08 12:29:41 -0700203 * Equivalent to calling {@link #freezeDisplayRotation(int, int)} with {@link
204 * android.view.Display#DEFAULT_DISPLAY} and given rotation.
Jim Miller4eeb4f62012-11-08 00:04:29 -0800205 */
206 void freezeRotation(int rotation);
Daniel Sandlerb73617d2010-08-17 00:41:00 -0400207
Jim Miller4eeb4f62012-11-08 00:04:29 -0800208 /**
Garfield Tan90c90052018-10-08 12:29:41 -0700209 * Equivalent to calling {@link #thawDisplayRotation(int)} with {@link
210 * android.view.Display#DEFAULT_DISPLAY}.
Jim Miller4eeb4f62012-11-08 00:04:29 -0800211 */
212 void thawRotation();
Dianne Hackborn0aae2d42010-12-07 23:51:29 -0800213
Jim Miller4eeb4f62012-11-08 00:04:29 -0800214 /**
Garfield Tan90c90052018-10-08 12:29:41 -0700215 * Equivelant to call {@link #isDisplayRotationFrozen(int)} with {@link
216 * android.view.Display#DEFAULT_DISPLAY}.
Svetoslav Ganov80943d82013-01-02 10:25:37 -0800217 */
218 boolean isRotationFrozen();
219
220 /**
Garfield Tan90c90052018-10-08 12:29:41 -0700221 * 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 Cohen3683fb12016-07-11 19:47:37 +0100249 * Screenshot the current wallpaper layer, including the whole screen.
250 */
251 Bitmap screenshotWallpaper();
252
253 /**
Lucas Dupine1571702017-05-24 14:14:44 -0700254 * 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 Hackborn27eac1d2015-03-16 17:15:53 -0700267 * Used only for assist -- request a screenshot of the current application.
268 */
Winson Chungda2818f2017-10-23 16:25:49 -0700269 boolean requestAssistScreenshot(IAssistDataReceiver receiver);
Dianne Hackborn27eac1d2015-03-16 17:15:53 -0700270
271 /**
Joe Onorato664644d2011-01-23 17:53:23 -0800272 * Called by the status bar to notify Views of changes to System UI visiblity.
273 */
Tiger Huang7c610aa2018-10-27 00:01:01 +0800274 oneway void statusBarVisibilityChanged(int displayId, int visibility);
Jeff Brown1a84fd12011-06-02 01:26:32 -0700275
276 /**
Winsonab216602016-08-09 14:05:20 -0700277 * 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 Chungac52f282017-03-30 14:44:52 -0700284 oneway void setPipVisibility(boolean visible);
Winsonab216602016-08-09 14:05:20 -0700285
Tracy Zhou43513082018-03-08 21:58:36 -0800286 /**
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 Ng64543e62018-02-28 17:35:10 -0800292 * Called by System UI to enable or disable haptic feedback on the navigation bar buttons.
293 */
294 void setNavBarVirtualKeyHapticFeedbackEnabled(boolean enabled);
295
Winsonab216602016-08-09 14:05:20 -0700296 /**
Charles Chenea6e7f02018-11-19 21:37:45 +0800297 * 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 Sandler0c4ccff2011-10-19 16:39:14 -0400300 */
Charles Chenea6e7f02018-11-19 21:37:45 +0800301 boolean hasNavigationBar(int displayId);
Jim Miller93c518e2012-01-17 15:55:31 -0800302
303 /**
Tracy Zhou43513082018-03-08 21:58:36 -0800304 * Get the position of the nav bar
305 */
Tiger Huang44c04552018-11-29 20:06:45 +0800306 int getNavBarPosition(int displayId);
Matthew Nga8f24262017-12-19 11:54:24 -0800307
308 /**
Adam Cohenf7522022012-10-03 20:03:18 -0700309 * Lock the device immediately with the specified options (can be null).
Jim Miller93c518e2012-01-17 15:55:31 -0800310 */
Adam Cohenf7522022012-10-03 20:03:18 -0700311 void lockNow(in Bundle options);
Svetoslav Ganovc9c9a482012-07-16 08:46:07 -0700312
313 /**
Jim Millerbfec0a82012-11-05 20:05:22 -0800314 * Device is in safe mode.
315 */
316 boolean isSafeModeEnabled();
Jorim Jaggicff0acb2014-03-31 16:35:15 +0200317
318 /**
319 * Enables the screen if all conditions are met.
320 */
321 void enableScreenIfNeeded();
Svetoslavdd137a82014-04-10 12:48:07 -0700322
323 /**
Svetoslav1376d602014-03-13 11:17:26 -0700324 * 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 Jaggi61f39a72015-10-29 16:54:18 +0100338
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 Jaggid47e7e12016-03-01 09:57:38 +0100346 * 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 Jaggia6c934e2015-12-21 13:22:31 +0100352 * Registers a listener that will be called when the dock divider changes its visibility or when
353 * the docked stack gets added/removed.
Filip Gruszczynski64cdc142015-11-29 21:10:07 -0800354 */
Jorim Jaggia6c934e2015-12-21 13:22:31 +0100355 void registerDockedStackListener(IDockedStackListener listener);
Jorim Jaggi50981592015-12-29 17:54:12 +0100356
357 /**
Winson Chung655332c2016-10-31 13:14:28 -0700358 * Registers a listener that will be called when the pinned stack state changes.
359 */
360 void registerPinnedStackListener(int displayId, IPinnedStackListener listener);
361
362 /**
Jorim Jaggi50981592015-12-29 17:54:12 +0100363 * Updates the dim layer used while resizing.
364 *
365 * @param visible Whether the dim layer should be visible.
Wale Ogunwale68278562017-09-23 17:13:55 -0700366 * @param targetWindowingMode The windowing mode of the stack the dim layer should be placed on.
Jorim Jaggi50981592015-12-29 17:54:12 +0100367 * @param alpha The translucency of the dim layer, between 0 and 1.
368 */
Wale Ogunwale68278562017-09-23 17:13:55 -0700369 void setResizeDimLayer(boolean visible, int targetWindowingMode, float alpha);
Clara Bayarri75e09792015-07-29 16:20:40 +0100370
371 /**
372 * Requests Keyboard Shortcuts from the displayed window.
373 *
374 * @param receiver The receiver to deliver the results to.
375 */
Clara Bayarrifcd7e802016-03-10 12:58:18 +0000376 void requestAppKeyboardShortcuts(IResultReceiver receiver, int deviceId);
Jorim Jaggic6c89a82016-01-28 17:48:21 -0800377
378 /**
379 * Retrieves the current stable insets from the primary display.
380 */
Winson Chung303c6b72016-10-24 17:12:49 -0700381 void getStableInsets(int displayId, out Rect outInsets);
Muyuan Li94ce94e2016-02-24 16:20:54 -0800382
383 /**
Issei Suzukia5dbf522019-02-01 17:58:15 +0100384 * Set the forwarded insets on the display.
385 * <p>
386 * This is only used in case a virtual display is displayed on another display that has insets,
387 * and the bounds of the virtual display is overlapping with the insets from the host display.
388 * In that case, the contents on the virtual display won't be placed over the forwarded insets.
389 * Only the owner of the display is permitted to set the forwarded insets on it.
390 */
391 void setForwardedInsets(int displayId, in Insets insets);
392
393 /**
Muyuan Li94ce94e2016-02-24 16:20:54 -0800394 * Register shortcut key. Shortcut code is packed as:
395 * (MetaState << Integer.SIZE) | KeyCode
396 * @hide
397 */
398 void registerShortcutKey(in long shortcutCode, IShortcutService keySubscriber);
Vladislav Kaznacheev0d50d862016-03-29 15:43:28 -0700399
400 /**
Arthur Hung39134b22018-08-14 11:58:28 +0800401 * Create an input consumer by name and display id.
Vladislav Kaznacheev0d50d862016-03-29 15:43:28 -0700402 */
Arthur Hung39134b22018-08-14 11:58:28 +0800403 void createInputConsumer(IBinder token, String name, int displayId,
404 out InputChannel inputChannel);
Vladislav Kaznacheev0d50d862016-03-29 15:43:28 -0700405
406 /**
Arthur Hung39134b22018-08-14 11:58:28 +0800407 * Destroy an input consumer by name and display id.
408 * This method will also dispose the input channels associated with that InputConsumer.
Vladislav Kaznacheev0d50d862016-03-29 15:43:28 -0700409 */
Arthur Hung39134b22018-08-14 11:58:28 +0800410 boolean destroyInputConsumer(String name, int displayId);
Albert Chaulk56162a02017-06-05 19:35:23 -0400411
412 /**
413 * Return the touch region for the current IME window, or an empty region if there is none.
414 */
415 Region getCurrentImeTouchRegion();
Vishnu Nairc9615042018-01-09 07:23:31 -0800416
417 /**
Adrian Roos962017e2018-11-27 15:11:46 +0100418 * Registers an IDisplayFoldListener.
419 */
420 void registerDisplayFoldListener(IDisplayFoldListener listener);
421
422 /**
423 * Unregisters an IDisplayFoldListener.
424 */
425 void unregisterDisplayFoldListener(IDisplayFoldListener listener);
426
427 /**
Vishnu Nairc9615042018-01-09 07:23:31 -0800428 * Starts a window trace.
429 */
430 void startWindowTrace();
431
432 /**
433 * Stops a window trace.
434 */
435 void stopWindowTrace();
436
437 /**
438 * Returns true if window trace is enabled.
439 */
440 boolean isWindowTraceEnabled();
Yoshiaki Nakae1bdfc822017-09-15 15:24:34 +0900441
442 /**
Jordan Liuc0228762018-07-13 11:39:42 -0700443 * Requests that the WindowManager sends
444 * WindowManagerPolicyConstants#ACTION_USER_ACTIVITY_NOTIFICATION on the next user activity.
Yoshiaki Nakae1bdfc822017-09-15 15:24:34 +0900445 */
446 void requestUserActivityNotification();
Andrii Kulianf0379de2018-03-14 16:24:07 -0700447
448 /**
449 * Notify WindowManager that it should not override the info in DisplayManager for the specified
450 * display. This can disable letter- or pillar-boxing applied in DisplayManager when the metrics
451 * of the logical display reported from WindowManager do not correspond to the metrics of the
452 * physical display it is based on.
453 *
454 * @param displayId The id of the display.
455 */
456 void dontOverrideDisplayInfo(int displayId);
Chilun8753ad32018-10-09 15:56:45 +0800457
458 /**
459 * Gets the windowing mode of the display.
460 *
461 * @param displayId The id of the display.
462 * @return {@link WindowConfiguration.WindowingMode}
463 */
464 int getWindowingMode(int displayId);
465
466 /**
467 * Sets the windowing mode of the display.
468 *
469 * @param displayId The id of the display.
470 * @param mode {@link WindowConfiguration.WindowingMode}
471 */
472 void setWindowingMode(int displayId, int mode);
473
474 /**
475 * Gets current remove content mode of the display.
476 * <p>
477 * What actions should be performed with the display's content when it is removed. Default
478 * behavior for public displays in this case is to move all activities to the primary display
479 * and make it focused. For private display is to destroy all activities.
480 * </p>
481 *
482 * @param displayId The id of the display.
483 * @return The remove content mode of the display.
484 * @see WindowManager#REMOVE_CONTENT_MODE_MOVE_TO_PRIMARY
485 * @see WindowManager#REMOVE_CONTENT_MODE_DESTROY
486 */
487 int getRemoveContentMode(int displayId);
488
489 /**
490 * Sets the remove content mode of the display.
491 * <p>
492 * This mode indicates what actions should be performed with the display's content when it is
493 * removed.
494 * </p>
495 *
496 * @param displayId The id of the display.
497 * @param mode Remove content mode.
498 * @see WindowManager#REMOVE_CONTENT_MODE_MOVE_TO_PRIMARY
499 * @see WindowManager#REMOVE_CONTENT_MODE_DESTROY
500 */
501 void setRemoveContentMode(int displayId, int mode);
502
503 /**
504 * Indicates that the display should show its content when non-secure keyguard is shown.
505 * <p>
506 * This flag identifies secondary displays that will continue showing content if keyguard can be
507 * dismissed without entering credentials.
508 * </p><p>
509 * An example of usage is a virtual display which content is displayed on external hardware
510 * display that is not visible to the system directly.
511 * </p>
512 *
513 * @param displayId The id of the display.
514 * @return {@code true} if the display should show its content when non-secure keyguard is
515 * shown.
516 * @see KeyguardManager#isDeviceSecure()
517 * @see KeyguardManager#isDeviceLocked()
518 */
519 boolean shouldShowWithInsecureKeyguard(int displayId);
520
521 /**
522 * Sets that the display should show its content when non-secure keyguard is shown.
523 *
524 * @param displayId The id of the display.
525 * @param shouldShow Indicates that the display should show its content when non-secure keyguard
526 * is shown.
527 * @see KeyguardManager#isDeviceSecure()
528 * @see KeyguardManager#isDeviceLocked()
529 */
530 void setShouldShowWithInsecureKeyguard(int displayId, boolean shouldShow);
531
532 /**
533 * Indicates 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 * @return {@code true} if the display should show system decors.
540 */
541 boolean shouldShowSystemDecors(int displayId);
542
543 /**
544 * Sets that the display should show system decors.
545 * <p>
546 * System decors include status bar, navigation bar, launcher.
547 * </p>
548 *
549 * @param displayId The id of the display.
550 * @param shouldShow Indicates that the display should show system decors.
551 */
552 void setShouldShowSystemDecors(int displayId, boolean shouldShow);
553
554 /**
555 * Indicates that the display should show IME.
556 *
557 * @param displayId The id of the display.
558 * @return {@code true} if the display should show IME.
559 * @see KeyguardManager#isDeviceSecure()
560 * @see KeyguardManager#isDeviceLocked()
561 */
562 boolean shouldShowIme(int displayId);
563
564 /**
565 * Sets that the display should show IME.
566 *
567 * @param displayId The id of the display.
568 * @param shouldShow Indicates that the display should show IME.
569 * @see KeyguardManager#isDeviceSecure()
570 * @see KeyguardManager#isDeviceLocked()
571 */
572 void setShouldShowIme(int displayId, boolean shouldShow);
chaviwff2e7d82018-11-02 11:11:27 -0700573
574 /**
575 * Reparent the top layers for a display to the requested surfaceControl. The display that
576 * is going to be re-parented (the displayId passed in) needs to have been created by the same
577 * process that is requesting the re-parent. This is to ensure clients can't just re-parent
578 * display content info to any SurfaceControl, as this would be a security issue.
579 *
580 * @param displayId The id of the display.
Robert Carr10584fa2019-01-14 15:55:19 -0800581 * @param surfaceControlHandle The SurfaceControl that the top level layers for the
chaviwff2e7d82018-11-02 11:11:27 -0700582 * display should be re-parented to.
583 */
Robert Carr10584fa2019-01-14 15:55:19 -0800584 void reparentDisplayContent(int displayId, in SurfaceControl sc);
chaviw504715c2019-02-14 11:02:43 -0800585
586 /**
587 * Waits for transactions to get applied before injecting input.
588 * This includes waiting for the input windows to get sent to InputManager.
589 *
590 * This is needed for testing since the system add windows and injects input
591 * quick enough that the windows don't have time to get sent to InputManager.
592 */
593 boolean injectInputAfterTransactionsApplied(in InputEvent ev, int mode);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800594}