• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2 ** Copyright 2006, The Android Open Source Project
3 **
4 ** Licensed under the Apache License, Version 2.0 (the "License");
5 ** you may not use this file except in compliance with the License.
6 ** You may obtain a copy of the License at
7 **
8 **     http://www.apache.org/licenses/LICENSE-2.0
9 **
10 ** Unless required by applicable law or agreed to in writing, software
11 ** distributed under the License is distributed on an "AS IS" BASIS,
12 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 ** See the License for the specific language governing permissions and
14 ** limitations under the License.
15 */
16 
17 package android.view;
18 
19 import com.android.internal.os.IResultReceiver;
20 import com.android.internal.policy.IKeyguardDismissCallback;
21 import com.android.internal.policy.IKeyguardLockedStateListener;
22 import com.android.internal.policy.IShortcutService;
23 
24 import android.app.IApplicationThread;
25 import android.app.IAssistDataReceiver;
26 import android.content.ComponentName;
27 import android.content.res.CompatibilityInfo;
28 import android.content.res.Configuration;
29 import android.graphics.Bitmap;
30 import android.graphics.GraphicBuffer;
31 import android.graphics.Point;
32 import android.graphics.Rect;
33 import android.graphics.Region;
34 import android.os.Bundle;
35 import android.os.IRemoteCallback;
36 import android.os.ParcelFileDescriptor;
37 import android.view.DisplayCutout;
38 import android.view.DisplayInfo;
39 import android.view.IAppTransitionAnimationSpecsFuture;
40 import android.view.ICrossWindowBlurEnabledListener;
41 import android.view.IDisplayWindowInsetsController;
42 import android.view.IDisplayWindowListener;
43 import android.view.IDisplayFoldListener;
44 import android.view.IDisplayChangeWindowController;
45 import android.view.IOnKeyguardExitResult;
46 import android.view.IPinnedTaskListener;
47 import android.view.IScrollCaptureResponseListener;
48 import android.view.RemoteAnimationAdapter;
49 import android.view.IRotationWatcher;
50 import android.view.ISystemGestureExclusionListener;
51 import android.view.IDecorViewGestureListener;
52 import android.view.IWallpaperVisibilityListener;
53 import android.view.IWindow;
54 import android.view.IWindowSession;
55 import android.view.IWindowSessionCallback;
56 import android.view.KeyEvent;
57 import android.view.InputEvent;
58 import android.view.InsetsState;
59 import android.view.MagnificationSpec;
60 import android.view.MotionEvent;
61 import android.view.InputChannel;
62 import android.view.InputDevice;
63 import android.view.IInputFilter;
64 import android.view.AppTransitionAnimationSpec;
65 import android.view.WindowContentFrameStats;
66 import android.view.WindowManager;
67 import android.view.SurfaceControl;
68 import android.view.displayhash.DisplayHash;
69 import android.view.displayhash.VerifiedDisplayHash;
70 import android.window.AddToSurfaceSyncGroupResult;
71 import android.window.IGlobalDragListener;
72 import android.window.IScreenRecordingCallback;
73 import android.window.ISurfaceSyncGroupCompletedListener;
74 import android.window.ITaskFpsCallback;
75 import android.window.ITrustedPresentationListener;
76 import android.window.InputTransferToken;
77 import android.window.ScreenCapture;
78 import android.window.TrustedPresentationThresholds;
79 import android.window.WindowContextInfo;
80 
81 /**
82  * System private interface to the window manager.
83  *
84  * {@hide}
85  */
86 interface IWindowManager
87 {
88     /**
89      * No overridden behavior is provided in terms of fixing rotation to user rotation. Use
90      * other flags to derive the default behavior, such as {@link WindowManagerService#mIsPc}
91      * and {@link WindowManagerService#mForceDesktopModeOnExternalDisplays}.
92      */
93     const int FIXED_TO_USER_ROTATION_DEFAULT = 0;
94     /**
95      * Don't fix display rotation to {@link DisplayRotation#mUserRotation} only. Always allow
96      * other factors to play a role in deciding display rotation.
97      */
98     const int FIXED_TO_USER_ROTATION_DISABLED = 1;
99     /**
100      * Only use {@link DisplayRotation#mUserRotation} as the display rotation.
101      */
102     const int FIXED_TO_USER_ROTATION_ENABLED = 2;
103     /**
104      * If auto-rotation is not supported, {@link DisplayRotation#mUserRotation} will be used.
105      * Otherwise the behavior is same as {link #FIXED_TO_USER_ROTATION_DISABLED}.
106      */
107     const int FIXED_TO_USER_ROTATION_IF_NO_AUTO_ROTATION = 3;
108 
109     /**
110      * ===== NOTICE =====
111      * The first three methods must remain the first three methods. Scripts
112      * and tools rely on their transaction number to work properly.
113      */
114     // This is used for debugging
startViewServer(int port)115     boolean startViewServer(int port);   // Transaction #1
stopViewServer()116     boolean stopViewServer();            // Transaction #2
isViewServerRunning()117     boolean isViewServerRunning();       // Transaction #3
118 
openSession(in IWindowSessionCallback callback)119     IWindowSession openSession(in IWindowSessionCallback callback);
120 
121     @UnsupportedAppUsage
getInitialDisplaySize(int displayId, out Point size)122     void getInitialDisplaySize(int displayId, out Point size);
123     @UnsupportedAppUsage
getBaseDisplaySize(int displayId, out Point size)124     void getBaseDisplaySize(int displayId, out Point size);
125     @EnforcePermission("WRITE_SECURE_SETTINGS")
setForcedDisplaySize(int displayId, int width, int height)126     void setForcedDisplaySize(int displayId, int width, int height);
127     @EnforcePermission("WRITE_SECURE_SETTINGS")
clearForcedDisplaySize(int displayId)128     void clearForcedDisplaySize(int displayId);
129     @UnsupportedAppUsage
getInitialDisplayDensity(int displayId)130     int getInitialDisplayDensity(int displayId);
getBaseDisplayDensity(int displayId)131     int getBaseDisplayDensity(int displayId);
getDisplayIdByUniqueId(String uniqueId)132     int getDisplayIdByUniqueId(String uniqueId);
133     @EnforcePermission("WRITE_SECURE_SETTINGS")
setForcedDisplayDensityForUser(int displayId, int density, int userId)134     void setForcedDisplayDensityForUser(int displayId, int density, int userId);
135     @EnforcePermission("WRITE_SECURE_SETTINGS")
clearForcedDisplayDensityForUser(int displayId, int userId)136     void clearForcedDisplayDensityForUser(int displayId, int userId);
137     @EnforcePermission("WRITE_SECURE_SETTINGS")
setForcedDisplayScalingMode(int displayId, int mode)138     void setForcedDisplayScalingMode(int displayId, int mode); // 0 = auto, 1 = disable
139 
140     // These can only be called when holding the MANAGE_APP_TOKENS permission.
setEventDispatching(boolean enabled)141     void setEventDispatching(boolean enabled);
142 
143     /** Returns {@code true} if this binder is a registered window token. */
isWindowToken(in IBinder binder)144     boolean isWindowToken(in IBinder binder);
145     /**
146      * Adds window token for a given type.
147      *
148      * @param token Token to be registered.
149      * @param type Window type to be used with this token.
150      * @param displayId The ID of the display where this token should be added.
151      * @param options A bundle used to pass window-related options.
152      */
addWindowToken(IBinder token, int type, int displayId, in Bundle options)153     void addWindowToken(IBinder token, int type, int displayId, in Bundle options);
154     /**
155      * Remove window token on a specific display.
156      *
157      * @param token Token to be removed
158      * @displayId The ID of the display where this token should be removed.
159      */
removeWindowToken(IBinder token, int displayId)160     void removeWindowToken(IBinder token, int displayId);
161 
162     /**
163      * Sets a singular remote controller of display rotations. There can only be one. The
164      * controller is called after the display has "frozen" for a rotation and display rotation will
165      * only continue once the controller has finished calculating associated configurations.
166      */
setDisplayChangeWindowController(IDisplayChangeWindowController controller)167     void setDisplayChangeWindowController(IDisplayChangeWindowController controller);
168 
169     /**
170      * Adds a root container that a client shell can populate with its own windows (usually via
171      * WindowlessWindowManager).
172      *
173      * @param client an IWindow used for window-level communication (ime, finish draw, etc.).
174      * @param shellRootLayer The container's layer. See WindowManager#ShellRootLayer.
175      * @return a SurfaceControl to add things to.
176      */
177     @EnforcePermission("MANAGE_APP_TOKENS")
addShellRoot(int displayId, IWindow client, int shellRootLayer)178     SurfaceControl addShellRoot(int displayId, IWindow client, int shellRootLayer);
179 
180     /**
181      * Sets the window token sent to accessibility for a particular shell root. The
182      * displayId and windowType identify which shell-root to update.
183      *
184      * @param target The IWindow that accessibility service interfaces with.
185      */
186     @EnforcePermission("MANAGE_APP_TOKENS")
setShellRootAccessibilityWindow(int displayId, int shellRootLayer, IWindow target)187     void setShellRootAccessibilityWindow(int displayId, int shellRootLayer, IWindow target);
188 
189     /**
190      * Like overridePendingAppTransitionMultiThumb, but uses a future to supply the specs. This is
191      * used for recents, where generating the thumbnails of the specs takes a non-trivial amount of
192      * time, so we want to move that off the critical path for starting the new activity.
193      */
194     @UnsupportedAppUsage
overridePendingAppTransitionMultiThumbFuture( IAppTransitionAnimationSpecsFuture specsFuture, IRemoteCallback startedCallback, boolean scaleUp, int displayId)195     void overridePendingAppTransitionMultiThumbFuture(
196             IAppTransitionAnimationSpecsFuture specsFuture, IRemoteCallback startedCallback,
197             boolean scaleUp, int displayId);
198     @UnsupportedAppUsage
overridePendingAppTransitionRemote(in RemoteAnimationAdapter remoteAnimationAdapter, int displayId)199     void overridePendingAppTransitionRemote(in RemoteAnimationAdapter remoteAnimationAdapter,
200             int displayId);
201 
202     /**
203       * Used by system ui to report that recents has shown itself.
204       * @deprecated to be removed once prebuilts are updated
205       */
206     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
endProlongedAnimations()207     void endProlongedAnimations();
208 
startFreezingScreen(int exitAnim, int enterAnim)209     void startFreezingScreen(int exitAnim, int enterAnim);
stopFreezingScreen()210     void stopFreezingScreen();
211 
212     // these require DISABLE_KEYGUARD permission
213     /** @deprecated use Activity.setShowWhenLocked instead. */
disableKeyguard(IBinder token, String tag, int userId)214     void disableKeyguard(IBinder token, String tag, int userId);
215     /** @deprecated use Activity.setShowWhenLocked instead. */
reenableKeyguard(IBinder token, int userId)216     void reenableKeyguard(IBinder token, int userId);
217     @EnforcePermission("DISABLE_KEYGUARD")
exitKeyguardSecurely(IOnKeyguardExitResult callback)218     void exitKeyguardSecurely(IOnKeyguardExitResult callback);
219     @UnsupportedAppUsage
isKeyguardLocked()220     boolean isKeyguardLocked();
221     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
isKeyguardSecure(int userId)222     boolean isKeyguardSecure(int userId);
dismissKeyguard(IKeyguardDismissCallback callback, CharSequence message)223     void dismissKeyguard(IKeyguardDismissCallback callback, CharSequence message);
224 
225     @JavaPassthrough(annotation = "@android.annotation.RequiresPermission(android.Manifest"
226             + ".permission.SUBSCRIBE_TO_KEYGUARD_LOCKED_STATE)")
addKeyguardLockedStateListener(in IKeyguardLockedStateListener listener)227     void addKeyguardLockedStateListener(in IKeyguardLockedStateListener listener);
228 
229     @JavaPassthrough(annotation = "@android.annotation.RequiresPermission(android.Manifest"
230             + ".permission.SUBSCRIBE_TO_KEYGUARD_LOCKED_STATE)")
removeKeyguardLockedStateListener(in IKeyguardLockedStateListener listener)231     void removeKeyguardLockedStateListener(in IKeyguardLockedStateListener listener);
232 
233     // Requires INTERACT_ACROSS_USERS_FULL permission
setSwitchingUser(boolean switching)234     void setSwitchingUser(boolean switching);
235 
closeSystemDialogs(String reason)236     void closeSystemDialogs(String reason);
237 
238     // These can only be called with the SET_ANIMATON_SCALE permission.
239     @UnsupportedAppUsage
getAnimationScale(int which)240     float getAnimationScale(int which);
241     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
getAnimationScales()242     float[] getAnimationScales();
243     @UnsupportedAppUsage
setAnimationScale(int which, float scale)244     void setAnimationScale(int which, float scale);
245     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
setAnimationScales(in float[] scales)246     void setAnimationScales(in float[] scales);
247 
getCurrentAnimatorScale()248     float getCurrentAnimatorScale();
249 
250     // Request to change the touch mode on the display represented by the displayId parameter.
251     //
252     // If com.android.internal.R.bool.config_perDisplayFocusEnabled is false, then it will request
253     // to change the touch mode on all displays (disregarding displayId parameter).
setInTouchMode(boolean inTouch, int displayId)254     void setInTouchMode(boolean inTouch, int displayId);
255 
256     // Request to change the touch mode on all displays (disregarding the value
257     // com.android.internal.R.bool.config_perDisplayFocusEnabled).
setInTouchModeOnAllDisplays(boolean inTouch)258     void setInTouchModeOnAllDisplays(boolean inTouch);
259 
260     // Returns the touch mode state for the display represented by the displayId parameter.
isInTouchMode(int displayId)261     boolean isInTouchMode(int displayId);
262 
263     // For StrictMode flashing a red border on violations from the UI
264     // thread.  The uid/pid is implicit from the Binder call, and the Window
265     // Manager uses that to determine whether or not the red border should
266     // actually be shown.  (it will be ignored that pid doesn't have windows
267     // on screen)
268     @UnsupportedAppUsage(maxTargetSdk = 28)
showStrictModeViolation(boolean on)269     void showStrictModeViolation(boolean on);
270 
271     // Proxy to set the system property for whether the flashing
272     // should be enabled.  The 'enabled' value is null or blank for
273     // the system default (differs per build variant) or any valid
274     // boolean string as parsed by SystemProperties.getBoolean().
275     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
setStrictModeVisualIndicatorPreference(String enabled)276     void setStrictModeVisualIndicatorPreference(String enabled);
277 
278     /**
279      * Set whether screen capture is disabled for all windows of a specific user from
280      * the device policy cache.
281      */
refreshScreenCaptureDisabled()282     void refreshScreenCaptureDisabled();
283 
284     /**
285      * Retrieve the current orientation of the primary screen.
286      * @return Constant as per {@link android.view.Surface.Rotation}.
287      *
288      * @see android.view.Display#DEFAULT_DISPLAY
289      */
getDefaultDisplayRotation()290     int getDefaultDisplayRotation();
291 
292     /**
293      * Retrieve the display user rotation.
294      * @param displayId Id of the display
295      * @return Rotation one of {@link android.view.Surface#ROTATION_0},
296      *        {@link android.view.Surface#ROTATION_90}, {@link android.view.Surface#ROTATION_180},
297      *        {@link android.view.Surface#ROTATION_270} or -1 if display is not found.
298      */
getDisplayUserRotation(int displayId)299     int getDisplayUserRotation(int displayId);
300 
301     /**
302      * Watch the rotation of the specified screen.  Returns the current rotation,
303      * calls back when it changes.
304      */
watchRotation(IRotationWatcher watcher, int displayId)305     int watchRotation(IRotationWatcher watcher, int displayId);
306 
307     /**
308      * Remove a rotation watcher set using watchRotation.
309      * @hide
310      */
311     @UnsupportedAppUsage
removeRotationWatcher(IRotationWatcher watcher)312     void removeRotationWatcher(IRotationWatcher watcher);
313 
314     /** Registers the listener to the context token and returns the current proposed rotation. */
registerProposedRotationListener(IBinder contextToken, IRotationWatcher listener)315     int registerProposedRotationListener(IBinder contextToken, IRotationWatcher listener);
316 
317     /**
318      * Determine the preferred edge of the screen to pin the compact options menu against.
319      *
320      * @param displayId Id of the display where the menu window currently resides.
321      * @return a Gravity value for the options menu panel.
322      * @hide
323      */
getPreferredOptionsPanelGravity(int displayId)324     int getPreferredOptionsPanelGravity(int displayId);
325 
326     /**
327      * Equivalent to calling {@link #freezeDisplayRotation(int, int)} with {@link
328      * android.view.Display#DEFAULT_DISPLAY} and given rotation.
329      */
330     @UnsupportedAppUsage
freezeRotation(int rotation, String caller)331     void freezeRotation(int rotation, String caller);
332 
333     /**
334      * Equivalent to calling {@link #thawDisplayRotation(int)} with {@link
335      * android.view.Display#DEFAULT_DISPLAY}.
336      */
337     @UnsupportedAppUsage
thawRotation(String caller)338     void thawRotation(String caller);
339 
340     /**
341      * Equivelant to call {@link #isDisplayRotationFrozen(int)} with {@link
342      * android.view.Display#DEFAULT_DISPLAY}.
343      */
isRotationFrozen()344     boolean isRotationFrozen();
345 
346     /**
347      * Lock the display orientation to the specified rotation, or to the current
348      * rotation if -1. Sensor input will be ignored until thawRotation() is called.
349      *
350      * @param displayId the ID of display which rotation should be frozen.
351      * @param rotation one of {@link android.view.Surface#ROTATION_0},
352      *        {@link android.view.Surface#ROTATION_90}, {@link android.view.Surface#ROTATION_180},
353      *        {@link android.view.Surface#ROTATION_270} or -1 to freeze it to current rotation.
354      * @hide
355      */
freezeDisplayRotation(int displayId, int rotation, String caller)356     void freezeDisplayRotation(int displayId, int rotation, String caller);
357 
358     /**
359      * Release the orientation lock imposed by freezeRotation() on the display.
360      *
361      * @param displayId the ID of display which rotation should be thawed.
362      * @hide
363      */
thawDisplayRotation(int displayId, String caller)364     void thawDisplayRotation(int displayId, String caller);
365 
366     /**
367      * Gets whether the rotation is frozen on the display.
368      *
369      * @param displayId the ID of display which frozen is needed.
370      * @return Whether the rotation is frozen.
371      */
isDisplayRotationFrozen(int displayId)372     boolean isDisplayRotationFrozen(int displayId);
373 
374    /**
375     *  Sets if display rotation is fixed to user specified value for given displayId.
376     */
setFixedToUserRotation(int displayId, int fixedToUserRotation)377     void setFixedToUserRotation(int displayId, int fixedToUserRotation);
378 
379    /**
380     *  Sets if all requested fixed orientation should be ignored for given displayId.
381     */
setIgnoreOrientationRequest(int displayId, boolean ignoreOrientationRequest)382     void setIgnoreOrientationRequest(int displayId, boolean ignoreOrientationRequest);
383 
384     /**
385      * Screenshot the current wallpaper layer, including the whole screen.
386      */
screenshotWallpaper()387     Bitmap screenshotWallpaper();
388 
389     /**
390      * Mirrors the wallpaper for the given display.
391      *
392      * @param displayId ID of the display for the wallpaper.
393      * @return A SurfaceControl for the parent of the mirrored wallpaper.
394      */
mirrorWallpaperSurface(int displayId)395     SurfaceControl mirrorWallpaperSurface(int displayId);
396 
397     /**
398      * Registers a wallpaper visibility listener.
399      * @return Current visibility.
400      */
registerWallpaperVisibilityListener(IWallpaperVisibilityListener listener, int displayId)401     boolean registerWallpaperVisibilityListener(IWallpaperVisibilityListener listener,
402         int displayId);
403 
404     /**
405      * Remove a visibility watcher that was added using registerWallpaperVisibilityListener.
406      */
unregisterWallpaperVisibilityListener(IWallpaperVisibilityListener listener, int displayId)407     void unregisterWallpaperVisibilityListener(IWallpaperVisibilityListener listener,
408         int displayId);
409 
410     /**
411      * Registers a system gesture exclusion listener for a given display.
412      */
registerSystemGestureExclusionListener(ISystemGestureExclusionListener listener, int displayId)413     void registerSystemGestureExclusionListener(ISystemGestureExclusionListener listener,
414         int displayId);
415 
416     /**
417      * Unregisters a system gesture exclusion listener for a given display.
418      */
unregisterSystemGestureExclusionListener(ISystemGestureExclusionListener listener, int displayId)419     void unregisterSystemGestureExclusionListener(ISystemGestureExclusionListener listener,
420         int displayId);
421 
422     /**
423      * Used only for assist -- request a screenshot of the current application.
424      */
requestAssistScreenshot(IAssistDataReceiver receiver)425     boolean requestAssistScreenshot(IAssistDataReceiver receiver);
426 
427     /**
428      * Called by System UI to notify Window Manager to hide transient bars.
429      */
hideTransientBars(int displayId)430     oneway void hideTransientBars(int displayId);
431 
432     /**
433      * Called by System UI to notify of changes to the visibility of Recents.
434      */
setRecentsVisibility(boolean visible)435     oneway void setRecentsVisibility(boolean visible);
436 
437     /**
438     * Called by System UI to indicate the maximum bounds of the system Privacy Indicator, for the
439     * current orientation, whether the indicator is showing or not. Should be an array of length
440     * 4, with the bounds for ROTATION_0, 90, 180, and 270, in that order.
441     */
updateStaticPrivacyIndicatorBounds(int displayId, in Rect[] staticBounds)442      oneway void updateStaticPrivacyIndicatorBounds(int displayId, in Rect[] staticBounds);
443 
444     /**
445      * Called by System UI to enable or disable haptic feedback on the navigation bar buttons.
446      */
447     @EnforcePermission("STATUS_BAR")
448     @UnsupportedAppUsage
setNavBarVirtualKeyHapticFeedbackEnabled(boolean enabled)449     void setNavBarVirtualKeyHapticFeedbackEnabled(boolean enabled);
450 
451     /**
452      * Device has a software navigation bar (separate from the status bar) on specific display.
453      *
454      * @param displayId the id of display to check if there is a software navigation bar.
455      */
456     @UnsupportedAppUsage
hasNavigationBar(int displayId)457     boolean hasNavigationBar(int displayId);
458 
459     /**
460      * Lock the device immediately with the specified options (can be null).
461      */
462     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
lockNow(in Bundle options)463     void lockNow(in Bundle options);
464 
465     /**
466      * Device is in safe mode.
467      */
468     @UnsupportedAppUsage
isSafeModeEnabled()469     boolean isSafeModeEnabled();
470 
471     /**
472      * Clears the frame statistics for a given window.
473      *
474      * @param token The window token.
475      * @return Whether the frame statistics were cleared.
476      */
clearWindowContentFrameStats(IBinder token)477     boolean clearWindowContentFrameStats(IBinder token);
478 
479     /**
480      * Gets the content frame statistics for a given window.
481      *
482      * @param token The window token.
483      * @return The frame statistics or null if the window does not exist.
484      */
getWindowContentFrameStats(IBinder token)485     WindowContentFrameStats getWindowContentFrameStats(IBinder token);
486 
487     /**
488      * This is a no-op.
489      */
490     @UnsupportedAppUsage
getDockedStackSide()491     int getDockedStackSide();
492 
493     /**
494      * Registers a listener that will be called when the pinned task state changes.
495      */
registerPinnedTaskListener(int displayId, IPinnedTaskListener listener)496     void registerPinnedTaskListener(int displayId, IPinnedTaskListener listener);
497 
498     /**
499      * Requests Keyboard Shortcuts from the displayed window.
500      *
501      * @param receiver The receiver to deliver the results to.
502      * @param deviceId The deviceId of KeyEvent by which this request is triggered, or -1 if it's
503      *                 not triggered by a KeyEvent.
504      * @see #requestImeKeyboardShortcuts(IResultReceiver, int)
505      */
requestAppKeyboardShortcuts(IResultReceiver receiver, int deviceId)506     void requestAppKeyboardShortcuts(IResultReceiver receiver, int deviceId);
507 
508     /**
509      * Requests Keyboard Shortcuts from currently selected IME.
510      *
511      * @param receiver The receiver to deliver the results to.
512      * @param deviceId The deviceId of KeyEvent by which this request is triggered, or -1 if it's
513      *                 not triggered by a KeyEvent.
514      * @see #requestAppKeyboardShortcuts(IResultReceiver, int)
515      */
requestImeKeyboardShortcuts(IResultReceiver receiver, int deviceId)516     void requestImeKeyboardShortcuts(IResultReceiver receiver, int deviceId);
517 
518     /**
519      * Retrieves the current stable insets from the primary display.
520      */
521     @UnsupportedAppUsage
getStableInsets(int displayId, out Rect outInsets)522     void getStableInsets(int displayId, out Rect outInsets);
523 
524     /**
525      * Register shortcut key. Shortcut code is packed as:
526      * (MetaState << Integer.SIZE) | KeyCode
527      * @hide
528      */
registerShortcutKey(in long shortcutCode, IShortcutService keySubscriber)529     void registerShortcutKey(in long shortcutCode, IShortcutService keySubscriber);
530 
531     /**
532      * Create an input consumer by name and display id.
533      */
534     @UnsupportedAppUsage
createInputConsumer(IBinder token, String name, int displayId, out InputChannel inputChannel)535     void createInputConsumer(IBinder token, String name, int displayId,
536         out InputChannel inputChannel);
537 
538     /**
539      * Destroy an input consumer by token and display id.
540      * This method will also dispose the input channels associated with that InputConsumer.
541      */
542     @UnsupportedAppUsage
destroyInputConsumer(IBinder token, int displayId)543     boolean destroyInputConsumer(IBinder token, int displayId);
544 
545     /**
546      * Return the touch region for the current IME window, or an empty region if there is none.
547      */
548     @EnforcePermission("RESTRICTED_VR_ACCESS")
getCurrentImeTouchRegion()549     Region getCurrentImeTouchRegion();
550 
551     /**
552      * Registers an IDisplayFoldListener.
553      */
registerDisplayFoldListener(IDisplayFoldListener listener)554     void registerDisplayFoldListener(IDisplayFoldListener listener);
555 
556     /**
557      * Unregisters an IDisplayFoldListener.
558      */
unregisterDisplayFoldListener(IDisplayFoldListener listener)559     void unregisterDisplayFoldListener(IDisplayFoldListener listener);
560 
561     /**
562      * Registers an IDisplayContainerListener, and returns the set of existing display ids. The
563      * listener's onDisplayAdded() will not be called for the displays returned.
564      */
registerDisplayWindowListener(IDisplayWindowListener listener)565     int[] registerDisplayWindowListener(IDisplayWindowListener listener);
566 
567     /**
568      * Unregisters an IDisplayContainerListener.
569      */
unregisterDisplayWindowListener(IDisplayWindowListener listener)570     void unregisterDisplayWindowListener(IDisplayWindowListener listener);
571 
572     /**
573      * Starts a window trace.
574      */
startWindowTrace()575     void startWindowTrace();
576 
577     /**
578      * Stops a window trace.
579      */
stopWindowTrace()580     void stopWindowTrace();
581 
582     /**
583     * If window tracing is active, saves the window trace to file, otherwise does nothing
584     */
saveWindowTraceToFile()585     void saveWindowTraceToFile();
586 
587     /**
588      * Returns true if window trace is enabled.
589      */
isWindowTraceEnabled()590     boolean isWindowTraceEnabled();
591 
592     /**
593      * Starts a transition trace.
594      */
startTransitionTrace()595     void startTransitionTrace();
596 
597     /**
598      * Stops a transition trace.
599      */
stopTransitionTrace()600     void stopTransitionTrace();
601 
602     /**
603      * Returns true if transition trace is enabled.
604      */
isTransitionTraceEnabled()605     boolean isTransitionTraceEnabled();
606 
607     /**
608      * Gets the windowing mode of the display.
609      *
610      * @param displayId The id of the display.
611      * @return {@link WindowConfiguration.WindowingMode}
612      */
getWindowingMode(int displayId)613     int getWindowingMode(int displayId);
614 
615     /**
616      * Sets the windowing mode of the display.
617      *
618      * @param displayId The id of the display.
619      * @param mode {@link WindowConfiguration.WindowingMode}
620      */
setWindowingMode(int displayId, int mode)621     void setWindowingMode(int displayId, int mode);
622 
623     /**
624      * Gets current remove content mode of the display.
625      * <p>
626      * What actions should be performed with the display's content when it is removed. Default
627      * behavior for public displays in this case is to move all activities to the primary display
628      * and make it focused. For private display is to destroy all activities.
629      * </p>
630      *
631      * @param displayId The id of the display.
632      * @return The remove content mode of the display.
633      * @see WindowManager#REMOVE_CONTENT_MODE_MOVE_TO_PRIMARY
634      * @see WindowManager#REMOVE_CONTENT_MODE_DESTROY
635      */
getRemoveContentMode(int displayId)636     int getRemoveContentMode(int displayId);
637 
638     /**
639      * Sets the remove content mode of the display.
640      * <p>
641      * This mode indicates what actions should be performed with the display's content when it is
642      * removed.
643      * </p>
644      *
645      * @param displayId The id of the display.
646      * @param mode Remove content mode.
647      * @see WindowManager#REMOVE_CONTENT_MODE_MOVE_TO_PRIMARY
648      * @see WindowManager#REMOVE_CONTENT_MODE_DESTROY
649      */
setRemoveContentMode(int displayId, int mode)650     void setRemoveContentMode(int displayId, int mode);
651 
652     /**
653      * Indicates that the display should show its content when non-secure keyguard is shown.
654      * <p>
655      * This flag identifies secondary displays that will continue showing content if keyguard can be
656      * dismissed without entering credentials.
657      * </p><p>
658      * An example of usage is a virtual display which content is displayed on external hardware
659      * display that is not visible to the system directly.
660      * </p>
661      *
662      * @param displayId The id of the display.
663      * @return {@code true} if the display should show its content when non-secure keyguard is
664      *         shown.
665      * @see KeyguardManager#isDeviceSecure()
666      * @see KeyguardManager#isDeviceLocked()
667      */
shouldShowWithInsecureKeyguard(int displayId)668     boolean shouldShowWithInsecureKeyguard(int displayId);
669 
670     /**
671      * Sets that the display should show its content when non-secure keyguard is shown.
672      *
673      * @param displayId The id of the display.
674      * @param shouldShow Indicates that the display should show its content when non-secure keyguard
675      *                  is shown.
676      * @see KeyguardManager#isDeviceSecure()
677      * @see KeyguardManager#isDeviceLocked()
678      */
setShouldShowWithInsecureKeyguard(int displayId, boolean shouldShow)679     void setShouldShowWithInsecureKeyguard(int displayId, boolean shouldShow);
680 
681     /**
682      * Indicates the display should show system decors.
683      * <p>
684      * System decors include status bar, navigation bar, launcher.
685      * </p>
686      *
687      * @param displayId The id of the display.
688      * @return {@code true} if the display should show system decors.
689      */
shouldShowSystemDecors(int displayId)690     boolean shouldShowSystemDecors(int displayId);
691 
692     /**
693      * Sets that the display should show system decors.
694      * <p>
695      * System decors include status bar, navigation bar, launcher.
696      * </p>
697      *
698      * @param displayId The id of the display.
699      * @param shouldShow Indicates that the display should show system decors.
700      */
setShouldShowSystemDecors(int displayId, boolean shouldShow)701     void setShouldShowSystemDecors(int displayId, boolean shouldShow);
702 
703     /**
704      * Indicates the policy for how the display should show IME.
705      *
706      * @param displayId The id of the display.
707      * @return The policy for how the display should show IME.
708      * @see KeyguardManager#isDeviceSecure()
709      * @see KeyguardManager#isDeviceLocked()
710      */
getDisplayImePolicy(int displayId)711     int getDisplayImePolicy(int displayId);
712 
713     /**
714      * Sets the policy for how the display should show IME.
715      *
716      * @param displayId The id of the display.
717      * @param imePolicy Indicates the policy for how the display should show IME.
718      * @see KeyguardManager#isDeviceSecure()
719      * @see KeyguardManager#isDeviceLocked()
720      */
setDisplayImePolicy(int displayId, int imePolicy)721     void setDisplayImePolicy(int displayId, int imePolicy);
722 
723     /**
724      * Waits until input information has been sent from WindowManager to native InputManager,
725      * optionally waiting for animations to complete.
726      *
727      * This is needed for testing since we need to ensure input information has been propagated to
728      * native InputManager before proceeding with tests.
729      */
syncInputTransactions(boolean waitForAnimations)730     void syncInputTransactions(boolean waitForAnimations);
731 
732     /**
733      * Returns whether SurfaceFlinger layer tracing is enabled.
734      */
isLayerTracing()735     boolean isLayerTracing();
736 
737     /**
738      * Enables/disables SurfaceFlinger layer tracing.
739      */
setLayerTracing(boolean enabled)740     void setLayerTracing(boolean enabled);
741 
742     /**
743      * Mirrors a specified display. The root of the mirrored hierarchy will be stored in
744      * outSurfaceControl.
745      * Requires the ACCESS_SURFACE_FLINGER permission.
746      *
747      * @param displayId The id of the display to mirror
748      * @param outSurfaceControl The SurfaceControl for the root of the mirrored hierarchy.
749      *
750      * @return true if the display was successfully mirrored.
751      */
mirrorDisplay(int displayId, out SurfaceControl outSurfaceControl)752     boolean mirrorDisplay(int displayId, out SurfaceControl outSurfaceControl);
753 
754     /**
755      * When in multi-window mode, the provided displayWindowInsetsController will control insets
756      * animations.
757      */
758     @EnforcePermission("MANAGE_APP_TOKENS")
setDisplayWindowInsetsController( int displayId, in IDisplayWindowInsetsController displayWindowInsetsController)759     void setDisplayWindowInsetsController(
760             int displayId, in IDisplayWindowInsetsController displayWindowInsetsController);
761 
762     /**
763      * Called when a remote process updates the requested visibilities of insets on a display window
764      * container.
765      */
766     @EnforcePermission("MANAGE_APP_TOKENS")
updateDisplayWindowRequestedVisibleTypes(int displayId, int requestedVisibleTypes)767     void updateDisplayWindowRequestedVisibleTypes(int displayId, int requestedVisibleTypes);
768 
769     /**
770      * Called to get the expected window insets.
771      *
772      * @return {@code true} if system bars are always consumed.
773      */
getWindowInsets(int displayId, in IBinder token, out InsetsState outInsetsState)774     boolean getWindowInsets(int displayId, in IBinder token, out InsetsState outInsetsState);
775 
776     /**
777      * Returns a list of {@link android.view.DisplayInfo} for the logical display. This is not
778      * guaranteed to include all possible device states. The list items are unique.
779      *
780      * If invoked through a package other than a launcher app, returns an empty list.
781      *
782      * @param displayId the id of the logical display
783      */
getPossibleDisplayInfo(int displayId)784     List<DisplayInfo> getPossibleDisplayInfo(int displayId);
785 
786     /**
787      * Called to show global actions.
788      */
showGlobalActions()789     void showGlobalActions();
790 
791     /**
792      * Sets layer tracing flags for SurfaceFlingerTrace.
793      *
794      * @param flags see definition in SurfaceTracing.cpp
795      */
setLayerTracingFlags(int flags)796     void setLayerTracingFlags(int flags);
797 
798     /**
799      * Toggle active SurfaceFlinger transaction tracing.
800      */
setActiveTransactionTracing(boolean active)801     void setActiveTransactionTracing(boolean active);
802 
803     /**
804      * Forwards a scroll capture request to the appropriate window, if available.
805      *
806      * @param displayId the id of the display to target
807      * @param behindClient token for a window, used to filter the search to windows behind it, or
808      *                     {@code null} to accept a window at any zOrder
809      * @param taskId specifies the id of a task the result must belong to, or -1 to ignore task ids
810      * @param listener the object to receive the response
811      */
requestScrollCapture(int displayId, IBinder behindClient, int taskId, IScrollCaptureResponseListener listener)812     void requestScrollCapture(int displayId, IBinder behindClient, int taskId,
813             IScrollCaptureResponseListener listener);
814 
815     /**
816      * Holds the WM lock for the specified amount of milliseconds.
817      * Intended for use by the tests that need to imitate lock contention.
818      * The token should be obtained by
819      * {@link android.content.pm.PackageManager#getHoldLockToken()}.
820      */
holdLock(in IBinder token, in int durationMs)821     void holdLock(in IBinder token, in int durationMs);
822 
823     /**
824      * Gets an array of support hash algorithms that can be used to generate a DisplayHash. The
825      * String value of one algorithm should be used when requesting to generate
826      * the DisplayHash.
827      *
828      * @return a String array of supported hash algorithms.
829      */
getSupportedDisplayHashAlgorithms()830     String[] getSupportedDisplayHashAlgorithms();
831 
832     /**
833      * Validate the DisplayHash was generated by the system. The DisplayHash passed in should be
834      * the object generated when calling {@link IWindowSession#generateDisplayHash}
835      *
836      * @param DisplayHash The hash to verify that it was generated by the system.
837      * @return a {@link VerifiedDisplayHash} if the hash was generated by the system or null
838      * if the token cannot be verified.
839      */
verifyDisplayHash(in DisplayHash displayHash)840     VerifiedDisplayHash verifyDisplayHash(in DisplayHash displayHash);
841 
842     /**
843      * Call to enable or disable the throttling when generating a display hash. This should only be
844      * used for testing. Throttling is enabled by default.
845      *
846      * Must be called from a process that has {@link android.Manifest.permission#READ_FRAME_BUFFER}
847      * permission.
848      */
setDisplayHashThrottlingEnabled(boolean enable)849      void setDisplayHashThrottlingEnabled(boolean enable);
850 
851     /**
852      * Attaches a {@link android.window.WindowContext} to the DisplayArea specified by {@code type},
853      * {@code displayId} and {@code options}.
854      * <p>
855      * Note that this API should be invoked after calling
856      * {@link android.window.WindowTokenClient#attachContext(Context)}
857      * </p><p>
858      * Generally, this API is used for initializing a {@link android.window.WindowContext}
859      * before obtaining a valid {@link com.android.server.wm.WindowToken}. A WindowToken is usually
860      * generated when calling {@link android.view.WindowManager#addView(View, LayoutParams)}, or
861      * obtained from {@link android.view.WindowManager.LayoutParams#token}.
862      * </p><p>
863      * In some cases, the WindowToken is passed from the server side because it is managed by the
864      * system server. {@link #attachWindowContextToWindowToken(IBinder, IBinder)} could be used in
865      * this case to attach the WindowContext to the WindowToken.</p>
866      *
867      * @param appThread the process that the window context is on.
868      * @param clientToken {@link android.window.WindowContext#getWindowContextToken()
869      * the WindowContext's token}
870      * @param type Window type of the window context
871      * @param displayId The display associated with the window context
872      * @param options A bundle used to pass window-related options and choose the right DisplayArea
873      *
874      * @return the {@link WindowContextInfo} of the DisplayArea if the WindowContext is attached to
875      * the DisplayArea successfully. {@code null}, otherwise.
876      */
attachWindowContextToDisplayArea(in IApplicationThread appThread, IBinder clientToken, int type, int displayId, in @nullable Bundle options)877     @nullable WindowContextInfo attachWindowContextToDisplayArea(in IApplicationThread appThread,
878             IBinder clientToken, int type, int displayId, in @nullable Bundle options);
879 
880     /**
881      * Attaches a {@link android.window.WindowContext} to a {@code WindowToken}.
882      * <p>
883      * This API is used when we hold a valid WindowToken and want to associate with the token and
884      * receive its configuration updates.
885      * </p><p>
886      * Note that this API should be invoked after calling
887      * {@link android.window.WindowTokenClient#attachContext(Context)}
888      * </p>
889      *
890      * @param appThread the process that the window context is on.
891      * @param clientToken {@link android.window.WindowContext#getWindowContextToken()
892      * the WindowContext's token}
893      * @param token the WindowToken to attach
894      *
895      * @return the {@link WindowContextInfo} of the WindowToken if the WindowContext is attached to
896      * the WindowToken successfully. {@code null}, otherwise.
897      * @throws IllegalArgumentException if the {@code clientToken} have not been attached to
898      * the server or the WindowContext's type doesn't match WindowToken {@code token}'s type.
899      *
900      * @see #attachWindowContextToDisplayArea(IBinder, int, int, Bundle)
901      */
attachWindowContextToWindowToken(in IApplicationThread appThread, IBinder clientToken, IBinder token)902     @nullable WindowContextInfo  attachWindowContextToWindowToken(in IApplicationThread appThread,
903             IBinder clientToken, IBinder token);
904 
905     /**
906      * Attaches a {@code clientToken} to associate with DisplayContent.
907      * <p>
908      * Note that this API should be invoked after calling
909      * {@link android.window.WindowTokenClient#attachContext(Context)}
910      * </p>
911      *
912      * @param appThread the process that the window context is on.
913      * @param clientToken {@link android.window.WindowContext#getWindowContextToken()
914      * the WindowContext's token}
915      * @param displayId The display associated with the window context
916      *
917      * @return the {@link WindowContextInfo} of the DisplayContent if the WindowContext is attached
918      * to the DisplayContent successfully. {@code null}, otherwise.
919      * @throws android.view.WindowManager.InvalidDisplayException if the display ID is invalid
920      */
attachWindowContextToDisplayContent(in IApplicationThread appThread, IBinder clientToken, int displayId)921     @nullable WindowContextInfo attachWindowContextToDisplayContent(in IApplicationThread appThread,
922             IBinder clientToken, int displayId);
923 
924     /**
925      * Detaches {@link android.window.WindowContext} from the window manager node it's currently
926      * attached to. It is no-op if the WindowContext is not attached to a window manager node.
927      *
928      * @param clientToken the window context's token
929      */
detachWindowContext(IBinder clientToken)930     void detachWindowContext(IBinder clientToken);
931 
932     /**
933      * Registers a listener, which is to be called whenever cross-window blur is enabled/disabled.
934      *
935      * @param listener the listener to be registered
936      * @return true if cross-window blur is currently enabled; false otherwise
937      */
registerCrossWindowBlurEnabledListener(ICrossWindowBlurEnabledListener listener)938     boolean registerCrossWindowBlurEnabledListener(ICrossWindowBlurEnabledListener listener);
939 
940     /**
941      * Unregisters a listener which was registered with
942      * {@link #registerCrossWindowBlurEnabledListener()}.
943      *
944      * @param listener the listener to be unregistered
945      */
unregisterCrossWindowBlurEnabledListener(ICrossWindowBlurEnabledListener listener)946     void unregisterCrossWindowBlurEnabledListener(ICrossWindowBlurEnabledListener listener);
947 
isTaskSnapshotSupported()948     boolean isTaskSnapshotSupported();
949 
950     /**
951      * Returns the preferred display ID to show software keyboard.
952      *
953      * @see android.window.WindowProviderService#getLaunchedDisplayId
954      */
getImeDisplayId()955     int getImeDisplayId();
956 
957     /**
958      * Control if we should enable task snapshot features on this device.
959      * @hide
960      */
setTaskSnapshotEnabled(boolean enabled)961     void setTaskSnapshotEnabled(boolean enabled);
962 
963     /**
964      * Registers the frame rate per second count callback for one given task ID.
965      * Each callback can only register for receiving FPS callback for one task id until unregister
966      * is called. If there's no task associated with the given task id,
967      * {@link IllegalArgumentException} will be thrown. If a task id destroyed after a callback is
968      * registered, the registered callback will not be unregistered until
969      * {@link unregisterTaskFpsCallback()} is called
970      * @param taskId task id of the task.
971      * @param callback callback to be registered.
972      *
973      * @hide
974      */
registerTaskFpsCallback(in int taskId, in ITaskFpsCallback callback)975     void registerTaskFpsCallback(in int taskId, in ITaskFpsCallback callback);
976 
977     /**
978      * Unregisters the frame rate per second count callback which was registered with
979      * {@link #registerTaskFpsCallback(int,TaskFpsCallback)}.
980      *
981      * @param callback callback to be unregistered.
982      *
983      * @hide
984      */
unregisterTaskFpsCallback(in ITaskFpsCallback listener)985     void unregisterTaskFpsCallback(in ITaskFpsCallback listener);
986 
987     /**
988      * Take a snapshot using the same path that's used for Recents. This is used for Testing only.
989      *
990      * @param taskId to take the snapshot of
991      *
992      * Returns a bitmap of the screenshot or {@code null} if it was unable to screenshot.
993      * @hide
994      */
snapshotTaskForRecents(int taskId)995     Bitmap snapshotTaskForRecents(int taskId);
996 
997     /**
998      * Informs the system whether the recents app is currently behind the system bars. If so,
999      * means the recents app can control the SystemUI flags, and vice-versa.
1000      */
setRecentsAppBehindSystemBars(boolean behindSystemBars)1001     void setRecentsAppBehindSystemBars(boolean behindSystemBars);
1002 
1003     /**
1004      * Gets the background color of the letterbox. Considered invalid if the background has
1005      * multiple colors {@link #isLetterboxBackgroundMultiColored}. Should be called by SystemUI when
1006      * computing the letterbox appearance for status bar treatment.
1007      */
getLetterboxBackgroundColorInArgb()1008     int getLetterboxBackgroundColorInArgb();
1009 
1010     /**
1011      * Whether the outer area of the letterbox has multiple colors (e.g. blurred background).
1012      * Should be called by SystemUI when computing the letterbox appearance for status bar
1013      * treatment.
1014      */
isLetterboxBackgroundMultiColored()1015     boolean isLetterboxBackgroundMultiColored();
1016 
1017     /**
1018      * Captures the entire display specified by the displayId using the args provided. If the args
1019      * are null or if the sourceCrop is invalid or null, the entire display bounds will be captured.
1020      */
captureDisplay(int displayId, in @nullable ScreenCapture.CaptureArgs captureArgs, in ScreenCapture.ScreenCaptureListener listener)1021     oneway void captureDisplay(int displayId, in @nullable ScreenCapture.CaptureArgs captureArgs,
1022             in ScreenCapture.ScreenCaptureListener listener);
1023 
1024     /**
1025      * Returns {@code true} if the key will be handled globally and not forwarded to all apps.
1026      *
1027      * @param keyCode the key code to check
1028      * @return {@code true} if the key will be handled globally.
1029      */
isGlobalKey(int keyCode)1030     boolean isGlobalKey(int keyCode);
1031 
1032     /**
1033      * Create or add to a SurfaceSyncGroup in WindowManager. WindowManager maintains some
1034      * SurfaceSyncGroups to ensure multiple processes can sync with each other without sharing
1035      * SurfaceControls
1036      */
addToSurfaceSyncGroup(in IBinder syncGroupToken, boolean parentSyncGroupMerge, in @nullable ISurfaceSyncGroupCompletedListener completedListener, out AddToSurfaceSyncGroupResult addToSurfaceSyncGroupResult)1037     boolean addToSurfaceSyncGroup(in IBinder syncGroupToken, boolean parentSyncGroupMerge,
1038                 in @nullable ISurfaceSyncGroupCompletedListener completedListener,
1039                 out AddToSurfaceSyncGroupResult addToSurfaceSyncGroupResult);
1040 
1041     /**
1042      * Mark a SurfaceSyncGroup stored in WindowManager as ready.
1043      */
markSurfaceSyncGroupReady(in IBinder syncGroupToken)1044     oneway void markSurfaceSyncGroupReady(in IBinder syncGroupToken);
1045 
1046     /**
1047      * Invoked when a screenshot is taken of the default display to notify registered listeners.
1048      *
1049      * Should be invoked only by SysUI.
1050      *
1051      * @param displayId id of the display screenshot.
1052      * @return List of ComponentNames corresponding to the activities that were notified.
1053     */
notifyScreenshotListeners(int displayId)1054     List<ComponentName> notifyScreenshotListeners(int displayId);
1055 
1056     /**
1057      * Replace the content of the displayId with the SurfaceControl passed in. This can be used for
1058      * tests when creating a VirtualDisplay, but only want to capture specific content and not
1059      * mirror the entire display.
1060      */
1061      @JavaPassthrough(annotation = "@android.annotation.RequiresPermission(android.Manifest"
1062              + ".permission.ACCESS_SURFACE_FLINGER)")
replaceContentOnDisplay(int displayId, in SurfaceControl sc)1063     boolean replaceContentOnDisplay(int displayId, in SurfaceControl sc);
1064 
1065     /**
1066      * Registers a DecorView gesture listener for a given display.
1067      */
1068     @JavaPassthrough(annotation = "@android.annotation.RequiresPermission(android.Manifest"
1069             + ".permission.MONITOR_INPUT)")
registerDecorViewGestureListener(IDecorViewGestureListener listener, int displayId)1070     void registerDecorViewGestureListener(IDecorViewGestureListener listener, int displayId);
1071 
1072     /**
1073      * Unregisters a DecorView gesture listener for a given display.
1074      */
1075     @JavaPassthrough(annotation = "@android.annotation.RequiresPermission(android.Manifest"
1076             + ".permission.MONITOR_INPUT)")
unregisterDecorViewGestureListener(IDecorViewGestureListener listener, int displayId)1077     void unregisterDecorViewGestureListener(IDecorViewGestureListener listener, int displayId);
1078 
registerTrustedPresentationListener(in IBinder window, in ITrustedPresentationListener listener, in TrustedPresentationThresholds thresholds, int id)1079     void registerTrustedPresentationListener(in IBinder window, in ITrustedPresentationListener listener,
1080             in TrustedPresentationThresholds thresholds, int id);
1081 
1082 
unregisterTrustedPresentationListener(in ITrustedPresentationListener listener, int id)1083     void unregisterTrustedPresentationListener(in ITrustedPresentationListener listener, int id);
1084 
1085     @EnforcePermission("DETECT_SCREEN_RECORDING")
registerScreenRecordingCallback(IScreenRecordingCallback callback)1086     boolean registerScreenRecordingCallback(IScreenRecordingCallback callback);
1087 
1088     @EnforcePermission("DETECT_SCREEN_RECORDING")
unregisterScreenRecordingCallback(IScreenRecordingCallback callback)1089     void unregisterScreenRecordingCallback(IScreenRecordingCallback callback);
1090 
1091     /**
1092      * Sets the listener to be called back when a cross-window drag and drop operation happens.
1093      */
setGlobalDragListener(IGlobalDragListener listener)1094     void setGlobalDragListener(IGlobalDragListener listener);
1095 
transferTouchGesture(in InputTransferToken transferFromToken, in InputTransferToken transferToToken)1096     boolean transferTouchGesture(in InputTransferToken transferFromToken,
1097             in InputTransferToken transferToToken);
1098 }
1099