blob: bd1ad8e01b3c08d67edf19d29ee12e03f783872a [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
Dianne Hackborn27eac1d2015-03-16 17:15:53 -070019import com.android.internal.app.IAssistScreenshotReceiver;
Clara Bayarri75e09792015-07-29 16:20:40 +010020import com.android.internal.os.IResultReceiver;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080021import com.android.internal.view.IInputContext;
22import com.android.internal.view.IInputMethodClient;
Jorim Jaggi241ae102016-11-02 21:57:33 -070023import com.android.internal.policy.IKeyguardDismissCallback;
Muyuan Li94ce94e2016-02-24 16:20:54 -080024import com.android.internal.policy.IShortcutService;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080025
Dianne Hackborn2f0b1752011-05-31 17:59:49 -070026import android.content.res.CompatibilityInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080027import android.content.res.Configuration;
Dianne Hackborn0aae2d42010-12-07 23:51:29 -080028import android.graphics.Bitmap;
Dianne Hackbornac8dea12011-04-20 18:18:51 -070029import android.graphics.Point;
Svetoslav Ganovc9c9a482012-07-16 08:46:07 -070030import android.graphics.Rect;
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;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080037import android.view.IOnKeyguardExitResult;
Winson Chung655332c2016-10-31 13:14:28 -070038import android.view.IPinnedStackListener;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080039import android.view.IRotationWatcher;
40import android.view.IWindowSession;
Dianne Hackborneb94fa72014-06-03 17:48:12 -070041import android.view.IWindowSessionCallback;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080042import android.view.KeyEvent;
Jeff Brown6ec402b2010-07-28 15:48:59 -070043import android.view.InputEvent;
Svetoslav Ganov152e9bb2012-10-12 20:15:29 -070044import android.view.MagnificationSpec;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080045import android.view.MotionEvent;
Jeff Browna41ca772010-08-11 14:46:32 -070046import android.view.InputChannel;
Jeff Brown8d608662010-08-30 03:02:23 -070047import android.view.InputDevice;
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -070048import android.view.IInputFilter;
Filip Gruszczynski170192a2015-08-16 17:46:34 -070049import android.view.AppTransitionAnimationSpec;
Svetoslav1376d602014-03-13 11:17:26 -070050import android.view.WindowContentFrameStats;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080051
52/**
53 * System private interface to the window manager.
54 *
55 * {@hide}
56 */
57interface IWindowManager
58{
59 /**
60 * ===== NOTICE =====
61 * The first three methods must remain the first three methods. Scripts
62 * and tools rely on their transaction number to work properly.
63 */
64 // This is used for debugging
65 boolean startViewServer(int port); // Transaction #1
66 boolean stopViewServer(); // Transaction #2
67 boolean isViewServerRunning(); // Transaction #3
68
Dianne Hackborneb94fa72014-06-03 17:48:12 -070069 IWindowSession openSession(in IWindowSessionCallback callback, in IInputMethodClient client,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080070 in IInputContext inputContext);
71 boolean inputMethodClientHasFocus(IInputMethodClient client);
Dianne Hackbornac8dea12011-04-20 18:18:51 -070072
Dianne Hackborn672cf452013-03-26 15:24:24 -070073 void getInitialDisplaySize(int displayId, out Point size);
74 void getBaseDisplaySize(int displayId, out Point size);
Jeff Brown43aa1592012-09-10 17:36:31 -070075 void setForcedDisplaySize(int displayId, int width, int height);
Craig Mautner59c00972012-07-30 12:10:24 -070076 void clearForcedDisplaySize(int displayId);
Dianne Hackborn672cf452013-03-26 15:24:24 -070077 int getInitialDisplayDensity(int displayId);
78 int getBaseDisplayDensity(int displayId);
Alan Viverettedf3a7ca2016-09-06 17:13:41 -040079 void setForcedDisplayDensityForUser(int displayId, int density, int userId);
80 void clearForcedDisplayDensityForUser(int displayId, int userId);
Jeff Brownd46747a2015-04-15 19:02:36 -070081 void setForcedDisplayScalingMode(int displayId, int mode); // 0 = auto, 1 = disable
Dianne Hackborn7916ac62011-05-16 20:45:48 -070082
Dianne Hackbornc652de82013-02-15 16:32:56 -080083 void setOverscan(int displayId, int left, int top, int right, int bottom);
84
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080085 // These can only be called when holding the MANAGE_APP_TOKENS permission.
86 void pauseKeyDispatching(IBinder token);
87 void resumeKeyDispatching(IBinder token);
88 void setEventDispatching(boolean enabled);
Wale Ogunwaleac2561e2016-11-01 15:43:46 -070089 void addWindowToken(IBinder token, int type, int displayId);
90 void removeWindowToken(IBinder token, int displayId);
Wale Ogunwale706ed792015-08-02 10:29:44 -070091 /**
92 * Adds an application token to the specified task Id.
93 * @param addPos The position to add the token to in the task.
94 * @param token The token to add.
95 * @param taskId The Id of the task we are adding the token to.
96 * @param stackId Stack Id to create a new Task with the input task Id on
97 * if the task doesn't exist yet.
98 * @param requestedOrientation Orientation to use.
99 * @param fullscreen True if the application token is fullscreen.
100 * @param showWhenLocked True if the application token should be shown when locked.
101 * @param userId Id of user to associate the token with.
102 * @param configChanges Input configuration changes.
103 * @param voiceInteraction True if the token is in voice interaction mode.
104 * @param launchTaskBehind True if the token is been launched from behind.
105 * @param taskBounds Bounds to use when creating a new Task with the input task Id if
106 * the task doesn't exist yet.
Andrii Kulian8072d112016-09-16 11:11:01 -0700107 * @param overrideConfig Override configuration that is being used with this task.
Wale Ogunwaleb1faf602016-01-27 09:12:31 -0800108 * @param taskResizeMode The resize mode of the task.
Wale Ogunwale6cae7652015-12-26 07:36:26 -0800109 * @param alwaysFocusable True if the app windows are always focusable regardless of the stack
110 * they are in.
Wale Ogunwaleb1faf602016-01-27 09:12:31 -0800111 * @param homeTask True if this is the task.
Yorke Lee0e852472016-06-15 10:03:18 -0700112 * @param targetSdkVersion The application's target SDK version
Jiaquan Hedd1e66f2016-06-15 15:15:12 -0700113 * @param isOnTopLauncher True if this task is an on-top launcher.
Wale Ogunwale706ed792015-08-02 10:29:44 -0700114 */
Filip Gruszczynskiebcc8752015-08-25 16:51:05 -0700115 void addAppToken(int addPos, IApplicationToken token, int taskId, int stackId,
Craig Mautner5d9f5472013-11-12 14:02:52 -0800116 int requestedOrientation, boolean fullscreen, boolean showWhenLocked, int userId,
Wale Ogunwale706ed792015-08-02 10:29:44 -0700117 int configChanges, boolean voiceInteraction, boolean launchTaskBehind,
Andrii Kulian8072d112016-09-16 11:11:01 -0700118 in Rect taskBounds, in Configuration overrideConfig, int taskResizeMode,
Jiaquan Hedd1e66f2016-06-15 15:15:12 -0700119 boolean alwaysFocusable, boolean homeTask, int targetSdkVersion,
120 int rotationAnimationHint, boolean isOnTopLauncher);
Wale Ogunwale706ed792015-08-02 10:29:44 -0700121 /**
122 *
123 * @param token The token we are adding to the input task Id.
124 * @param taskId The Id of the task we are adding the token to.
Wale Ogunwale2998eef2015-12-02 19:46:29 -0800125 * @param stackId Stack Id to create a new Task with the input task Id on
126 * if the task doesn't exist yet.
Wale Ogunwale706ed792015-08-02 10:29:44 -0700127 * @param taskBounds Bounds to use when creating a new Task with the input task Id if
128 * the task doesn't exist yet.
Andrii Kulian8072d112016-09-16 11:11:01 -0700129 * @param overrideConfig Override configuration that is being used with this task.
Wale Ogunwaleb1faf602016-01-27 09:12:31 -0800130 * @param taskResizeMode The resize mode of the task.
131 * @param homeTask True if this is the task.
Jiaquan Hedd1e66f2016-06-15 15:15:12 -0700132 * @param isOnTopLauncher True if this task is an on-top launcher.
Wale Ogunwale706ed792015-08-02 10:29:44 -0700133 */
Wale Ogunwaleb1faf602016-01-27 09:12:31 -0800134 void setAppTask(IBinder token, int taskId, int stackId, in Rect taskBounds,
Andrii Kulian8072d112016-09-16 11:11:01 -0700135 in Configuration overrideConfig, int taskResizeMode, boolean homeTask,
136 boolean isOnTopLauncher);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800137 void setAppOrientation(IApplicationToken token, int requestedOrientation);
138 int getAppOrientation(IApplicationToken token);
139 void setFocusedApp(IBinder token, boolean moveFocusNow);
Dianne Hackborn7da6ac32010-12-09 19:22:04 -0800140 void prepareAppTransition(int transit, boolean alwaysKeepCurrent);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800141 int getPendingAppTransition();
Dianne Hackborn84375872012-06-01 19:03:50 -0700142 void overridePendingAppTransition(String packageName, int enterAnim, int exitAnim,
143 IRemoteCallback startedCallback);
Dianne Hackborneabfb3a2012-04-16 16:28:22 -0700144 void overridePendingAppTransitionScaleUp(int startX, int startY, int startWidth,
145 int startHeight);
Chet Haase10e23ab2015-02-11 15:08:38 -0800146 void overridePendingAppTransitionClipReveal(int startX, int startY,
147 int startWidth, int startHeight);
Dianne Hackborn8078d8c2012-03-20 11:11:26 -0700148 void overridePendingAppTransitionThumb(in Bitmap srcThumb, int startX, int startY,
Michael Jurka832cb222012-04-13 09:32:47 -0700149 IRemoteCallback startedCallback, boolean scaleUp);
Winson Chunga4ccb862014-08-22 15:26:27 -0700150 void overridePendingAppTransitionAspectScaledThumb(in Bitmap srcThumb, int startX,
Winson Chung2e7f3bd2014-09-05 13:17:22 +0200151 int startY, int targetWidth, int targetHeight, IRemoteCallback startedCallback,
152 boolean scaleUp);
Filip Gruszczynski170192a2015-08-16 17:46:34 -0700153 /**
154 * Overrides animation for app transition that exits from an application to a multi-window
155 * environment and allows specifying transition animation parameters for each window.
156 *
157 * @param specs Array of transition animation descriptions for entering windows.
158 *
159 * @hide
160 */
161 void overridePendingAppTransitionMultiThumb(in AppTransitionAnimationSpec[] specs,
Filip Gruszczynski1a5203d2015-10-29 17:43:49 -0700162 IRemoteCallback startedCallback, IRemoteCallback finishedCallback, boolean scaleUp);
Winson Chung044d5292014-11-06 11:05:19 -0800163 void overridePendingAppTransitionInPlace(String packageName, int anim);
Jorim Jaggi2f7d2922015-10-29 13:08:29 +0100164
165 /**
166 * Like overridePendingAppTransitionMultiThumb, but uses a future to supply the specs. This is
167 * used for recents, where generating the thumbnails of the specs takes a non-trivial amount of
168 * time, so we want to move that off the critical path for starting the new activity.
169 */
170 void overridePendingAppTransitionMultiThumbFuture(
171 IAppTransitionAnimationSpecsFuture specsFuture, IRemoteCallback startedCallback,
172 boolean scaleUp);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800173 void executeAppTransition();
Wale Ogunwale3b232392016-05-13 15:37:13 -0700174
175 /**
176 * Called to set the starting window for the input token and returns true if the starting
177 * window was set for the token.
178 */
179 boolean setAppStartingWindow(IBinder token, String pkg, int theme,
Dianne Hackborn2f0b1752011-05-31 17:59:49 -0700180 in CompatibilityInfo compatInfo, CharSequence nonLocalizedLabel, int labelRes,
Adam Powell04fe6eb2013-05-31 14:39:48 -0700181 int icon, int logo, int windowFlags, IBinder transferFrom, boolean createIfNeeded);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800182 void setAppVisibility(IBinder token, boolean visible);
Chong Zhangad24f962016-08-25 12:12:33 -0700183 void notifyAppResumed(IBinder token, boolean wasStopped, boolean allowSavedSurface);
Chong Zhang45e6d2d2016-07-20 18:33:56 -0700184 void notifyAppStopped(IBinder token);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800185 void startAppFreezingScreen(IBinder token, int configChanges);
186 void stopAppFreezingScreen(IBinder token, boolean force);
Wale Ogunwaleac2561e2016-11-01 15:43:46 -0700187 void removeAppToken(IBinder token, int displayId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800188
Filip Gruszczynski14b4e572015-11-03 15:53:55 -0800189 /** Used by system ui to report that recents has shown itself. */
190 void endProlongedAnimations();
191
Dianne Hackborne36d6e22010-02-17 19:46:25 -0800192 // Re-evaluate the current orientation from the caller's state.
193 // If there is a change, the new Configuration is returned and the
194 // caller must call setNewConfiguration() sometime later.
195 Configuration updateOrientationFromAppTokens(in Configuration currentConfig,
Andrii Kulian5406e7a2016-10-21 11:55:23 -0700196 IBinder freezeThisOneIfNeeded, int displayId);
197 // Notify window manager of the new display override configuration. Returns an array of stack
198 // ids that were affected by the update, ActivityManager should resize these stacks.
199 int[] setNewDisplayOverrideConfiguration(in Configuration overrideConfig, int displayId);
Chong Zhang167bbfac2016-03-31 09:44:34 -0700200
201 // Retrieves the new bounds after the configuration update evaluated by window manager.
202 Rect getBoundsForNewConfiguration(int stackId);
Jim Miller4eeb4f62012-11-08 00:04:29 -0800203
Dianne Hackborn9d9ece32012-09-10 15:33:52 -0700204 void startFreezingScreen(int exitAnim, int enterAnim);
205 void stopFreezingScreen();
206
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800207 // these require DISABLE_KEYGUARD permission
208 void disableKeyguard(IBinder token, String tag);
209 void reenableKeyguard(IBinder token);
210 void exitKeyguardSecurely(IOnKeyguardExitResult callback);
Mike Lockwood520d8bc2011-02-18 13:23:13 -0500211 boolean isKeyguardLocked();
212 boolean isKeyguardSecure();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800213 boolean inKeyguardRestrictedInputMode();
Jorim Jaggi241ae102016-11-02 21:57:33 -0700214 void dismissKeyguard(IKeyguardDismissCallback callback);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800215
Evan Rosky18396452016-07-27 15:19:37 -0700216 // Requires INTERACT_ACROSS_USERS_FULL permission
217 void setSwitchingUser(boolean switching);
218
Dianne Hackbornffa42482009-09-23 22:20:11 -0700219 void closeSystemDialogs(String reason);
Jim Miller4eeb4f62012-11-08 00:04:29 -0800220
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800221 // These can only be called with the SET_ANIMATON_SCALE permission.
222 float getAnimationScale(int which);
223 float[] getAnimationScales();
224 void setAnimationScale(int which, float scale);
225 void setAnimationScales(in float[] scales);
Jim Miller4eeb4f62012-11-08 00:04:29 -0800226
Dianne Hackborneb94fa72014-06-03 17:48:12 -0700227 float getCurrentAnimatorScale();
228
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800229 // For testing
230 void setInTouchMode(boolean showFocus);
Brad Fitzpatrick68044332010-11-22 18:19:48 -0800231
232 // For StrictMode flashing a red border on violations from the UI
233 // thread. The uid/pid is implicit from the Binder call, and the Window
234 // Manager uses that to determine whether or not the red border should
235 // actually be shown. (it will be ignored that pid doesn't have windows
236 // on screen)
237 void showStrictModeViolation(boolean on);
238
Brad Fitzpatrickc1a968a2010-11-24 08:56:40 -0800239 // Proxy to set the system property for whether the flashing
240 // should be enabled. The 'enabled' value is null or blank for
241 // the system default (differs per build variant) or any valid
242 // boolean string as parsed by SystemProperties.getBoolean().
243 void setStrictModeVisualIndicatorPreference(String enabled);
244
Sander Alewijnsed2a1eec2014-07-09 12:57:05 +0100245 /**
Sander Alewijnsea87863a2014-07-29 12:01:38 +0100246 * Set whether screen capture is disabled for all windows of a specific user
Sander Alewijnsed2a1eec2014-07-09 12:57:05 +0100247 */
Sander Alewijnsea87863a2014-07-29 12:01:38 +0100248 void setScreenCaptureDisabled(int userId, boolean disabled);
Sander Alewijnsed2a1eec2014-07-09 12:57:05 +0100249
Winsonc28098f2015-10-30 14:50:19 -0700250 /**
Robert Carr3b716242016-08-16 16:02:21 -0700251 * Testing and debugging infrastructure for writing surface events
252 * to given FD. See RemoteSurfaceTrace.java or Wm.java for format.
253 */
254 void enableSurfaceTrace(in ParcelFileDescriptor fd);
255 void disableSurfaceTrace();
256
257 /**
Winsonc28098f2015-10-30 14:50:19 -0700258 * Cancels the window transitions for the given task.
259 */
260 void cancelTaskWindowTransition(int taskId);
261
Winson13d30662015-11-06 15:30:29 -0800262 /**
263 * Cancels the thumbnail transitions for the given task.
264 */
265 void cancelTaskThumbnailTransition(int taskId);
266
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800267 // These can only be called with the SET_ORIENTATION permission.
268 /**
Jeff Brown01a98dd2011-09-20 15:08:29 -0700269 * Update the current screen rotation based on the current state of
270 * the world.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800271 * @param alwaysSendConfiguration Flag to force a new configuration to
272 * be evaluated. This can be used when there are other parameters in
273 * configuration that are changing.
Dianne Hackbornf87d1962012-04-04 12:48:24 -0700274 * @param forceRelayout If true, the window manager will always do a relayout
275 * of its windows even if the rotation hasn't changed.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800276 */
Dianne Hackbornf87d1962012-04-04 12:48:24 -0700277 void updateRotation(boolean alwaysSendConfiguration, boolean forceRelayout);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800278
279 /**
280 * Retrieve the current screen orientation, constants as per
281 * {@link android.view.Surface}.
282 */
283 int getRotation();
Jim Miller4eeb4f62012-11-08 00:04:29 -0800284
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800285 /**
286 * Watch the rotation of the screen. Returns the current rotation,
287 * calls back when it changes.
288 */
289 int watchRotation(IRotationWatcher watcher);
Daniel Sandlerb73617d2010-08-17 00:41:00 -0400290
Adam Powelldfee59a2011-08-05 20:48:30 -0700291 /**
Brian Colonnab1b9a8a2013-03-29 11:52:42 -0400292 * Remove a rotation watcher set using watchRotation.
293 * @hide
294 */
295 void removeRotationWatcher(IRotationWatcher watcher);
296
297 /**
Adam Powelldfee59a2011-08-05 20:48:30 -0700298 * Determine the preferred edge of the screen to pin the compact options menu against.
299 * @return a Gravity value for the options menu panel
300 * @hide
301 */
302 int getPreferredOptionsPanelGravity();
303
Jim Miller4eeb4f62012-11-08 00:04:29 -0800304 /**
305 * Lock the device orientation to the specified rotation, or to the
306 * current rotation if -1. Sensor input will be ignored until
307 * thawRotation() is called.
308 * @hide
309 */
310 void freezeRotation(int rotation);
Daniel Sandlerb73617d2010-08-17 00:41:00 -0400311
Jim Miller4eeb4f62012-11-08 00:04:29 -0800312 /**
313 * Release the orientation lock imposed by freezeRotation().
314 * @hide
315 */
316 void thawRotation();
Dianne Hackborn0aae2d42010-12-07 23:51:29 -0800317
Jim Miller4eeb4f62012-11-08 00:04:29 -0800318 /**
Svetoslav8e3feb12014-02-24 13:46:47 -0800319 * Gets whether the rotation is frozen.
Svetoslav Ganov80943d82013-01-02 10:25:37 -0800320 *
321 * @return Whether the rotation is frozen.
322 */
323 boolean isRotationFrozen();
324
325 /**
Zak Cohen3683fb12016-07-11 19:47:37 +0100326 * Screenshot the current wallpaper layer, including the whole screen.
327 */
328 Bitmap screenshotWallpaper();
329
330 /**
Dianne Hackborn27eac1d2015-03-16 17:15:53 -0700331 * Used only for assist -- request a screenshot of the current application.
332 */
333 boolean requestAssistScreenshot(IAssistScreenshotReceiver receiver);
334
335 /**
Jim Miller4eeb4f62012-11-08 00:04:29 -0800336 * Create a screenshot of the applications currently displayed.
Winson8b1871d2015-11-20 09:56:20 -0800337 *
Filip Gruszczynski64cdc142015-11-29 21:10:07 -0800338 * @param frameScale the scale to apply to the frame, only used when width = -1 and
Winson8b1871d2015-11-20 09:56:20 -0800339 * height = -1
Jim Miller4eeb4f62012-11-08 00:04:29 -0800340 */
Filip Gruszczynski64cdc142015-11-29 21:10:07 -0800341 Bitmap screenshotApplications(IBinder appToken, int displayId, int maxWidth, int maxHeight,
Winson8b1871d2015-11-20 09:56:20 -0800342 float frameScale);
Joe Onorato664644d2011-01-23 17:53:23 -0800343
344 /**
345 * Called by the status bar to notify Views of changes to System UI visiblity.
346 */
John Spurlocke7c28572013-10-29 14:23:51 -0400347 oneway void statusBarVisibilityChanged(int visibility);
Jeff Brown1a84fd12011-06-02 01:26:32 -0700348
349 /**
Winsonab216602016-08-09 14:05:20 -0700350 * Called by System UI to notify of changes to the visibility of Recents.
351 */
352 oneway void setRecentsVisibility(boolean visible);
353
354 /**
355 * Called by System UI to notify of changes to the visibility of PIP.
356 */
357 oneway void setTvPipVisibility(boolean visible);
358
359 /**
Daniel Sandler0c4ccff2011-10-19 16:39:14 -0400360 * Device has a software navigation bar (separate from the status bar).
361 */
362 boolean hasNavigationBar();
Jim Miller93c518e2012-01-17 15:55:31 -0800363
364 /**
Adam Cohenf7522022012-10-03 20:03:18 -0700365 * Lock the device immediately with the specified options (can be null).
Jim Miller93c518e2012-01-17 15:55:31 -0800366 */
Adam Cohenf7522022012-10-03 20:03:18 -0700367 void lockNow(in Bundle options);
Svetoslav Ganovc9c9a482012-07-16 08:46:07 -0700368
369 /**
Jim Millerbfec0a82012-11-05 20:05:22 -0800370 * Device is in safe mode.
371 */
372 boolean isSafeModeEnabled();
Jorim Jaggicff0acb2014-03-31 16:35:15 +0200373
374 /**
375 * Enables the screen if all conditions are met.
376 */
377 void enableScreenIfNeeded();
Svetoslavdd137a82014-04-10 12:48:07 -0700378
379 /**
Svetoslav1376d602014-03-13 11:17:26 -0700380 * Clears the frame statistics for a given window.
381 *
382 * @param token The window token.
383 * @return Whether the frame statistics were cleared.
384 */
385 boolean clearWindowContentFrameStats(IBinder token);
386
387 /**
388 * Gets the content frame statistics for a given window.
389 *
390 * @param token The window token.
391 * @return The frame statistics or null if the window does not exist.
392 */
393 WindowContentFrameStats getWindowContentFrameStats(IBinder token);
Jorim Jaggi61f39a72015-10-29 16:54:18 +0100394
395 /**
396 * @return the dock side the current docked stack is at; must be one of the
397 * WindowManagerGlobal.DOCKED_* values
398 */
399 int getDockedStackSide();
400
401 /**
402 * Sets whether we are currently in a drag resize operation where we are changing the docked
403 * stack size.
404 */
405 void setDockedStackResizing(boolean resizing);
Filip Gruszczynski64cdc142015-11-29 21:10:07 -0800406
407 /**
Jorim Jaggid47e7e12016-03-01 09:57:38 +0100408 * Sets the region the user can touch the divider. This region will be excluded from the region
409 * which is used to cause a focus switch when dispatching touch.
410 */
411 void setDockedStackDividerTouchRegion(in Rect touchableRegion);
412
413 /**
Jorim Jaggia6c934e2015-12-21 13:22:31 +0100414 * Registers a listener that will be called when the dock divider changes its visibility or when
415 * the docked stack gets added/removed.
Filip Gruszczynski64cdc142015-11-29 21:10:07 -0800416 */
Jorim Jaggia6c934e2015-12-21 13:22:31 +0100417 void registerDockedStackListener(IDockedStackListener listener);
Jorim Jaggi50981592015-12-29 17:54:12 +0100418
419 /**
Winson Chung655332c2016-10-31 13:14:28 -0700420 * Registers a listener that will be called when the pinned stack state changes.
421 */
422 void registerPinnedStackListener(int displayId, IPinnedStackListener listener);
423
424 /**
425 * Returns the initial bounds that PIP will be shown when it is first started.
426 */
427 Rect getPictureInPictureDefaultBounds(int displayId);
428
429 /**
430 * Returns the bounds that the PIP can move on the screen in the current PIP state.
431 */
432 Rect getPictureInPictureMovementBounds(int displayId);
433
434 /**
Jorim Jaggi50981592015-12-29 17:54:12 +0100435 * Updates the dim layer used while resizing.
436 *
437 * @param visible Whether the dim layer should be visible.
438 * @param targetStackId The id of the task stack the dim layer should be placed on.
439 * @param alpha The translucency of the dim layer, between 0 and 1.
440 */
441 void setResizeDimLayer(boolean visible, int targetStackId, float alpha);
Clara Bayarri75e09792015-07-29 16:20:40 +0100442
443 /**
444 * Requests Keyboard Shortcuts from the displayed window.
445 *
446 * @param receiver The receiver to deliver the results to.
447 */
Clara Bayarrifcd7e802016-03-10 12:58:18 +0000448 void requestAppKeyboardShortcuts(IResultReceiver receiver, int deviceId);
Jorim Jaggic6c89a82016-01-28 17:48:21 -0800449
450 /**
451 * Retrieves the current stable insets from the primary display.
452 */
Winson Chung303c6b72016-10-24 17:12:49 -0700453 void getStableInsets(int displayId, out Rect outInsets);
Muyuan Li94ce94e2016-02-24 16:20:54 -0800454
455 /**
456 * Register shortcut key. Shortcut code is packed as:
457 * (MetaState << Integer.SIZE) | KeyCode
458 * @hide
459 */
460 void registerShortcutKey(in long shortcutCode, IShortcutService keySubscriber);
Vladislav Kaznacheev0d50d862016-03-29 15:43:28 -0700461
462 /**
Winson41275482016-10-10 15:17:45 -0700463 * Create an input consumer by name.
Vladislav Kaznacheev0d50d862016-03-29 15:43:28 -0700464 */
Winson41275482016-10-10 15:17:45 -0700465 void createInputConsumer(String name, out InputChannel inputChannel);
Vladislav Kaznacheev0d50d862016-03-29 15:43:28 -0700466
467 /**
Winson41275482016-10-10 15:17:45 -0700468 * Destroy an input consumer by name. This method will also dispose the input channels
469 * associated with that InputConsumer.
Vladislav Kaznacheev0d50d862016-03-29 15:43:28 -0700470 */
Winson41275482016-10-10 15:17:45 -0700471 boolean destroyInputConsumer(String name);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800472}