Dianne Hackborn | 7da6ac3 | 2010-12-09 19:22:04 -0800 | [diff] [blame] | 1 | /* |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2 | ** Copyright 2006, The Android Open Source Project |
| 3 | ** |
Jim Miller | 4eeb4f6 | 2012-11-08 00:04:29 -0800 | [diff] [blame] | 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 |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7 | ** |
Jim Miller | 4eeb4f6 | 2012-11-08 00:04:29 -0800 | [diff] [blame] | 8 | ** http://www.apache.org/licenses/LICENSE-2.0 |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 9 | ** |
Jim Miller | 4eeb4f6 | 2012-11-08 00:04:29 -0800 | [diff] [blame] | 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 |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 14 | ** limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package android.view; |
| 18 | |
Clara Bayarri | 75e0979 | 2015-07-29 16:20:40 +0100 | [diff] [blame] | 19 | import com.android.internal.os.IResultReceiver; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 20 | import com.android.internal.view.IInputContext; |
| 21 | import com.android.internal.view.IInputMethodClient; |
Jorim Jaggi | 241ae10 | 2016-11-02 21:57:33 -0700 | [diff] [blame] | 22 | import com.android.internal.policy.IKeyguardDismissCallback; |
Muyuan Li | 94ce94e | 2016-02-24 16:20:54 -0800 | [diff] [blame] | 23 | import com.android.internal.policy.IShortcutService; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 24 | |
Winson Chung | e210468 | 2017-11-08 17:31:14 -0800 | [diff] [blame] | 25 | import android.app.IAssistDataReceiver; |
Dianne Hackborn | 2f0b175 | 2011-05-31 17:59:49 -0700 | [diff] [blame] | 26 | import android.content.res.CompatibilityInfo; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 27 | import android.content.res.Configuration; |
Dianne Hackborn | 0aae2d4 | 2010-12-07 23:51:29 -0800 | [diff] [blame] | 28 | import android.graphics.Bitmap; |
Winson Chung | a31922f | 2017-05-24 15:50:06 -0700 | [diff] [blame] | 29 | import android.graphics.GraphicBuffer; |
Dianne Hackborn | ac8dea1 | 2011-04-20 18:18:51 -0700 | [diff] [blame] | 30 | import android.graphics.Point; |
Svetoslav Ganov | c9c9a48 | 2012-07-16 08:46:07 -0700 | [diff] [blame] | 31 | import android.graphics.Rect; |
Albert Chaulk | 56162a0 | 2017-06-05 19:35:23 -0400 | [diff] [blame] | 32 | import android.graphics.Region; |
Adam Cohen | f752202 | 2012-10-03 20:03:18 -0700 | [diff] [blame] | 33 | import android.os.Bundle; |
Dianne Hackborn | 38e29a6 | 2011-09-18 14:43:08 -0700 | [diff] [blame] | 34 | import android.os.IRemoteCallback; |
Robert Carr | 3b71624 | 2016-08-16 16:02:21 -0700 | [diff] [blame] | 35 | import android.os.ParcelFileDescriptor; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 36 | import android.view.IApplicationToken; |
Jorim Jaggi | 2f7d292 | 2015-10-29 13:08:29 +0100 | [diff] [blame] | 37 | import android.view.IAppTransitionAnimationSpecsFuture; |
Jorim Jaggi | a6c934e | 2015-12-21 13:22:31 +0100 | [diff] [blame] | 38 | import android.view.IDockedStackListener; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 39 | import android.view.IOnKeyguardExitResult; |
Winson Chung | 655332c | 2016-10-31 13:14:28 -0700 | [diff] [blame] | 40 | import android.view.IPinnedStackListener; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 41 | import android.view.IRotationWatcher; |
Lucas Dupin | e157170 | 2017-05-24 14:14:44 -0700 | [diff] [blame] | 42 | import android.view.IWallpaperVisibilityListener; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 43 | import android.view.IWindowSession; |
Dianne Hackborn | eb94fa7 | 2014-06-03 17:48:12 -0700 | [diff] [blame] | 44 | import android.view.IWindowSessionCallback; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 45 | import android.view.KeyEvent; |
Jeff Brown | 6ec402b | 2010-07-28 15:48:59 -0700 | [diff] [blame] | 46 | import android.view.InputEvent; |
Svetoslav Ganov | 152e9bb | 2012-10-12 20:15:29 -0700 | [diff] [blame] | 47 | import android.view.MagnificationSpec; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 48 | import android.view.MotionEvent; |
Jeff Brown | a41ca77 | 2010-08-11 14:46:32 -0700 | [diff] [blame] | 49 | import android.view.InputChannel; |
Jeff Brown | 8d60866 | 2010-08-30 03:02:23 -0700 | [diff] [blame] | 50 | import android.view.InputDevice; |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 51 | import android.view.IInputFilter; |
Filip Gruszczynski | 170192a | 2015-08-16 17:46:34 -0700 | [diff] [blame] | 52 | import android.view.AppTransitionAnimationSpec; |
Svetoslav | 1376d60 | 2014-03-13 11:17:26 -0700 | [diff] [blame] | 53 | import android.view.WindowContentFrameStats; |
Jorim Jaggi | e2c77f9 | 2016-12-29 14:57:22 +0100 | [diff] [blame] | 54 | import android.view.WindowManager; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 55 | |
| 56 | /** |
| 57 | * System private interface to the window manager. |
| 58 | * |
| 59 | * {@hide} |
| 60 | */ |
| 61 | interface IWindowManager |
| 62 | { |
| 63 | /** |
| 64 | * ===== NOTICE ===== |
| 65 | * The first three methods must remain the first three methods. Scripts |
| 66 | * and tools rely on their transaction number to work properly. |
| 67 | */ |
| 68 | // This is used for debugging |
| 69 | boolean startViewServer(int port); // Transaction #1 |
| 70 | boolean stopViewServer(); // Transaction #2 |
| 71 | boolean isViewServerRunning(); // Transaction #3 |
| 72 | |
Dianne Hackborn | eb94fa7 | 2014-06-03 17:48:12 -0700 | [diff] [blame] | 73 | IWindowSession openSession(in IWindowSessionCallback callback, in IInputMethodClient client, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 74 | in IInputContext inputContext); |
| 75 | boolean inputMethodClientHasFocus(IInputMethodClient client); |
Dianne Hackborn | ac8dea1 | 2011-04-20 18:18:51 -0700 | [diff] [blame] | 76 | |
Dianne Hackborn | 672cf45 | 2013-03-26 15:24:24 -0700 | [diff] [blame] | 77 | void getInitialDisplaySize(int displayId, out Point size); |
| 78 | void getBaseDisplaySize(int displayId, out Point size); |
Jeff Brown | 43aa159 | 2012-09-10 17:36:31 -0700 | [diff] [blame] | 79 | void setForcedDisplaySize(int displayId, int width, int height); |
Craig Mautner | 59c0097 | 2012-07-30 12:10:24 -0700 | [diff] [blame] | 80 | void clearForcedDisplaySize(int displayId); |
Dianne Hackborn | 672cf45 | 2013-03-26 15:24:24 -0700 | [diff] [blame] | 81 | int getInitialDisplayDensity(int displayId); |
| 82 | int getBaseDisplayDensity(int displayId); |
Alan Viverette | df3a7ca | 2016-09-06 17:13:41 -0400 | [diff] [blame] | 83 | void setForcedDisplayDensityForUser(int displayId, int density, int userId); |
| 84 | void clearForcedDisplayDensityForUser(int displayId, int userId); |
Jeff Brown | d46747a | 2015-04-15 19:02:36 -0700 | [diff] [blame] | 85 | void setForcedDisplayScalingMode(int displayId, int mode); // 0 = auto, 1 = disable |
Dianne Hackborn | 7916ac6 | 2011-05-16 20:45:48 -0700 | [diff] [blame] | 86 | |
Dianne Hackborn | c652de8 | 2013-02-15 16:32:56 -0800 | [diff] [blame] | 87 | void setOverscan(int displayId, int left, int top, int right, int bottom); |
| 88 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 89 | // These can only be called when holding the MANAGE_APP_TOKENS permission. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 90 | void setEventDispatching(boolean enabled); |
Wale Ogunwale | ac2561e | 2016-11-01 15:43:46 -0700 | [diff] [blame] | 91 | void addWindowToken(IBinder token, int type, int displayId); |
| 92 | void removeWindowToken(IBinder token, int displayId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 93 | void setFocusedApp(IBinder token, boolean moveFocusNow); |
Dianne Hackborn | 7da6ac3 | 2010-12-09 19:22:04 -0800 | [diff] [blame] | 94 | void prepareAppTransition(int transit, boolean alwaysKeepCurrent); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 95 | int getPendingAppTransition(); |
Dianne Hackborn | 8437587 | 2012-06-01 19:03:50 -0700 | [diff] [blame] | 96 | void overridePendingAppTransition(String packageName, int enterAnim, int exitAnim, |
| 97 | IRemoteCallback startedCallback); |
Dianne Hackborn | eabfb3a | 2012-04-16 16:28:22 -0700 | [diff] [blame] | 98 | void overridePendingAppTransitionScaleUp(int startX, int startY, int startWidth, |
| 99 | int startHeight); |
Chet Haase | 10e23ab | 2015-02-11 15:08:38 -0800 | [diff] [blame] | 100 | void overridePendingAppTransitionClipReveal(int startX, int startY, |
| 101 | int startWidth, int startHeight); |
Winson Chung | a31922f | 2017-05-24 15:50:06 -0700 | [diff] [blame] | 102 | void overridePendingAppTransitionThumb(in GraphicBuffer srcThumb, int startX, int startY, |
Michael Jurka | 832cb22 | 2012-04-13 09:32:47 -0700 | [diff] [blame] | 103 | IRemoteCallback startedCallback, boolean scaleUp); |
Winson Chung | a31922f | 2017-05-24 15:50:06 -0700 | [diff] [blame] | 104 | void overridePendingAppTransitionAspectScaledThumb(in GraphicBuffer srcThumb, int startX, |
Winson Chung | 2e7f3bd | 2014-09-05 13:17:22 +0200 | [diff] [blame] | 105 | int startY, int targetWidth, int targetHeight, IRemoteCallback startedCallback, |
| 106 | boolean scaleUp); |
Filip Gruszczynski | 170192a | 2015-08-16 17:46:34 -0700 | [diff] [blame] | 107 | /** |
| 108 | * Overrides animation for app transition that exits from an application to a multi-window |
| 109 | * environment and allows specifying transition animation parameters for each window. |
| 110 | * |
| 111 | * @param specs Array of transition animation descriptions for entering windows. |
| 112 | * |
| 113 | * @hide |
| 114 | */ |
| 115 | void overridePendingAppTransitionMultiThumb(in AppTransitionAnimationSpec[] specs, |
Filip Gruszczynski | 1a5203d | 2015-10-29 17:43:49 -0700 | [diff] [blame] | 116 | IRemoteCallback startedCallback, IRemoteCallback finishedCallback, boolean scaleUp); |
Winson Chung | 044d529 | 2014-11-06 11:05:19 -0800 | [diff] [blame] | 117 | void overridePendingAppTransitionInPlace(String packageName, int anim); |
Jorim Jaggi | 2f7d292 | 2015-10-29 13:08:29 +0100 | [diff] [blame] | 118 | |
| 119 | /** |
| 120 | * Like overridePendingAppTransitionMultiThumb, but uses a future to supply the specs. This is |
| 121 | * used for recents, where generating the thumbnails of the specs takes a non-trivial amount of |
| 122 | * time, so we want to move that off the critical path for starting the new activity. |
| 123 | */ |
| 124 | void overridePendingAppTransitionMultiThumbFuture( |
| 125 | IAppTransitionAnimationSpecsFuture specsFuture, IRemoteCallback startedCallback, |
| 126 | boolean scaleUp); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 127 | void executeAppTransition(); |
Wale Ogunwale | 3b23239 | 2016-05-13 15:37:13 -0700 | [diff] [blame] | 128 | |
Filip Gruszczynski | 14b4e57 | 2015-11-03 15:53:55 -0800 | [diff] [blame] | 129 | /** Used by system ui to report that recents has shown itself. */ |
| 130 | void endProlongedAnimations(); |
| 131 | |
Dianne Hackborn | e36d6e2 | 2010-02-17 19:46:25 -0800 | [diff] [blame] | 132 | // Re-evaluate the current orientation from the caller's state. |
| 133 | // If there is a change, the new Configuration is returned and the |
| 134 | // caller must call setNewConfiguration() sometime later. |
| 135 | Configuration updateOrientationFromAppTokens(in Configuration currentConfig, |
Andrii Kulian | 5406e7a | 2016-10-21 11:55:23 -0700 | [diff] [blame] | 136 | IBinder freezeThisOneIfNeeded, int displayId); |
| 137 | // Notify window manager of the new display override configuration. Returns an array of stack |
| 138 | // ids that were affected by the update, ActivityManager should resize these stacks. |
| 139 | int[] setNewDisplayOverrideConfiguration(in Configuration overrideConfig, int displayId); |
Chong Zhang | 167bbfac | 2016-03-31 09:44:34 -0700 | [diff] [blame] | 140 | |
Dianne Hackborn | 9d9ece3 | 2012-09-10 15:33:52 -0700 | [diff] [blame] | 141 | void startFreezingScreen(int exitAnim, int enterAnim); |
| 142 | void stopFreezingScreen(); |
| 143 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 144 | // these require DISABLE_KEYGUARD permission |
| 145 | void disableKeyguard(IBinder token, String tag); |
| 146 | void reenableKeyguard(IBinder token); |
| 147 | void exitKeyguardSecurely(IOnKeyguardExitResult callback); |
Mike Lockwood | 520d8bc | 2011-02-18 13:23:13 -0500 | [diff] [blame] | 148 | boolean isKeyguardLocked(); |
| 149 | boolean isKeyguardSecure(); |
Lucas Dupin | c80c67e | 2017-12-04 14:29:10 -0800 | [diff] [blame^] | 150 | void dismissKeyguard(IKeyguardDismissCallback callback, CharSequence message); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 151 | |
Evan Rosky | 1839645 | 2016-07-27 15:19:37 -0700 | [diff] [blame] | 152 | // Requires INTERACT_ACROSS_USERS_FULL permission |
| 153 | void setSwitchingUser(boolean switching); |
| 154 | |
Dianne Hackborn | ffa4248 | 2009-09-23 22:20:11 -0700 | [diff] [blame] | 155 | void closeSystemDialogs(String reason); |
Jim Miller | 4eeb4f6 | 2012-11-08 00:04:29 -0800 | [diff] [blame] | 156 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 157 | // These can only be called with the SET_ANIMATON_SCALE permission. |
| 158 | float getAnimationScale(int which); |
| 159 | float[] getAnimationScales(); |
| 160 | void setAnimationScale(int which, float scale); |
| 161 | void setAnimationScales(in float[] scales); |
Jim Miller | 4eeb4f6 | 2012-11-08 00:04:29 -0800 | [diff] [blame] | 162 | |
Dianne Hackborn | eb94fa7 | 2014-06-03 17:48:12 -0700 | [diff] [blame] | 163 | float getCurrentAnimatorScale(); |
| 164 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 165 | // For testing |
| 166 | void setInTouchMode(boolean showFocus); |
Brad Fitzpatrick | 6804433 | 2010-11-22 18:19:48 -0800 | [diff] [blame] | 167 | |
| 168 | // For StrictMode flashing a red border on violations from the UI |
| 169 | // thread. The uid/pid is implicit from the Binder call, and the Window |
| 170 | // Manager uses that to determine whether or not the red border should |
| 171 | // actually be shown. (it will be ignored that pid doesn't have windows |
| 172 | // on screen) |
| 173 | void showStrictModeViolation(boolean on); |
| 174 | |
Brad Fitzpatrick | c1a968a | 2010-11-24 08:56:40 -0800 | [diff] [blame] | 175 | // Proxy to set the system property for whether the flashing |
| 176 | // should be enabled. The 'enabled' value is null or blank for |
| 177 | // the system default (differs per build variant) or any valid |
| 178 | // boolean string as parsed by SystemProperties.getBoolean(). |
| 179 | void setStrictModeVisualIndicatorPreference(String enabled); |
| 180 | |
Sander Alewijnse | d2a1eec | 2014-07-09 12:57:05 +0100 | [diff] [blame] | 181 | /** |
Sander Alewijnse | a87863a | 2014-07-29 12:01:38 +0100 | [diff] [blame] | 182 | * Set whether screen capture is disabled for all windows of a specific user |
Sander Alewijnse | d2a1eec | 2014-07-09 12:57:05 +0100 | [diff] [blame] | 183 | */ |
Sander Alewijnse | a87863a | 2014-07-29 12:01:38 +0100 | [diff] [blame] | 184 | void setScreenCaptureDisabled(int userId, boolean disabled); |
Sander Alewijnse | d2a1eec | 2014-07-09 12:57:05 +0100 | [diff] [blame] | 185 | |
Winson | c28098f | 2015-10-30 14:50:19 -0700 | [diff] [blame] | 186 | /** |
Robert Carr | 3b71624 | 2016-08-16 16:02:21 -0700 | [diff] [blame] | 187 | * Testing and debugging infrastructure for writing surface events |
| 188 | * to given FD. See RemoteSurfaceTrace.java or Wm.java for format. |
| 189 | */ |
| 190 | void enableSurfaceTrace(in ParcelFileDescriptor fd); |
| 191 | void disableSurfaceTrace(); |
| 192 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 193 | // These can only be called with the SET_ORIENTATION permission. |
| 194 | /** |
Jeff Brown | 01a98dd | 2011-09-20 15:08:29 -0700 | [diff] [blame] | 195 | * Update the current screen rotation based on the current state of |
| 196 | * the world. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 197 | * @param alwaysSendConfiguration Flag to force a new configuration to |
| 198 | * be evaluated. This can be used when there are other parameters in |
| 199 | * configuration that are changing. |
Dianne Hackborn | f87d196 | 2012-04-04 12:48:24 -0700 | [diff] [blame] | 200 | * @param forceRelayout If true, the window manager will always do a relayout |
| 201 | * of its windows even if the rotation hasn't changed. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 202 | */ |
Dianne Hackborn | f87d196 | 2012-04-04 12:48:24 -0700 | [diff] [blame] | 203 | void updateRotation(boolean alwaysSendConfiguration, boolean forceRelayout); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 204 | |
| 205 | /** |
Andrii Kulian | 8ee7285 | 2017-03-10 10:36:45 -0800 | [diff] [blame] | 206 | * Retrieve the current orientation of the primary screen. |
| 207 | * @return Constant as per {@link android.view.Surface.Rotation}. |
| 208 | * |
| 209 | * @see android.view.Display#DEFAULT_DISPLAY |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 210 | */ |
Andrii Kulian | 8ee7285 | 2017-03-10 10:36:45 -0800 | [diff] [blame] | 211 | int getDefaultDisplayRotation(); |
Jim Miller | 4eeb4f6 | 2012-11-08 00:04:29 -0800 | [diff] [blame] | 212 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 213 | /** |
Andrii Kulian | 35fa3c2 | 2017-03-11 09:37:28 -0800 | [diff] [blame] | 214 | * Watch the rotation of the specified screen. Returns the current rotation, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 215 | * calls back when it changes. |
| 216 | */ |
Andrii Kulian | 35fa3c2 | 2017-03-11 09:37:28 -0800 | [diff] [blame] | 217 | int watchRotation(IRotationWatcher watcher, int displayId); |
Daniel Sandler | b73617d | 2010-08-17 00:41:00 -0400 | [diff] [blame] | 218 | |
Adam Powell | dfee59a | 2011-08-05 20:48:30 -0700 | [diff] [blame] | 219 | /** |
Brian Colonna | b1b9a8a | 2013-03-29 11:52:42 -0400 | [diff] [blame] | 220 | * Remove a rotation watcher set using watchRotation. |
| 221 | * @hide |
| 222 | */ |
| 223 | void removeRotationWatcher(IRotationWatcher watcher); |
| 224 | |
| 225 | /** |
Adam Powell | dfee59a | 2011-08-05 20:48:30 -0700 | [diff] [blame] | 226 | * Determine the preferred edge of the screen to pin the compact options menu against. |
| 227 | * @return a Gravity value for the options menu panel |
| 228 | * @hide |
| 229 | */ |
| 230 | int getPreferredOptionsPanelGravity(); |
| 231 | |
Jim Miller | 4eeb4f6 | 2012-11-08 00:04:29 -0800 | [diff] [blame] | 232 | /** |
| 233 | * Lock the device orientation to the specified rotation, or to the |
| 234 | * current rotation if -1. Sensor input will be ignored until |
| 235 | * thawRotation() is called. |
| 236 | * @hide |
| 237 | */ |
| 238 | void freezeRotation(int rotation); |
Daniel Sandler | b73617d | 2010-08-17 00:41:00 -0400 | [diff] [blame] | 239 | |
Jim Miller | 4eeb4f6 | 2012-11-08 00:04:29 -0800 | [diff] [blame] | 240 | /** |
| 241 | * Release the orientation lock imposed by freezeRotation(). |
| 242 | * @hide |
| 243 | */ |
| 244 | void thawRotation(); |
Dianne Hackborn | 0aae2d4 | 2010-12-07 23:51:29 -0800 | [diff] [blame] | 245 | |
Jim Miller | 4eeb4f6 | 2012-11-08 00:04:29 -0800 | [diff] [blame] | 246 | /** |
Svetoslav | 8e3feb1 | 2014-02-24 13:46:47 -0800 | [diff] [blame] | 247 | * Gets whether the rotation is frozen. |
Svetoslav Ganov | 80943d8 | 2013-01-02 10:25:37 -0800 | [diff] [blame] | 248 | * |
| 249 | * @return Whether the rotation is frozen. |
| 250 | */ |
| 251 | boolean isRotationFrozen(); |
| 252 | |
| 253 | /** |
Zak Cohen | 3683fb1 | 2016-07-11 19:47:37 +0100 | [diff] [blame] | 254 | * Screenshot the current wallpaper layer, including the whole screen. |
| 255 | */ |
| 256 | Bitmap screenshotWallpaper(); |
| 257 | |
| 258 | /** |
Lucas Dupin | e157170 | 2017-05-24 14:14:44 -0700 | [diff] [blame] | 259 | * Registers a wallpaper visibility listener. |
| 260 | * @return Current visibility. |
| 261 | */ |
| 262 | boolean registerWallpaperVisibilityListener(IWallpaperVisibilityListener listener, |
| 263 | int displayId); |
| 264 | |
| 265 | /** |
| 266 | * Remove a visibility watcher that was added using registerWallpaperVisibilityListener. |
| 267 | */ |
| 268 | void unregisterWallpaperVisibilityListener(IWallpaperVisibilityListener listener, |
| 269 | int displayId); |
| 270 | |
| 271 | /** |
Dianne Hackborn | 27eac1d | 2015-03-16 17:15:53 -0700 | [diff] [blame] | 272 | * Used only for assist -- request a screenshot of the current application. |
| 273 | */ |
Winson Chung | da2818f | 2017-10-23 16:25:49 -0700 | [diff] [blame] | 274 | boolean requestAssistScreenshot(IAssistDataReceiver receiver); |
Dianne Hackborn | 27eac1d | 2015-03-16 17:15:53 -0700 | [diff] [blame] | 275 | |
| 276 | /** |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 277 | * Called by the status bar to notify Views of changes to System UI visiblity. |
| 278 | */ |
John Spurlock | e7c2857 | 2013-10-29 14:23:51 -0400 | [diff] [blame] | 279 | oneway void statusBarVisibilityChanged(int visibility); |
Jeff Brown | 1a84fd1 | 2011-06-02 01:26:32 -0700 | [diff] [blame] | 280 | |
| 281 | /** |
Winson | ab21660 | 2016-08-09 14:05:20 -0700 | [diff] [blame] | 282 | * Called by System UI to notify of changes to the visibility of Recents. |
| 283 | */ |
| 284 | oneway void setRecentsVisibility(boolean visible); |
| 285 | |
| 286 | /** |
| 287 | * Called by System UI to notify of changes to the visibility of PIP. |
| 288 | */ |
Winson Chung | ac52f28 | 2017-03-30 14:44:52 -0700 | [diff] [blame] | 289 | oneway void setPipVisibility(boolean visible); |
Winson | ab21660 | 2016-08-09 14:05:20 -0700 | [diff] [blame] | 290 | |
| 291 | /** |
Daniel Sandler | 0c4ccff | 2011-10-19 16:39:14 -0400 | [diff] [blame] | 292 | * Device has a software navigation bar (separate from the status bar). |
| 293 | */ |
| 294 | boolean hasNavigationBar(); |
Jim Miller | 93c518e | 2012-01-17 15:55:31 -0800 | [diff] [blame] | 295 | |
| 296 | /** |
Adam Cohen | f752202 | 2012-10-03 20:03:18 -0700 | [diff] [blame] | 297 | * Lock the device immediately with the specified options (can be null). |
Jim Miller | 93c518e | 2012-01-17 15:55:31 -0800 | [diff] [blame] | 298 | */ |
Adam Cohen | f752202 | 2012-10-03 20:03:18 -0700 | [diff] [blame] | 299 | void lockNow(in Bundle options); |
Svetoslav Ganov | c9c9a48 | 2012-07-16 08:46:07 -0700 | [diff] [blame] | 300 | |
| 301 | /** |
Jim Miller | bfec0a8 | 2012-11-05 20:05:22 -0800 | [diff] [blame] | 302 | * Device is in safe mode. |
| 303 | */ |
| 304 | boolean isSafeModeEnabled(); |
Jorim Jaggi | cff0acb | 2014-03-31 16:35:15 +0200 | [diff] [blame] | 305 | |
| 306 | /** |
| 307 | * Enables the screen if all conditions are met. |
| 308 | */ |
| 309 | void enableScreenIfNeeded(); |
Svetoslav | dd137a8 | 2014-04-10 12:48:07 -0700 | [diff] [blame] | 310 | |
| 311 | /** |
Svetoslav | 1376d60 | 2014-03-13 11:17:26 -0700 | [diff] [blame] | 312 | * Clears the frame statistics for a given window. |
| 313 | * |
| 314 | * @param token The window token. |
| 315 | * @return Whether the frame statistics were cleared. |
| 316 | */ |
| 317 | boolean clearWindowContentFrameStats(IBinder token); |
| 318 | |
| 319 | /** |
| 320 | * Gets the content frame statistics for a given window. |
| 321 | * |
| 322 | * @param token The window token. |
| 323 | * @return The frame statistics or null if the window does not exist. |
| 324 | */ |
| 325 | WindowContentFrameStats getWindowContentFrameStats(IBinder token); |
Jorim Jaggi | 61f39a7 | 2015-10-29 16:54:18 +0100 | [diff] [blame] | 326 | |
| 327 | /** |
| 328 | * @return the dock side the current docked stack is at; must be one of the |
| 329 | * WindowManagerGlobal.DOCKED_* values |
| 330 | */ |
| 331 | int getDockedStackSide(); |
| 332 | |
| 333 | /** |
| 334 | * Sets whether we are currently in a drag resize operation where we are changing the docked |
| 335 | * stack size. |
| 336 | */ |
| 337 | void setDockedStackResizing(boolean resizing); |
Filip Gruszczynski | 64cdc14 | 2015-11-29 21:10:07 -0800 | [diff] [blame] | 338 | |
| 339 | /** |
Jorim Jaggi | d47e7e1 | 2016-03-01 09:57:38 +0100 | [diff] [blame] | 340 | * Sets the region the user can touch the divider. This region will be excluded from the region |
| 341 | * which is used to cause a focus switch when dispatching touch. |
| 342 | */ |
| 343 | void setDockedStackDividerTouchRegion(in Rect touchableRegion); |
| 344 | |
| 345 | /** |
Jorim Jaggi | a6c934e | 2015-12-21 13:22:31 +0100 | [diff] [blame] | 346 | * Registers a listener that will be called when the dock divider changes its visibility or when |
| 347 | * the docked stack gets added/removed. |
Filip Gruszczynski | 64cdc14 | 2015-11-29 21:10:07 -0800 | [diff] [blame] | 348 | */ |
Jorim Jaggi | a6c934e | 2015-12-21 13:22:31 +0100 | [diff] [blame] | 349 | void registerDockedStackListener(IDockedStackListener listener); |
Jorim Jaggi | 5098159 | 2015-12-29 17:54:12 +0100 | [diff] [blame] | 350 | |
| 351 | /** |
Winson Chung | 655332c | 2016-10-31 13:14:28 -0700 | [diff] [blame] | 352 | * Registers a listener that will be called when the pinned stack state changes. |
| 353 | */ |
| 354 | void registerPinnedStackListener(int displayId, IPinnedStackListener listener); |
| 355 | |
| 356 | /** |
Jorim Jaggi | 5098159 | 2015-12-29 17:54:12 +0100 | [diff] [blame] | 357 | * Updates the dim layer used while resizing. |
| 358 | * |
| 359 | * @param visible Whether the dim layer should be visible. |
Wale Ogunwale | 6827856 | 2017-09-23 17:13:55 -0700 | [diff] [blame] | 360 | * @param targetWindowingMode The windowing mode of the stack the dim layer should be placed on. |
Jorim Jaggi | 5098159 | 2015-12-29 17:54:12 +0100 | [diff] [blame] | 361 | * @param alpha The translucency of the dim layer, between 0 and 1. |
| 362 | */ |
Wale Ogunwale | 6827856 | 2017-09-23 17:13:55 -0700 | [diff] [blame] | 363 | void setResizeDimLayer(boolean visible, int targetWindowingMode, float alpha); |
Clara Bayarri | 75e0979 | 2015-07-29 16:20:40 +0100 | [diff] [blame] | 364 | |
| 365 | /** |
| 366 | * Requests Keyboard Shortcuts from the displayed window. |
| 367 | * |
| 368 | * @param receiver The receiver to deliver the results to. |
| 369 | */ |
Clara Bayarri | fcd7e80 | 2016-03-10 12:58:18 +0000 | [diff] [blame] | 370 | void requestAppKeyboardShortcuts(IResultReceiver receiver, int deviceId); |
Jorim Jaggi | c6c89a8 | 2016-01-28 17:48:21 -0800 | [diff] [blame] | 371 | |
| 372 | /** |
| 373 | * Retrieves the current stable insets from the primary display. |
| 374 | */ |
Winson Chung | 303c6b7 | 2016-10-24 17:12:49 -0700 | [diff] [blame] | 375 | void getStableInsets(int displayId, out Rect outInsets); |
Muyuan Li | 94ce94e | 2016-02-24 16:20:54 -0800 | [diff] [blame] | 376 | |
| 377 | /** |
| 378 | * Register shortcut key. Shortcut code is packed as: |
| 379 | * (MetaState << Integer.SIZE) | KeyCode |
| 380 | * @hide |
| 381 | */ |
| 382 | void registerShortcutKey(in long shortcutCode, IShortcutService keySubscriber); |
Vladislav Kaznacheev | 0d50d86 | 2016-03-29 15:43:28 -0700 | [diff] [blame] | 383 | |
| 384 | /** |
Winson | 4127548 | 2016-10-10 15:17:45 -0700 | [diff] [blame] | 385 | * Create an input consumer by name. |
Vladislav Kaznacheev | 0d50d86 | 2016-03-29 15:43:28 -0700 | [diff] [blame] | 386 | */ |
Winson Chung | 6463c36 | 2017-09-25 16:23:26 -0700 | [diff] [blame] | 387 | void createInputConsumer(IBinder token, String name, out InputChannel inputChannel); |
Vladislav Kaznacheev | 0d50d86 | 2016-03-29 15:43:28 -0700 | [diff] [blame] | 388 | |
| 389 | /** |
Winson | 4127548 | 2016-10-10 15:17:45 -0700 | [diff] [blame] | 390 | * Destroy an input consumer by name. This method will also dispose the input channels |
| 391 | * associated with that InputConsumer. |
Vladislav Kaznacheev | 0d50d86 | 2016-03-29 15:43:28 -0700 | [diff] [blame] | 392 | */ |
Winson | 4127548 | 2016-10-10 15:17:45 -0700 | [diff] [blame] | 393 | boolean destroyInputConsumer(String name); |
Albert Chaulk | 56162a0 | 2017-06-05 19:35:23 -0400 | [diff] [blame] | 394 | |
| 395 | /** |
| 396 | * Return the touch region for the current IME window, or an empty region if there is none. |
| 397 | */ |
| 398 | Region getCurrentImeTouchRegion(); |
Vishnu Nair | c961504 | 2018-01-09 07:23:31 -0800 | [diff] [blame] | 399 | |
| 400 | /** |
| 401 | * Starts a window trace. |
| 402 | */ |
| 403 | void startWindowTrace(); |
| 404 | |
| 405 | /** |
| 406 | * Stops a window trace. |
| 407 | */ |
| 408 | void stopWindowTrace(); |
| 409 | |
| 410 | /** |
| 411 | * Returns true if window trace is enabled. |
| 412 | */ |
| 413 | boolean isWindowTraceEnabled(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 414 | } |