blob: 8ae4757f5de6d4245f323ea3f97e6a454c903880 [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;
Dianne Hackbornac8dea12011-04-20 18:18:51 -070028import android.graphics.Point;
Svetoslav Ganovc9c9a482012-07-16 08:46:07 -070029import android.graphics.Rect;
Albert Chaulk56162a02017-06-05 19:35:23 -040030import android.graphics.Region;
Adam Cohenf7522022012-10-03 20:03:18 -070031import android.os.Bundle;
Dianne Hackborn38e29a62011-09-18 14:43:08 -070032import android.os.IRemoteCallback;
Robert Carr3b716242016-08-16 16:02:21 -070033import android.os.ParcelFileDescriptor;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080034import android.view.IApplicationToken;
Jorim Jaggi2f7d2922015-10-29 13:08:29 +010035import android.view.IAppTransitionAnimationSpecsFuture;
Jorim Jaggia6c934e2015-12-21 13:22:31 +010036import android.view.IDockedStackListener;
Adrian Roos962017e2018-11-27 15:11:46 +010037import android.view.IDisplayFoldListener;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080038import android.view.IOnKeyguardExitResult;
Winson Chung655332c2016-10-31 13:14:28 -070039import android.view.IPinnedStackListener;
Jorim Jaggi33a701a2017-12-01 14:58:18 +010040import android.view.RemoteAnimationAdapter;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080041import android.view.IRotationWatcher;
Lucas Dupine1571702017-05-24 14:14:44 -070042import android.view.IWallpaperVisibilityListener;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080043import android.view.IWindowSession;
Dianne Hackborneb94fa72014-06-03 17:48:12 -070044import android.view.IWindowSessionCallback;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080045import android.view.KeyEvent;
Jeff Brown6ec402b2010-07-28 15:48:59 -070046import android.view.InputEvent;
Svetoslav Ganov152e9bb2012-10-12 20:15:29 -070047import android.view.MagnificationSpec;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080048import android.view.MotionEvent;
Jeff Browna41ca772010-08-11 14:46:32 -070049import android.view.InputChannel;
Jeff Brown8d608662010-08-30 03:02:23 -070050import android.view.InputDevice;
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -070051import android.view.IInputFilter;
Filip Gruszczynski170192a2015-08-16 17:46:34 -070052import android.view.AppTransitionAnimationSpec;
Svetoslav1376d602014-03-13 11:17:26 -070053import android.view.WindowContentFrameStats;
Jorim Jaggie2c77f92016-12-29 14:57:22 +010054import android.view.WindowManager;
Robert Carr10584fa2019-01-14 15:55:19 -080055import android.view.SurfaceControl;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080056
57/**
58 * System private interface to the window manager.
59 *
60 * {@hide}
61 */
62interface IWindowManager
63{
64 /**
65 * ===== NOTICE =====
66 * The first three methods must remain the first three methods. Scripts
67 * and tools rely on their transaction number to work properly.
68 */
69 // This is used for debugging
70 boolean startViewServer(int port); // Transaction #1
71 boolean stopViewServer(); // Transaction #2
72 boolean isViewServerRunning(); // Transaction #3
73
Yohei Yukawaa71bb252018-09-19 19:21:24 -070074 IWindowSession openSession(in IWindowSessionCallback callback);
Dianne Hackbornac8dea12011-04-20 18:18:51 -070075
Dianne Hackborn672cf452013-03-26 15:24:24 -070076 void getInitialDisplaySize(int displayId, out Point size);
77 void getBaseDisplaySize(int displayId, out Point size);
Jeff Brown43aa1592012-09-10 17:36:31 -070078 void setForcedDisplaySize(int displayId, int width, int height);
Craig Mautner59c00972012-07-30 12:10:24 -070079 void clearForcedDisplaySize(int displayId);
Dianne Hackborn672cf452013-03-26 15:24:24 -070080 int getInitialDisplayDensity(int displayId);
81 int getBaseDisplayDensity(int displayId);
Alan Viverettedf3a7ca2016-09-06 17:13:41 -040082 void setForcedDisplayDensityForUser(int displayId, int density, int userId);
83 void clearForcedDisplayDensityForUser(int displayId, int userId);
Jeff Brownd46747a2015-04-15 19:02:36 -070084 void setForcedDisplayScalingMode(int displayId, int mode); // 0 = auto, 1 = disable
Dianne Hackborn7916ac62011-05-16 20:45:48 -070085
Dianne Hackbornc652de82013-02-15 16:32:56 -080086 void setOverscan(int displayId, int left, int top, int right, int bottom);
87
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080088 // These can only be called when holding the MANAGE_APP_TOKENS permission.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080089 void setEventDispatching(boolean enabled);
Wale Ogunwaleac2561e2016-11-01 15:43:46 -070090 void addWindowToken(IBinder token, int type, int displayId);
91 void removeWindowToken(IBinder token, int displayId);
Dianne Hackborn7da6ac32010-12-09 19:22:04 -080092 void prepareAppTransition(int transit, boolean alwaysKeepCurrent);
Jorim Jaggi2f7d2922015-10-29 13:08:29 +010093
94 /**
95 * Like overridePendingAppTransitionMultiThumb, but uses a future to supply the specs. This is
96 * used for recents, where generating the thumbnails of the specs takes a non-trivial amount of
97 * time, so we want to move that off the critical path for starting the new activity.
98 */
99 void overridePendingAppTransitionMultiThumbFuture(
100 IAppTransitionAnimationSpecsFuture specsFuture, IRemoteCallback startedCallback,
lumarka483f312018-11-20 15:24:05 +0800101 boolean scaleUp, int displayId);
102 void overridePendingAppTransitionRemote(in RemoteAnimationAdapter remoteAnimationAdapter,
103 int displayId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800104 void executeAppTransition();
Wale Ogunwale3b232392016-05-13 15:37:13 -0700105
Jorim Jaggi66b48df2018-04-20 16:23:48 +0200106 /**
107 * Used by system ui to report that recents has shown itself.
108 * @deprecated to be removed once prebuilts are updated
109 */
Filip Gruszczynski14b4e572015-11-03 15:53:55 -0800110 void endProlongedAnimations();
111
Dianne Hackborn9d9ece32012-09-10 15:33:52 -0700112 void startFreezingScreen(int exitAnim, int enterAnim);
113 void stopFreezingScreen();
114
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800115 // these require DISABLE_KEYGUARD permission
Adrian Roos1c8e3c02018-11-20 20:07:55 +0100116 /** @deprecated use Activity.setShowWhenLocked instead. */
117 void disableKeyguard(IBinder token, String tag, int userId);
118 /** @deprecated use Activity.setShowWhenLocked instead. */
119 void reenableKeyguard(IBinder token, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800120 void exitKeyguardSecurely(IOnKeyguardExitResult callback);
Mike Lockwood520d8bc2011-02-18 13:23:13 -0500121 boolean isKeyguardLocked();
122 boolean isKeyguardSecure();
Lucas Dupinc80c67e2017-12-04 14:29:10 -0800123 void dismissKeyguard(IKeyguardDismissCallback callback, CharSequence message);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800124
Evan Rosky18396452016-07-27 15:19:37 -0700125 // Requires INTERACT_ACROSS_USERS_FULL permission
126 void setSwitchingUser(boolean switching);
127
Dianne Hackbornffa42482009-09-23 22:20:11 -0700128 void closeSystemDialogs(String reason);
Jim Miller4eeb4f62012-11-08 00:04:29 -0800129
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800130 // These can only be called with the SET_ANIMATON_SCALE permission.
131 float getAnimationScale(int which);
132 float[] getAnimationScales();
133 void setAnimationScale(int which, float scale);
134 void setAnimationScales(in float[] scales);
Jim Miller4eeb4f62012-11-08 00:04:29 -0800135
Dianne Hackborneb94fa72014-06-03 17:48:12 -0700136 float getCurrentAnimatorScale();
137
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800138 // For testing
139 void setInTouchMode(boolean showFocus);
Brad Fitzpatrick68044332010-11-22 18:19:48 -0800140
141 // For StrictMode flashing a red border on violations from the UI
142 // thread. The uid/pid is implicit from the Binder call, and the Window
143 // Manager uses that to determine whether or not the red border should
144 // actually be shown. (it will be ignored that pid doesn't have windows
145 // on screen)
146 void showStrictModeViolation(boolean on);
147
Brad Fitzpatrickc1a968a2010-11-24 08:56:40 -0800148 // Proxy to set the system property for whether the flashing
149 // should be enabled. The 'enabled' value is null or blank for
150 // the system default (differs per build variant) or any valid
151 // boolean string as parsed by SystemProperties.getBoolean().
152 void setStrictModeVisualIndicatorPreference(String enabled);
153
Sander Alewijnsed2a1eec2014-07-09 12:57:05 +0100154 /**
Makoto Onuki04ef4472018-03-12 17:29:49 -0700155 * Set whether screen capture is disabled for all windows of a specific user from
156 * the device policy cache.
Sander Alewijnsed2a1eec2014-07-09 12:57:05 +0100157 */
Makoto Onuki04ef4472018-03-12 17:29:49 -0700158 void refreshScreenCaptureDisabled(int userId);
Sander Alewijnsed2a1eec2014-07-09 12:57:05 +0100159
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800160 // These can only be called with the SET_ORIENTATION permission.
161 /**
Jeff Brown01a98dd2011-09-20 15:08:29 -0700162 * Update the current screen rotation based on the current state of
163 * the world.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800164 * @param alwaysSendConfiguration Flag to force a new configuration to
165 * be evaluated. This can be used when there are other parameters in
166 * configuration that are changing.
Dianne Hackbornf87d1962012-04-04 12:48:24 -0700167 * @param forceRelayout If true, the window manager will always do a relayout
168 * of its windows even if the rotation hasn't changed.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800169 */
Dianne Hackbornf87d1962012-04-04 12:48:24 -0700170 void updateRotation(boolean alwaysSendConfiguration, boolean forceRelayout);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800171
172 /**
Andrii Kulian8ee72852017-03-10 10:36:45 -0800173 * Retrieve the current orientation of the primary screen.
174 * @return Constant as per {@link android.view.Surface.Rotation}.
175 *
176 * @see android.view.Display#DEFAULT_DISPLAY
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800177 */
Andrii Kulian8ee72852017-03-10 10:36:45 -0800178 int getDefaultDisplayRotation();
Jim Miller4eeb4f62012-11-08 00:04:29 -0800179
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800180 /**
Andrii Kulian35fa3c22017-03-11 09:37:28 -0800181 * Watch the rotation of the specified screen. Returns the current rotation,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800182 * calls back when it changes.
183 */
Andrii Kulian35fa3c22017-03-11 09:37:28 -0800184 int watchRotation(IRotationWatcher watcher, int displayId);
Daniel Sandlerb73617d2010-08-17 00:41:00 -0400185
Adam Powelldfee59a2011-08-05 20:48:30 -0700186 /**
Brian Colonnab1b9a8a2013-03-29 11:52:42 -0400187 * Remove a rotation watcher set using watchRotation.
188 * @hide
189 */
190 void removeRotationWatcher(IRotationWatcher watcher);
191
192 /**
Adam Powelldfee59a2011-08-05 20:48:30 -0700193 * Determine the preferred edge of the screen to pin the compact options menu against.
Riddle Hsua4d6fa22018-08-11 00:50:39 +0800194 *
195 * @param displayId Id of the display where the menu window currently resides.
196 * @return a Gravity value for the options menu panel.
Adam Powelldfee59a2011-08-05 20:48:30 -0700197 * @hide
198 */
Riddle Hsua4d6fa22018-08-11 00:50:39 +0800199 int getPreferredOptionsPanelGravity(int displayId);
Adam Powelldfee59a2011-08-05 20:48:30 -0700200
Jim Miller4eeb4f62012-11-08 00:04:29 -0800201 /**
Garfield Tan90c90052018-10-08 12:29:41 -0700202 * Equivalent to calling {@link #freezeDisplayRotation(int, int)} with {@link
203 * android.view.Display#DEFAULT_DISPLAY} and given rotation.
Jim Miller4eeb4f62012-11-08 00:04:29 -0800204 */
205 void freezeRotation(int rotation);
Daniel Sandlerb73617d2010-08-17 00:41:00 -0400206
Jim Miller4eeb4f62012-11-08 00:04:29 -0800207 /**
Garfield Tan90c90052018-10-08 12:29:41 -0700208 * Equivalent to calling {@link #thawDisplayRotation(int)} with {@link
209 * android.view.Display#DEFAULT_DISPLAY}.
Jim Miller4eeb4f62012-11-08 00:04:29 -0800210 */
211 void thawRotation();
Dianne Hackborn0aae2d42010-12-07 23:51:29 -0800212
Jim Miller4eeb4f62012-11-08 00:04:29 -0800213 /**
Garfield Tan90c90052018-10-08 12:29:41 -0700214 * Equivelant to call {@link #isDisplayRotationFrozen(int)} with {@link
215 * android.view.Display#DEFAULT_DISPLAY}.
Svetoslav Ganov80943d82013-01-02 10:25:37 -0800216 */
217 boolean isRotationFrozen();
218
219 /**
Garfield Tan90c90052018-10-08 12:29:41 -0700220 * Lock the display orientation to the specified rotation, or to the current
221 * rotation if -1. Sensor input will be ignored until thawRotation() is called.
222 *
223 * @param displayId the ID of display which rotation should be frozen.
224 * @param rotation one of {@link android.view.Surface#ROTATION_0},
225 * {@link android.view.Surface#ROTATION_90}, {@link android.view.Surface#ROTATION_180},
226 * {@link android.view.Surface#ROTATION_270} or -1 to freeze it to current rotation.
227 * @hide
228 */
229 void freezeDisplayRotation(int displayId, int rotation);
230
231 /**
232 * Release the orientation lock imposed by freezeRotation() on the display.
233 *
234 * @param displayId the ID of display which rotation should be thawed.
235 * @hide
236 */
237 void thawDisplayRotation(int displayId);
238
239 /**
240 * Gets whether the rotation is frozen on the display.
241 *
242 * @param displayId the ID of display which frozen is needed.
243 * @return Whether the rotation is frozen.
244 */
245 boolean isDisplayRotationFrozen(int displayId);
246
247 /**
Zak Cohen3683fb12016-07-11 19:47:37 +0100248 * Screenshot the current wallpaper layer, including the whole screen.
249 */
250 Bitmap screenshotWallpaper();
251
252 /**
Lucas Dupine1571702017-05-24 14:14:44 -0700253 * Registers a wallpaper visibility listener.
254 * @return Current visibility.
255 */
256 boolean registerWallpaperVisibilityListener(IWallpaperVisibilityListener listener,
257 int displayId);
258
259 /**
260 * Remove a visibility watcher that was added using registerWallpaperVisibilityListener.
261 */
262 void unregisterWallpaperVisibilityListener(IWallpaperVisibilityListener listener,
263 int displayId);
264
265 /**
Dianne Hackborn27eac1d2015-03-16 17:15:53 -0700266 * Used only for assist -- request a screenshot of the current application.
267 */
Winson Chungda2818f2017-10-23 16:25:49 -0700268 boolean requestAssistScreenshot(IAssistDataReceiver receiver);
Dianne Hackborn27eac1d2015-03-16 17:15:53 -0700269
270 /**
Joe Onorato664644d2011-01-23 17:53:23 -0800271 * Called by the status bar to notify Views of changes to System UI visiblity.
272 */
Tiger Huang7c610aa2018-10-27 00:01:01 +0800273 oneway void statusBarVisibilityChanged(int displayId, int visibility);
Jeff Brown1a84fd12011-06-02 01:26:32 -0700274
275 /**
Winsonab216602016-08-09 14:05:20 -0700276 * Called by System UI to notify of changes to the visibility of Recents.
277 */
278 oneway void setRecentsVisibility(boolean visible);
279
280 /**
281 * Called by System UI to notify of changes to the visibility of PIP.
282 */
Winson Chungac52f282017-03-30 14:44:52 -0700283 oneway void setPipVisibility(boolean visible);
Winsonab216602016-08-09 14:05:20 -0700284
Tracy Zhou43513082018-03-08 21:58:36 -0800285 /**
286 * Called by System UI to notify of changes to the visibility and height of the shelf.
287 */
288 void setShelfHeight(boolean visible, int shelfHeight);
289
290 /**
Matthew Ng64543e62018-02-28 17:35:10 -0800291 * Called by System UI to enable or disable haptic feedback on the navigation bar buttons.
292 */
293 void setNavBarVirtualKeyHapticFeedbackEnabled(boolean enabled);
294
Winsonab216602016-08-09 14:05:20 -0700295 /**
Charles Chenea6e7f02018-11-19 21:37:45 +0800296 * Device has a software navigation bar (separate from the status bar) on specific display.
297 *
298 * @param displayId the id of display to check if there is a software navigation bar.
Daniel Sandler0c4ccff2011-10-19 16:39:14 -0400299 */
Charles Chenea6e7f02018-11-19 21:37:45 +0800300 boolean hasNavigationBar(int displayId);
Jim Miller93c518e2012-01-17 15:55:31 -0800301
302 /**
Tracy Zhou43513082018-03-08 21:58:36 -0800303 * Get the position of the nav bar
304 */
Tiger Huang44c04552018-11-29 20:06:45 +0800305 int getNavBarPosition(int displayId);
Matthew Nga8f24262017-12-19 11:54:24 -0800306
307 /**
Adam Cohenf7522022012-10-03 20:03:18 -0700308 * Lock the device immediately with the specified options (can be null).
Jim Miller93c518e2012-01-17 15:55:31 -0800309 */
Adam Cohenf7522022012-10-03 20:03:18 -0700310 void lockNow(in Bundle options);
Svetoslav Ganovc9c9a482012-07-16 08:46:07 -0700311
312 /**
Jim Millerbfec0a82012-11-05 20:05:22 -0800313 * Device is in safe mode.
314 */
315 boolean isSafeModeEnabled();
Jorim Jaggicff0acb2014-03-31 16:35:15 +0200316
317 /**
318 * Enables the screen if all conditions are met.
319 */
320 void enableScreenIfNeeded();
Svetoslavdd137a82014-04-10 12:48:07 -0700321
322 /**
Svetoslav1376d602014-03-13 11:17:26 -0700323 * Clears the frame statistics for a given window.
324 *
325 * @param token The window token.
326 * @return Whether the frame statistics were cleared.
327 */
328 boolean clearWindowContentFrameStats(IBinder token);
329
330 /**
331 * Gets the content frame statistics for a given window.
332 *
333 * @param token The window token.
334 * @return The frame statistics or null if the window does not exist.
335 */
336 WindowContentFrameStats getWindowContentFrameStats(IBinder token);
Jorim Jaggi61f39a72015-10-29 16:54:18 +0100337
338 /**
339 * @return the dock side the current docked stack is at; must be one of the
340 * WindowManagerGlobal.DOCKED_* values
341 */
342 int getDockedStackSide();
343
344 /**
Jorim Jaggid47e7e12016-03-01 09:57:38 +0100345 * Sets the region the user can touch the divider. This region will be excluded from the region
346 * which is used to cause a focus switch when dispatching touch.
347 */
348 void setDockedStackDividerTouchRegion(in Rect touchableRegion);
349
350 /**
Jorim Jaggia6c934e2015-12-21 13:22:31 +0100351 * Registers a listener that will be called when the dock divider changes its visibility or when
352 * the docked stack gets added/removed.
Filip Gruszczynski64cdc142015-11-29 21:10:07 -0800353 */
Jorim Jaggia6c934e2015-12-21 13:22:31 +0100354 void registerDockedStackListener(IDockedStackListener listener);
Jorim Jaggi50981592015-12-29 17:54:12 +0100355
356 /**
Winson Chung655332c2016-10-31 13:14:28 -0700357 * Registers a listener that will be called when the pinned stack state changes.
358 */
359 void registerPinnedStackListener(int displayId, IPinnedStackListener listener);
360
361 /**
Jorim Jaggi50981592015-12-29 17:54:12 +0100362 * Updates the dim layer used while resizing.
363 *
364 * @param visible Whether the dim layer should be visible.
Wale Ogunwale68278562017-09-23 17:13:55 -0700365 * @param targetWindowingMode The windowing mode of the stack the dim layer should be placed on.
Jorim Jaggi50981592015-12-29 17:54:12 +0100366 * @param alpha The translucency of the dim layer, between 0 and 1.
367 */
Wale Ogunwale68278562017-09-23 17:13:55 -0700368 void setResizeDimLayer(boolean visible, int targetWindowingMode, float alpha);
Clara Bayarri75e09792015-07-29 16:20:40 +0100369
370 /**
371 * Requests Keyboard Shortcuts from the displayed window.
372 *
373 * @param receiver The receiver to deliver the results to.
374 */
Clara Bayarrifcd7e802016-03-10 12:58:18 +0000375 void requestAppKeyboardShortcuts(IResultReceiver receiver, int deviceId);
Jorim Jaggic6c89a82016-01-28 17:48:21 -0800376
377 /**
378 * Retrieves the current stable insets from the primary display.
379 */
Winson Chung303c6b72016-10-24 17:12:49 -0700380 void getStableInsets(int displayId, out Rect outInsets);
Muyuan Li94ce94e2016-02-24 16:20:54 -0800381
382 /**
383 * Register shortcut key. Shortcut code is packed as:
384 * (MetaState << Integer.SIZE) | KeyCode
385 * @hide
386 */
387 void registerShortcutKey(in long shortcutCode, IShortcutService keySubscriber);
Vladislav Kaznacheev0d50d862016-03-29 15:43:28 -0700388
389 /**
Arthur Hung39134b22018-08-14 11:58:28 +0800390 * Create an input consumer by name and display id.
Vladislav Kaznacheev0d50d862016-03-29 15:43:28 -0700391 */
Arthur Hung39134b22018-08-14 11:58:28 +0800392 void createInputConsumer(IBinder token, String name, int displayId,
393 out InputChannel inputChannel);
Vladislav Kaznacheev0d50d862016-03-29 15:43:28 -0700394
395 /**
Arthur Hung39134b22018-08-14 11:58:28 +0800396 * Destroy an input consumer by name and display id.
397 * This method will also dispose the input channels associated with that InputConsumer.
Vladislav Kaznacheev0d50d862016-03-29 15:43:28 -0700398 */
Arthur Hung39134b22018-08-14 11:58:28 +0800399 boolean destroyInputConsumer(String name, int displayId);
Albert Chaulk56162a02017-06-05 19:35:23 -0400400
401 /**
402 * Return the touch region for the current IME window, or an empty region if there is none.
403 */
404 Region getCurrentImeTouchRegion();
Vishnu Nairc9615042018-01-09 07:23:31 -0800405
406 /**
Adrian Roos962017e2018-11-27 15:11:46 +0100407 * Registers an IDisplayFoldListener.
408 */
409 void registerDisplayFoldListener(IDisplayFoldListener listener);
410
411 /**
412 * Unregisters an IDisplayFoldListener.
413 */
414 void unregisterDisplayFoldListener(IDisplayFoldListener listener);
415
416 /**
Vishnu Nairc9615042018-01-09 07:23:31 -0800417 * Starts a window trace.
418 */
419 void startWindowTrace();
420
421 /**
422 * Stops a window trace.
423 */
424 void stopWindowTrace();
425
426 /**
427 * Returns true if window trace is enabled.
428 */
429 boolean isWindowTraceEnabled();
Yoshiaki Nakae1bdfc822017-09-15 15:24:34 +0900430
431 /**
Jordan Liuc0228762018-07-13 11:39:42 -0700432 * Requests that the WindowManager sends
433 * WindowManagerPolicyConstants#ACTION_USER_ACTIVITY_NOTIFICATION on the next user activity.
Yoshiaki Nakae1bdfc822017-09-15 15:24:34 +0900434 */
435 void requestUserActivityNotification();
Andrii Kulianf0379de2018-03-14 16:24:07 -0700436
437 /**
438 * Notify WindowManager that it should not override the info in DisplayManager for the specified
439 * display. This can disable letter- or pillar-boxing applied in DisplayManager when the metrics
440 * of the logical display reported from WindowManager do not correspond to the metrics of the
441 * physical display it is based on.
442 *
443 * @param displayId The id of the display.
444 */
445 void dontOverrideDisplayInfo(int displayId);
Chilun8753ad32018-10-09 15:56:45 +0800446
447 /**
448 * Gets the windowing mode of the display.
449 *
450 * @param displayId The id of the display.
451 * @return {@link WindowConfiguration.WindowingMode}
452 */
453 int getWindowingMode(int displayId);
454
455 /**
456 * Sets the windowing mode of the display.
457 *
458 * @param displayId The id of the display.
459 * @param mode {@link WindowConfiguration.WindowingMode}
460 */
461 void setWindowingMode(int displayId, int mode);
462
463 /**
464 * Gets current remove content mode of the display.
465 * <p>
466 * What actions should be performed with the display's content when it is removed. Default
467 * behavior for public displays in this case is to move all activities to the primary display
468 * and make it focused. For private display is to destroy all activities.
469 * </p>
470 *
471 * @param displayId The id of the display.
472 * @return The remove content mode of the display.
473 * @see WindowManager#REMOVE_CONTENT_MODE_MOVE_TO_PRIMARY
474 * @see WindowManager#REMOVE_CONTENT_MODE_DESTROY
475 */
476 int getRemoveContentMode(int displayId);
477
478 /**
479 * Sets the remove content mode of the display.
480 * <p>
481 * This mode indicates what actions should be performed with the display's content when it is
482 * removed.
483 * </p>
484 *
485 * @param displayId The id of the display.
486 * @param mode Remove content mode.
487 * @see WindowManager#REMOVE_CONTENT_MODE_MOVE_TO_PRIMARY
488 * @see WindowManager#REMOVE_CONTENT_MODE_DESTROY
489 */
490 void setRemoveContentMode(int displayId, int mode);
491
492 /**
493 * Indicates that the display should show its content when non-secure keyguard is shown.
494 * <p>
495 * This flag identifies secondary displays that will continue showing content if keyguard can be
496 * dismissed without entering credentials.
497 * </p><p>
498 * An example of usage is a virtual display which content is displayed on external hardware
499 * display that is not visible to the system directly.
500 * </p>
501 *
502 * @param displayId The id of the display.
503 * @return {@code true} if the display should show its content when non-secure keyguard is
504 * shown.
505 * @see KeyguardManager#isDeviceSecure()
506 * @see KeyguardManager#isDeviceLocked()
507 */
508 boolean shouldShowWithInsecureKeyguard(int displayId);
509
510 /**
511 * Sets that the display should show its content when non-secure keyguard is shown.
512 *
513 * @param displayId The id of the display.
514 * @param shouldShow Indicates that the display should show its content when non-secure keyguard
515 * is shown.
516 * @see KeyguardManager#isDeviceSecure()
517 * @see KeyguardManager#isDeviceLocked()
518 */
519 void setShouldShowWithInsecureKeyguard(int displayId, boolean shouldShow);
520
521 /**
522 * Indicates the display should show system decors.
523 * <p>
524 * System decors include status bar, navigation bar, launcher.
525 * </p>
526 *
527 * @param displayId The id of the display.
528 * @return {@code true} if the display should show system decors.
529 */
530 boolean shouldShowSystemDecors(int displayId);
531
532 /**
533 * Sets that the display should show system decors.
534 * <p>
535 * System decors include status bar, navigation bar, launcher.
536 * </p>
537 *
538 * @param displayId The id of the display.
539 * @param shouldShow Indicates that the display should show system decors.
540 */
541 void setShouldShowSystemDecors(int displayId, boolean shouldShow);
542
543 /**
544 * Indicates that the display should show IME.
545 *
546 * @param displayId The id of the display.
547 * @return {@code true} if the display should show IME.
548 * @see KeyguardManager#isDeviceSecure()
549 * @see KeyguardManager#isDeviceLocked()
550 */
551 boolean shouldShowIme(int displayId);
552
553 /**
554 * Sets that the display should show IME.
555 *
556 * @param displayId The id of the display.
557 * @param shouldShow Indicates that the display should show IME.
558 * @see KeyguardManager#isDeviceSecure()
559 * @see KeyguardManager#isDeviceLocked()
560 */
561 void setShouldShowIme(int displayId, boolean shouldShow);
chaviwff2e7d82018-11-02 11:11:27 -0700562
563 /**
564 * Reparent the top layers for a display to the requested surfaceControl. The display that
565 * is going to be re-parented (the displayId passed in) needs to have been created by the same
566 * process that is requesting the re-parent. This is to ensure clients can't just re-parent
567 * display content info to any SurfaceControl, as this would be a security issue.
568 *
569 * @param displayId The id of the display.
Robert Carr10584fa2019-01-14 15:55:19 -0800570 * @param surfaceControlHandle The SurfaceControl that the top level layers for the
chaviwff2e7d82018-11-02 11:11:27 -0700571 * display should be re-parented to.
572 */
Robert Carr10584fa2019-01-14 15:55:19 -0800573 void reparentDisplayContent(int displayId, in SurfaceControl sc);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800574}