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.IShortcutService;
22 
23 import android.app.IAssistDataReceiver;
24 import android.content.res.CompatibilityInfo;
25 import android.content.res.Configuration;
26 import android.graphics.Bitmap;
27 import android.graphics.GraphicBuffer;
28 import android.graphics.Insets;
29 import android.graphics.Point;
30 import android.graphics.Rect;
31 import android.graphics.Region;
32 import android.os.Bundle;
33 import android.os.IRemoteCallback;
34 import android.os.ParcelFileDescriptor;
35 import android.view.IApplicationToken;
36 import android.view.IAppTransitionAnimationSpecsFuture;
37 import android.view.IDockedStackListener;
38 import android.view.IDisplayFoldListener;
39 import android.view.IOnKeyguardExitResult;
40 import android.view.IPinnedStackListener;
41 import android.view.RemoteAnimationAdapter;
42 import android.view.IRotationWatcher;
43 import android.view.ISystemGestureExclusionListener;
44 import android.view.IWallpaperVisibilityListener;
45 import android.view.IWindowSession;
46 import android.view.IWindowSessionCallback;
47 import android.view.KeyEvent;
48 import android.view.InputEvent;
49 import android.view.MagnificationSpec;
50 import android.view.MotionEvent;
51 import android.view.InputChannel;
52 import android.view.InputDevice;
53 import android.view.IInputFilter;
54 import android.view.AppTransitionAnimationSpec;
55 import android.view.WindowContentFrameStats;
56 import android.view.WindowManager;
57 import android.view.SurfaceControl;
58 
59 /**
60  * System private interface to the window manager.
61  *
62  * {@hide}
63  */
64 interface IWindowManager
65 {
66     /**
67      * ===== NOTICE =====
68      * The first three methods must remain the first three methods. Scripts
69      * and tools rely on their transaction number to work properly.
70      */
71     // This is used for debugging
startViewServer(int port)72     boolean startViewServer(int port);   // Transaction #1
stopViewServer()73     boolean stopViewServer();            // Transaction #2
isViewServerRunning()74     boolean isViewServerRunning();       // Transaction #3
75 
openSession(in IWindowSessionCallback callback)76     IWindowSession openSession(in IWindowSessionCallback callback);
77 
78     @UnsupportedAppUsage
getInitialDisplaySize(int displayId, out Point size)79     void getInitialDisplaySize(int displayId, out Point size);
80     @UnsupportedAppUsage
getBaseDisplaySize(int displayId, out Point size)81     void getBaseDisplaySize(int displayId, out Point size);
setForcedDisplaySize(int displayId, int width, int height)82     void setForcedDisplaySize(int displayId, int width, int height);
clearForcedDisplaySize(int displayId)83     void clearForcedDisplaySize(int displayId);
84     @UnsupportedAppUsage
getInitialDisplayDensity(int displayId)85     int getInitialDisplayDensity(int displayId);
getBaseDisplayDensity(int displayId)86     int getBaseDisplayDensity(int displayId);
setForcedDisplayDensityForUser(int displayId, int density, int userId)87     void setForcedDisplayDensityForUser(int displayId, int density, int userId);
clearForcedDisplayDensityForUser(int displayId, int userId)88     void clearForcedDisplayDensityForUser(int displayId, int userId);
setForcedDisplayScalingMode(int displayId, int mode)89     void setForcedDisplayScalingMode(int displayId, int mode); // 0 = auto, 1 = disable
90 
setOverscan(int displayId, int left, int top, int right, int bottom)91     void setOverscan(int displayId, int left, int top, int right, int bottom);
92 
93     // These can only be called when holding the MANAGE_APP_TOKENS permission.
setEventDispatching(boolean enabled)94     void setEventDispatching(boolean enabled);
addWindowToken(IBinder token, int type, int displayId)95     void addWindowToken(IBinder token, int type, int displayId);
removeWindowToken(IBinder token, int displayId)96     void removeWindowToken(IBinder token, int displayId);
prepareAppTransition(int transit, boolean alwaysKeepCurrent)97     void prepareAppTransition(int transit, boolean alwaysKeepCurrent);
98 
99     /**
100      * Like overridePendingAppTransitionMultiThumb, but uses a future to supply the specs. This is
101      * used for recents, where generating the thumbnails of the specs takes a non-trivial amount of
102      * time, so we want to move that off the critical path for starting the new activity.
103      */
104     @UnsupportedAppUsage
overridePendingAppTransitionMultiThumbFuture( IAppTransitionAnimationSpecsFuture specsFuture, IRemoteCallback startedCallback, boolean scaleUp, int displayId)105     void overridePendingAppTransitionMultiThumbFuture(
106             IAppTransitionAnimationSpecsFuture specsFuture, IRemoteCallback startedCallback,
107             boolean scaleUp, int displayId);
108     @UnsupportedAppUsage
overridePendingAppTransitionRemote(in RemoteAnimationAdapter remoteAnimationAdapter, int displayId)109     void overridePendingAppTransitionRemote(in RemoteAnimationAdapter remoteAnimationAdapter,
110             int displayId);
111     @UnsupportedAppUsage
executeAppTransition()112     void executeAppTransition();
113 
114     /**
115       * Used by system ui to report that recents has shown itself.
116       * @deprecated to be removed once prebuilts are updated
117       */
118     @UnsupportedAppUsage
endProlongedAnimations()119     void endProlongedAnimations();
120 
startFreezingScreen(int exitAnim, int enterAnim)121     void startFreezingScreen(int exitAnim, int enterAnim);
stopFreezingScreen()122     void stopFreezingScreen();
123 
124     // these require DISABLE_KEYGUARD permission
125     /** @deprecated use Activity.setShowWhenLocked instead. */
disableKeyguard(IBinder token, String tag, int userId)126     void disableKeyguard(IBinder token, String tag, int userId);
127     /** @deprecated use Activity.setShowWhenLocked instead. */
reenableKeyguard(IBinder token, int userId)128     void reenableKeyguard(IBinder token, int userId);
exitKeyguardSecurely(IOnKeyguardExitResult callback)129     void exitKeyguardSecurely(IOnKeyguardExitResult callback);
130     @UnsupportedAppUsage
isKeyguardLocked()131     boolean isKeyguardLocked();
132     @UnsupportedAppUsage
isKeyguardSecure(int userId)133     boolean isKeyguardSecure(int userId);
dismissKeyguard(IKeyguardDismissCallback callback, CharSequence message)134     void dismissKeyguard(IKeyguardDismissCallback callback, CharSequence message);
135 
136     // Requires INTERACT_ACROSS_USERS_FULL permission
setSwitchingUser(boolean switching)137     void setSwitchingUser(boolean switching);
138 
closeSystemDialogs(String reason)139     void closeSystemDialogs(String reason);
140 
141     // These can only be called with the SET_ANIMATON_SCALE permission.
142     @UnsupportedAppUsage
getAnimationScale(int which)143     float getAnimationScale(int which);
144     @UnsupportedAppUsage
getAnimationScales()145     float[] getAnimationScales();
146     @UnsupportedAppUsage
setAnimationScale(int which, float scale)147     void setAnimationScale(int which, float scale);
148     @UnsupportedAppUsage
setAnimationScales(in float[] scales)149     void setAnimationScales(in float[] scales);
150 
getCurrentAnimatorScale()151     float getCurrentAnimatorScale();
152 
153     // For testing
154     @UnsupportedAppUsage(maxTargetSdk = 28)
setInTouchMode(boolean showFocus)155     void setInTouchMode(boolean showFocus);
156 
157     // For StrictMode flashing a red border on violations from the UI
158     // thread.  The uid/pid is implicit from the Binder call, and the Window
159     // Manager uses that to determine whether or not the red border should
160     // actually be shown.  (it will be ignored that pid doesn't have windows
161     // on screen)
162     @UnsupportedAppUsage(maxTargetSdk = 28)
showStrictModeViolation(boolean on)163     void showStrictModeViolation(boolean on);
164 
165     // Proxy to set the system property for whether the flashing
166     // should be enabled.  The 'enabled' value is null or blank for
167     // the system default (differs per build variant) or any valid
168     // boolean string as parsed by SystemProperties.getBoolean().
169     @UnsupportedAppUsage
setStrictModeVisualIndicatorPreference(String enabled)170     void setStrictModeVisualIndicatorPreference(String enabled);
171 
172     /**
173      * Set whether screen capture is disabled for all windows of a specific user from
174      * the device policy cache.
175      */
refreshScreenCaptureDisabled(int userId)176     void refreshScreenCaptureDisabled(int userId);
177 
178     // These can only be called with the SET_ORIENTATION permission.
179     /**
180      * Update the current screen rotation based on the current state of
181      * the world.
182      * @param alwaysSendConfiguration Flag to force a new configuration to
183      * be evaluated.  This can be used when there are other parameters in
184      * configuration that are changing.
185      * @param forceRelayout If true, the window manager will always do a relayout
186      * of its windows even if the rotation hasn't changed.
187      */
updateRotation(boolean alwaysSendConfiguration, boolean forceRelayout)188     void updateRotation(boolean alwaysSendConfiguration, boolean forceRelayout);
189 
190     /**
191      * Retrieve the current orientation of the primary screen.
192      * @return Constant as per {@link android.view.Surface.Rotation}.
193      *
194      * @see android.view.Display#DEFAULT_DISPLAY
195      */
getDefaultDisplayRotation()196     int getDefaultDisplayRotation();
197 
198     /**
199      * Watch the rotation of the specified screen.  Returns the current rotation,
200      * calls back when it changes.
201      */
watchRotation(IRotationWatcher watcher, int displayId)202     int watchRotation(IRotationWatcher watcher, int displayId);
203 
204     /**
205      * Remove a rotation watcher set using watchRotation.
206      * @hide
207      */
208     @UnsupportedAppUsage
removeRotationWatcher(IRotationWatcher watcher)209     void removeRotationWatcher(IRotationWatcher watcher);
210 
211     /**
212      * Determine the preferred edge of the screen to pin the compact options menu against.
213      *
214      * @param displayId Id of the display where the menu window currently resides.
215      * @return a Gravity value for the options menu panel.
216      * @hide
217      */
getPreferredOptionsPanelGravity(int displayId)218     int getPreferredOptionsPanelGravity(int displayId);
219 
220     /**
221      * Equivalent to calling {@link #freezeDisplayRotation(int, int)} with {@link
222      * android.view.Display#DEFAULT_DISPLAY} and given rotation.
223      */
224     @UnsupportedAppUsage
freezeRotation(int rotation)225     void freezeRotation(int rotation);
226 
227     /**
228      * Equivalent to calling {@link #thawDisplayRotation(int)} with {@link
229      * android.view.Display#DEFAULT_DISPLAY}.
230      */
231     @UnsupportedAppUsage
thawRotation()232     void thawRotation();
233 
234     /**
235      * Equivelant to call {@link #isDisplayRotationFrozen(int)} with {@link
236      * android.view.Display#DEFAULT_DISPLAY}.
237      */
isRotationFrozen()238     boolean isRotationFrozen();
239 
240     /**
241      * Lock the display orientation to the specified rotation, or to the current
242      * rotation if -1. Sensor input will be ignored until thawRotation() is called.
243      *
244      * @param displayId the ID of display which rotation should be frozen.
245      * @param rotation one of {@link android.view.Surface#ROTATION_0},
246      *        {@link android.view.Surface#ROTATION_90}, {@link android.view.Surface#ROTATION_180},
247      *        {@link android.view.Surface#ROTATION_270} or -1 to freeze it to current rotation.
248      * @hide
249      */
freezeDisplayRotation(int displayId, int rotation)250     void freezeDisplayRotation(int displayId, int rotation);
251 
252     /**
253      * Release the orientation lock imposed by freezeRotation() on the display.
254      *
255      * @param displayId the ID of display which rotation should be thawed.
256      * @hide
257      */
thawDisplayRotation(int displayId)258     void thawDisplayRotation(int displayId);
259 
260     /**
261      * Gets whether the rotation is frozen on the display.
262      *
263      * @param displayId the ID of display which frozen is needed.
264      * @return Whether the rotation is frozen.
265      */
isDisplayRotationFrozen(int displayId)266     boolean isDisplayRotationFrozen(int displayId);
267 
268     /**
269      * Screenshot the current wallpaper layer, including the whole screen.
270      */
screenshotWallpaper()271     Bitmap screenshotWallpaper();
272 
273     /**
274      * Registers a wallpaper visibility listener.
275      * @return Current visibility.
276      */
registerWallpaperVisibilityListener(IWallpaperVisibilityListener listener, int displayId)277     boolean registerWallpaperVisibilityListener(IWallpaperVisibilityListener listener,
278         int displayId);
279 
280     /**
281      * Remove a visibility watcher that was added using registerWallpaperVisibilityListener.
282      */
unregisterWallpaperVisibilityListener(IWallpaperVisibilityListener listener, int displayId)283     void unregisterWallpaperVisibilityListener(IWallpaperVisibilityListener listener,
284         int displayId);
285 
286     /**
287      * Registers a system gesture exclusion listener for a given display.
288      */
registerSystemGestureExclusionListener(ISystemGestureExclusionListener listener, int displayId)289     void registerSystemGestureExclusionListener(ISystemGestureExclusionListener listener,
290         int displayId);
291 
292     /**
293      * Unregisters a system gesture exclusion listener for a given display.
294      */
unregisterSystemGestureExclusionListener(ISystemGestureExclusionListener listener, int displayId)295     void unregisterSystemGestureExclusionListener(ISystemGestureExclusionListener listener,
296         int displayId);
297 
298     /**
299      * Used only for assist -- request a screenshot of the current application.
300      */
requestAssistScreenshot(IAssistDataReceiver receiver)301     boolean requestAssistScreenshot(IAssistDataReceiver receiver);
302 
303     /**
304      * Called by the status bar to notify Views of changes to System UI visiblity.
305      */
statusBarVisibilityChanged(int displayId, int visibility)306     oneway void statusBarVisibilityChanged(int displayId, int visibility);
307 
308     /**
309     * When set to {@code true} the system bars will always be shown. This is true even if an app
310     * requests to be fullscreen by setting the system ui visibility flags. The
311     * functionality was added for the automotive case as a way to guarantee required content stays
312     * on screen at all times.
313     *
314     * @hide
315     */
setForceShowSystemBars(boolean show)316     oneway void setForceShowSystemBars(boolean show);
317 
318     /**
319      * Called by System UI to notify of changes to the visibility of Recents.
320      */
setRecentsVisibility(boolean visible)321     oneway void setRecentsVisibility(boolean visible);
322 
323     /**
324      * Called by System UI to notify of changes to the visibility of PIP.
325      */
setPipVisibility(boolean visible)326     oneway void setPipVisibility(boolean visible);
327 
328     /**
329      * Called by System UI to notify of changes to the visibility and height of the shelf.
330      */
331     @UnsupportedAppUsage
setShelfHeight(boolean visible, int shelfHeight)332     void setShelfHeight(boolean visible, int shelfHeight);
333 
334     /**
335      * Called by System UI to enable or disable haptic feedback on the navigation bar buttons.
336      */
337     @UnsupportedAppUsage
setNavBarVirtualKeyHapticFeedbackEnabled(boolean enabled)338     void setNavBarVirtualKeyHapticFeedbackEnabled(boolean enabled);
339 
340     /**
341      * Device has a software navigation bar (separate from the status bar) on specific display.
342      *
343      * @param displayId the id of display to check if there is a software navigation bar.
344      */
345     @UnsupportedAppUsage
hasNavigationBar(int displayId)346     boolean hasNavigationBar(int displayId);
347 
348     /**
349      * Get the position of the nav bar
350      */
getNavBarPosition(int displayId)351     int getNavBarPosition(int displayId);
352 
353     /**
354      * Lock the device immediately with the specified options (can be null).
355      */
356     @UnsupportedAppUsage
lockNow(in Bundle options)357     void lockNow(in Bundle options);
358 
359     /**
360      * Device is in safe mode.
361      */
362     @UnsupportedAppUsage
isSafeModeEnabled()363     boolean isSafeModeEnabled();
364 
365     /**
366      * Enables the screen if all conditions are met.
367      */
enableScreenIfNeeded()368     void enableScreenIfNeeded();
369 
370     /**
371      * Clears the frame statistics for a given window.
372      *
373      * @param token The window token.
374      * @return Whether the frame statistics were cleared.
375      */
clearWindowContentFrameStats(IBinder token)376     boolean clearWindowContentFrameStats(IBinder token);
377 
378     /**
379      * Gets the content frame statistics for a given window.
380      *
381      * @param token The window token.
382      * @return The frame statistics or null if the window does not exist.
383      */
getWindowContentFrameStats(IBinder token)384     WindowContentFrameStats getWindowContentFrameStats(IBinder token);
385 
386     /**
387      * @return the dock side the current docked stack is at; must be one of the
388      *         WindowManagerGlobal.DOCKED_* values
389      */
390     @UnsupportedAppUsage
getDockedStackSide()391     int getDockedStackSide();
392 
393     /**
394      * Sets the region the user can touch the divider. This region will be excluded from the region
395      * which is used to cause a focus switch when dispatching touch.
396      */
setDockedStackDividerTouchRegion(in Rect touchableRegion)397     void setDockedStackDividerTouchRegion(in Rect touchableRegion);
398 
399     /**
400      * Registers a listener that will be called when the dock divider changes its visibility or when
401      * the docked stack gets added/removed.
402      */
403     @UnsupportedAppUsage
registerDockedStackListener(IDockedStackListener listener)404     void registerDockedStackListener(IDockedStackListener listener);
405 
406     /**
407      * Registers a listener that will be called when the pinned stack state changes.
408      */
registerPinnedStackListener(int displayId, IPinnedStackListener listener)409     void registerPinnedStackListener(int displayId, IPinnedStackListener listener);
410 
411     /**
412      * Updates the dim layer used while resizing.
413      *
414      * @param visible Whether the dim layer should be visible.
415      * @param targetWindowingMode The windowing mode of the stack the dim layer should be placed on.
416      * @param alpha The translucency of the dim layer, between 0 and 1.
417      */
setResizeDimLayer(boolean visible, int targetWindowingMode, float alpha)418     void setResizeDimLayer(boolean visible, int targetWindowingMode, float alpha);
419 
420     /**
421      * Requests Keyboard Shortcuts from the displayed window.
422      *
423      * @param receiver The receiver to deliver the results to.
424      */
requestAppKeyboardShortcuts(IResultReceiver receiver, int deviceId)425     void requestAppKeyboardShortcuts(IResultReceiver receiver, int deviceId);
426 
427     /**
428      * Retrieves the current stable insets from the primary display.
429      */
430     @UnsupportedAppUsage
getStableInsets(int displayId, out Rect outInsets)431     void getStableInsets(int displayId, out Rect outInsets);
432 
433     /**
434      * Set the forwarded insets on the display.
435      * <p>
436      * This is only used in case a virtual display is displayed on another display that has insets,
437      * and the bounds of the virtual display is overlapping with the insets from the host display.
438      * In that case, the contents on the virtual display won't be placed over the forwarded insets.
439      * Only the owner of the display is permitted to set the forwarded insets on it.
440      */
setForwardedInsets(int displayId, in Insets insets)441     void setForwardedInsets(int displayId, in Insets insets);
442 
443     /**
444      * Register shortcut key. Shortcut code is packed as:
445      * (MetaState << Integer.SIZE) | KeyCode
446      * @hide
447      */
registerShortcutKey(in long shortcutCode, IShortcutService keySubscriber)448     void registerShortcutKey(in long shortcutCode, IShortcutService keySubscriber);
449 
450     /**
451      * Create an input consumer by name and display id.
452      */
453     @UnsupportedAppUsage
createInputConsumer(IBinder token, String name, int displayId, out InputChannel inputChannel)454     void createInputConsumer(IBinder token, String name, int displayId,
455         out InputChannel inputChannel);
456 
457     /**
458      * Destroy an input consumer by name and display id.
459      * This method will also dispose the input channels associated with that InputConsumer.
460      */
461     @UnsupportedAppUsage
destroyInputConsumer(String name, int displayId)462     boolean destroyInputConsumer(String name, int displayId);
463 
464     /**
465      * Return the touch region for the current IME window, or an empty region if there is none.
466      */
getCurrentImeTouchRegion()467     Region getCurrentImeTouchRegion();
468 
469     /**
470      * Registers an IDisplayFoldListener.
471      */
registerDisplayFoldListener(IDisplayFoldListener listener)472     void registerDisplayFoldListener(IDisplayFoldListener listener);
473 
474     /**
475      * Unregisters an IDisplayFoldListener.
476      */
unregisterDisplayFoldListener(IDisplayFoldListener listener)477     void unregisterDisplayFoldListener(IDisplayFoldListener listener);
478 
479     /**
480      * Starts a window trace.
481      */
startWindowTrace()482     void startWindowTrace();
483 
484     /**
485      * Stops a window trace.
486      */
stopWindowTrace()487     void stopWindowTrace();
488 
489     /**
490      * Returns true if window trace is enabled.
491      */
isWindowTraceEnabled()492     boolean isWindowTraceEnabled();
493 
494     /**
495      * Requests that the WindowManager sends
496      * WindowManagerPolicyConstants#ACTION_USER_ACTIVITY_NOTIFICATION on the next user activity.
497      */
requestUserActivityNotification()498     void requestUserActivityNotification();
499 
500     /**
501      * Notify WindowManager that it should not override the info in DisplayManager for the specified
502      * display. This can disable letter- or pillar-boxing applied in DisplayManager when the metrics
503      * of the logical display reported from WindowManager do not correspond to the metrics of the
504      * physical display it is based on.
505      *
506      * @param displayId The id of the display.
507      */
dontOverrideDisplayInfo(int displayId)508     void dontOverrideDisplayInfo(int displayId);
509 
510     /**
511      * Gets the windowing mode of the display.
512      *
513      * @param displayId The id of the display.
514      * @return {@link WindowConfiguration.WindowingMode}
515      */
getWindowingMode(int displayId)516     int getWindowingMode(int displayId);
517 
518     /**
519      * Sets the windowing mode of the display.
520      *
521      * @param displayId The id of the display.
522      * @param mode {@link WindowConfiguration.WindowingMode}
523      */
setWindowingMode(int displayId, int mode)524     void setWindowingMode(int displayId, int mode);
525 
526     /**
527      * Gets current remove content mode of the display.
528      * <p>
529      * What actions should be performed with the display's content when it is removed. Default
530      * behavior for public displays in this case is to move all activities to the primary display
531      * and make it focused. For private display is to destroy all activities.
532      * </p>
533      *
534      * @param displayId The id of the display.
535      * @return The remove content mode of the display.
536      * @see WindowManager#REMOVE_CONTENT_MODE_MOVE_TO_PRIMARY
537      * @see WindowManager#REMOVE_CONTENT_MODE_DESTROY
538      */
getRemoveContentMode(int displayId)539     int getRemoveContentMode(int displayId);
540 
541     /**
542      * Sets the remove content mode of the display.
543      * <p>
544      * This mode indicates what actions should be performed with the display's content when it is
545      * removed.
546      * </p>
547      *
548      * @param displayId The id of the display.
549      * @param mode Remove content mode.
550      * @see WindowManager#REMOVE_CONTENT_MODE_MOVE_TO_PRIMARY
551      * @see WindowManager#REMOVE_CONTENT_MODE_DESTROY
552      */
setRemoveContentMode(int displayId, int mode)553     void setRemoveContentMode(int displayId, int mode);
554 
555     /**
556      * Indicates that the display should show its content when non-secure keyguard is shown.
557      * <p>
558      * This flag identifies secondary displays that will continue showing content if keyguard can be
559      * dismissed without entering credentials.
560      * </p><p>
561      * An example of usage is a virtual display which content is displayed on external hardware
562      * display that is not visible to the system directly.
563      * </p>
564      *
565      * @param displayId The id of the display.
566      * @return {@code true} if the display should show its content when non-secure keyguard is
567      *         shown.
568      * @see KeyguardManager#isDeviceSecure()
569      * @see KeyguardManager#isDeviceLocked()
570      */
shouldShowWithInsecureKeyguard(int displayId)571     boolean shouldShowWithInsecureKeyguard(int displayId);
572 
573     /**
574      * Sets that the display should show its content when non-secure keyguard is shown.
575      *
576      * @param displayId The id of the display.
577      * @param shouldShow Indicates that the display should show its content when non-secure keyguard
578      *                  is shown.
579      * @see KeyguardManager#isDeviceSecure()
580      * @see KeyguardManager#isDeviceLocked()
581      */
setShouldShowWithInsecureKeyguard(int displayId, boolean shouldShow)582     void setShouldShowWithInsecureKeyguard(int displayId, boolean shouldShow);
583 
584     /**
585      * Indicates the display should show system decors.
586      * <p>
587      * System decors include status bar, navigation bar, launcher.
588      * </p>
589      *
590      * @param displayId The id of the display.
591      * @return {@code true} if the display should show system decors.
592      */
shouldShowSystemDecors(int displayId)593     boolean shouldShowSystemDecors(int displayId);
594 
595     /**
596      * Sets that the display should show system decors.
597      * <p>
598      * System decors include status bar, navigation bar, launcher.
599      * </p>
600      *
601      * @param displayId The id of the display.
602      * @param shouldShow Indicates that the display should show system decors.
603      */
setShouldShowSystemDecors(int displayId, boolean shouldShow)604     void setShouldShowSystemDecors(int displayId, boolean shouldShow);
605 
606     /**
607      * Indicates that the display should show IME.
608      *
609      * @param displayId The id of the display.
610      * @return {@code true} if the display should show IME.
611      * @see KeyguardManager#isDeviceSecure()
612      * @see KeyguardManager#isDeviceLocked()
613      */
shouldShowIme(int displayId)614     boolean shouldShowIme(int displayId);
615 
616     /**
617      * Sets that the display should show IME.
618      *
619      * @param displayId The id of the display.
620      * @param shouldShow Indicates that the display should show IME.
621      * @see KeyguardManager#isDeviceSecure()
622      * @see KeyguardManager#isDeviceLocked()
623      */
setShouldShowIme(int displayId, boolean shouldShow)624     void setShouldShowIme(int displayId, boolean shouldShow);
625 
626     /**
627      * Waits for transactions to get applied before injecting input.
628      * This includes waiting for the input windows to get sent to InputManager.
629      *
630      * This is needed for testing since the system add windows and injects input
631      * quick enough that the windows don't have time to get sent to InputManager.
632      */
injectInputAfterTransactionsApplied(in InputEvent ev, int mode)633     boolean injectInputAfterTransactionsApplied(in InputEvent ev, int mode);
634 
635     /**
636      * Waits until all animations have completed and input information has been sent from
637      * WindowManager to native InputManager.
638      *
639      * This is needed for testing since we need to ensure input information has been propagated to
640      * native InputManager before proceeding with tests.
641      */
syncInputTransactions()642     void syncInputTransactions();
643 
644     /**
645      * Returns whether SurfaceFlinger layer tracing is enabled.
646      */
isLayerTracing()647     boolean isLayerTracing();
648 
649     /**
650      * Enables/disables SurfaceFlinger layer tracing.
651      */
setLayerTracing(boolean enabled)652     void setLayerTracing(boolean enabled);
653 }
654