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 | |
Dianne Hackborn | 27eac1d | 2015-03-16 17:15:53 -0700 | [diff] [blame] | 19 | import com.android.internal.app.IAssistScreenshotReceiver; |
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; |
| 22 | |
Dianne Hackborn | 2f0b175 | 2011-05-31 17:59:49 -0700 | [diff] [blame] | 23 | import android.content.res.CompatibilityInfo; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 24 | import android.content.res.Configuration; |
Dianne Hackborn | 0aae2d4 | 2010-12-07 23:51:29 -0800 | [diff] [blame] | 25 | import android.graphics.Bitmap; |
Dianne Hackborn | ac8dea1 | 2011-04-20 18:18:51 -0700 | [diff] [blame] | 26 | import android.graphics.Point; |
Svetoslav Ganov | c9c9a48 | 2012-07-16 08:46:07 -0700 | [diff] [blame] | 27 | import android.graphics.Rect; |
Adam Cohen | f752202 | 2012-10-03 20:03:18 -0700 | [diff] [blame] | 28 | import android.os.Bundle; |
Dianne Hackborn | 38e29a6 | 2011-09-18 14:43:08 -0700 | [diff] [blame] | 29 | import android.os.IRemoteCallback; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 30 | import android.view.IApplicationToken; |
Jorim Jaggi | 2f7d292 | 2015-10-29 13:08:29 +0100 | [diff] [blame] | 31 | import android.view.IAppTransitionAnimationSpecsFuture; |
Filip Gruszczynski | 64cdc14 | 2015-11-29 21:10:07 -0800 | [diff] [blame^] | 32 | import android.view.IDockDividerVisibilityListener; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 33 | import android.view.IOnKeyguardExitResult; |
| 34 | import android.view.IRotationWatcher; |
| 35 | import android.view.IWindowSession; |
Dianne Hackborn | eb94fa7 | 2014-06-03 17:48:12 -0700 | [diff] [blame] | 36 | import android.view.IWindowSessionCallback; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 37 | import android.view.KeyEvent; |
Jeff Brown | 6ec402b | 2010-07-28 15:48:59 -0700 | [diff] [blame] | 38 | import android.view.InputEvent; |
Svetoslav Ganov | 152e9bb | 2012-10-12 20:15:29 -0700 | [diff] [blame] | 39 | import android.view.MagnificationSpec; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 40 | import android.view.MotionEvent; |
Jeff Brown | a41ca77 | 2010-08-11 14:46:32 -0700 | [diff] [blame] | 41 | import android.view.InputChannel; |
Jeff Brown | 8d60866 | 2010-08-30 03:02:23 -0700 | [diff] [blame] | 42 | import android.view.InputDevice; |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 43 | import android.view.IInputFilter; |
Filip Gruszczynski | 170192a | 2015-08-16 17:46:34 -0700 | [diff] [blame] | 44 | import android.view.AppTransitionAnimationSpec; |
Svetoslav | 1376d60 | 2014-03-13 11:17:26 -0700 | [diff] [blame] | 45 | import android.view.WindowContentFrameStats; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 46 | |
| 47 | /** |
| 48 | * System private interface to the window manager. |
| 49 | * |
| 50 | * {@hide} |
| 51 | */ |
| 52 | interface IWindowManager |
| 53 | { |
| 54 | /** |
| 55 | * ===== NOTICE ===== |
| 56 | * The first three methods must remain the first three methods. Scripts |
| 57 | * and tools rely on their transaction number to work properly. |
| 58 | */ |
| 59 | // This is used for debugging |
| 60 | boolean startViewServer(int port); // Transaction #1 |
| 61 | boolean stopViewServer(); // Transaction #2 |
| 62 | boolean isViewServerRunning(); // Transaction #3 |
| 63 | |
Dianne Hackborn | eb94fa7 | 2014-06-03 17:48:12 -0700 | [diff] [blame] | 64 | IWindowSession openSession(in IWindowSessionCallback callback, in IInputMethodClient client, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 65 | in IInputContext inputContext); |
| 66 | boolean inputMethodClientHasFocus(IInputMethodClient client); |
Dianne Hackborn | ac8dea1 | 2011-04-20 18:18:51 -0700 | [diff] [blame] | 67 | |
Dianne Hackborn | 672cf45 | 2013-03-26 15:24:24 -0700 | [diff] [blame] | 68 | void getInitialDisplaySize(int displayId, out Point size); |
| 69 | void getBaseDisplaySize(int displayId, out Point size); |
Jeff Brown | 43aa159 | 2012-09-10 17:36:31 -0700 | [diff] [blame] | 70 | void setForcedDisplaySize(int displayId, int width, int height); |
Craig Mautner | 59c0097 | 2012-07-30 12:10:24 -0700 | [diff] [blame] | 71 | void clearForcedDisplaySize(int displayId); |
Dianne Hackborn | 672cf45 | 2013-03-26 15:24:24 -0700 | [diff] [blame] | 72 | int getInitialDisplayDensity(int displayId); |
| 73 | int getBaseDisplayDensity(int displayId); |
Dianne Hackborn | dde331c | 2012-08-03 14:01:57 -0700 | [diff] [blame] | 74 | void setForcedDisplayDensity(int displayId, int density); |
| 75 | void clearForcedDisplayDensity(int displayId); |
Jeff Brown | d46747a | 2015-04-15 19:02:36 -0700 | [diff] [blame] | 76 | void setForcedDisplayScalingMode(int displayId, int mode); // 0 = auto, 1 = disable |
Dianne Hackborn | 7916ac6 | 2011-05-16 20:45:48 -0700 | [diff] [blame] | 77 | |
Dianne Hackborn | c652de8 | 2013-02-15 16:32:56 -0800 | [diff] [blame] | 78 | void setOverscan(int displayId, int left, int top, int right, int bottom); |
| 79 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 80 | // These can only be called when holding the MANAGE_APP_TOKENS permission. |
| 81 | void pauseKeyDispatching(IBinder token); |
| 82 | void resumeKeyDispatching(IBinder token); |
| 83 | void setEventDispatching(boolean enabled); |
Dianne Hackborn | e4fbd62 | 2009-03-27 18:09:16 -0700 | [diff] [blame] | 84 | void addWindowToken(IBinder token, int type); |
| 85 | void removeWindowToken(IBinder token); |
Wale Ogunwale | 706ed79 | 2015-08-02 10:29:44 -0700 | [diff] [blame] | 86 | /** |
| 87 | * Adds an application token to the specified task Id. |
| 88 | * @param addPos The position to add the token to in the task. |
| 89 | * @param token The token to add. |
| 90 | * @param taskId The Id of the task we are adding the token to. |
| 91 | * @param stackId Stack Id to create a new Task with the input task Id on |
| 92 | * if the task doesn't exist yet. |
| 93 | * @param requestedOrientation Orientation to use. |
| 94 | * @param fullscreen True if the application token is fullscreen. |
| 95 | * @param showWhenLocked True if the application token should be shown when locked. |
| 96 | * @param userId Id of user to associate the token with. |
| 97 | * @param configChanges Input configuration changes. |
| 98 | * @param voiceInteraction True if the token is in voice interaction mode. |
| 99 | * @param launchTaskBehind True if the token is been launched from behind. |
| 100 | * @param taskBounds Bounds to use when creating a new Task with the input task Id if |
| 101 | * the task doesn't exist yet. |
Filip Gruszczynski | ebcc875 | 2015-08-25 16:51:05 -0700 | [diff] [blame] | 102 | * @param configuration Configuration that is being used with this task. |
Wale Ogunwale | 61b009e | 2015-09-16 15:43:05 -0700 | [diff] [blame] | 103 | * @param cropWindowsToStack True if the app windows should be cropped to the stack bounds. |
Wale Ogunwale | 706ed79 | 2015-08-02 10:29:44 -0700 | [diff] [blame] | 104 | */ |
Filip Gruszczynski | ebcc875 | 2015-08-25 16:51:05 -0700 | [diff] [blame] | 105 | void addAppToken(int addPos, IApplicationToken token, int taskId, int stackId, |
Craig Mautner | 5d9f547 | 2013-11-12 14:02:52 -0800 | [diff] [blame] | 106 | int requestedOrientation, boolean fullscreen, boolean showWhenLocked, int userId, |
Wale Ogunwale | 706ed79 | 2015-08-02 10:29:44 -0700 | [diff] [blame] | 107 | int configChanges, boolean voiceInteraction, boolean launchTaskBehind, |
Wale Ogunwale | 61b009e | 2015-09-16 15:43:05 -0700 | [diff] [blame] | 108 | in Rect taskBounds, in Configuration configuration, boolean cropWindowsToStack); |
Wale Ogunwale | 706ed79 | 2015-08-02 10:29:44 -0700 | [diff] [blame] | 109 | /** |
| 110 | * |
| 111 | * @param token The token we are adding to the input task Id. |
| 112 | * @param taskId The Id of the task we are adding the token to. |
| 113 | * @param taskBounds Bounds to use when creating a new Task with the input task Id if |
| 114 | * the task doesn't exist yet. |
Filip Gruszczynski | ebcc875 | 2015-08-25 16:51:05 -0700 | [diff] [blame] | 115 | * @param config Configuration that is being used with this task. |
Wale Ogunwale | 706ed79 | 2015-08-02 10:29:44 -0700 | [diff] [blame] | 116 | */ |
Filip Gruszczynski | ebcc875 | 2015-08-25 16:51:05 -0700 | [diff] [blame] | 117 | void setAppTask(IBinder token, int taskId, in Rect taskBounds, in Configuration config); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 118 | void setAppOrientation(IApplicationToken token, int requestedOrientation); |
| 119 | int getAppOrientation(IApplicationToken token); |
| 120 | void setFocusedApp(IBinder token, boolean moveFocusNow); |
Dianne Hackborn | 7da6ac3 | 2010-12-09 19:22:04 -0800 | [diff] [blame] | 121 | void prepareAppTransition(int transit, boolean alwaysKeepCurrent); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 122 | int getPendingAppTransition(); |
Dianne Hackborn | 8437587 | 2012-06-01 19:03:50 -0700 | [diff] [blame] | 123 | void overridePendingAppTransition(String packageName, int enterAnim, int exitAnim, |
| 124 | IRemoteCallback startedCallback); |
Dianne Hackborn | eabfb3a | 2012-04-16 16:28:22 -0700 | [diff] [blame] | 125 | void overridePendingAppTransitionScaleUp(int startX, int startY, int startWidth, |
| 126 | int startHeight); |
Chet Haase | 10e23ab | 2015-02-11 15:08:38 -0800 | [diff] [blame] | 127 | void overridePendingAppTransitionClipReveal(int startX, int startY, |
| 128 | int startWidth, int startHeight); |
Dianne Hackborn | 8078d8c | 2012-03-20 11:11:26 -0700 | [diff] [blame] | 129 | void overridePendingAppTransitionThumb(in Bitmap srcThumb, int startX, int startY, |
Michael Jurka | 832cb22 | 2012-04-13 09:32:47 -0700 | [diff] [blame] | 130 | IRemoteCallback startedCallback, boolean scaleUp); |
Winson Chung | a4ccb86 | 2014-08-22 15:26:27 -0700 | [diff] [blame] | 131 | void overridePendingAppTransitionAspectScaledThumb(in Bitmap srcThumb, int startX, |
Winson Chung | 2e7f3bd | 2014-09-05 13:17:22 +0200 | [diff] [blame] | 132 | int startY, int targetWidth, int targetHeight, IRemoteCallback startedCallback, |
| 133 | boolean scaleUp); |
Filip Gruszczynski | 170192a | 2015-08-16 17:46:34 -0700 | [diff] [blame] | 134 | /** |
| 135 | * Overrides animation for app transition that exits from an application to a multi-window |
| 136 | * environment and allows specifying transition animation parameters for each window. |
| 137 | * |
| 138 | * @param specs Array of transition animation descriptions for entering windows. |
| 139 | * |
| 140 | * @hide |
| 141 | */ |
| 142 | void overridePendingAppTransitionMultiThumb(in AppTransitionAnimationSpec[] specs, |
Filip Gruszczynski | 1a5203d | 2015-10-29 17:43:49 -0700 | [diff] [blame] | 143 | IRemoteCallback startedCallback, IRemoteCallback finishedCallback, boolean scaleUp); |
Winson Chung | 044d529 | 2014-11-06 11:05:19 -0800 | [diff] [blame] | 144 | void overridePendingAppTransitionInPlace(String packageName, int anim); |
Jorim Jaggi | 2f7d292 | 2015-10-29 13:08:29 +0100 | [diff] [blame] | 145 | |
| 146 | /** |
| 147 | * Like overridePendingAppTransitionMultiThumb, but uses a future to supply the specs. This is |
| 148 | * used for recents, where generating the thumbnails of the specs takes a non-trivial amount of |
| 149 | * time, so we want to move that off the critical path for starting the new activity. |
| 150 | */ |
| 151 | void overridePendingAppTransitionMultiThumbFuture( |
| 152 | IAppTransitionAnimationSpecsFuture specsFuture, IRemoteCallback startedCallback, |
| 153 | boolean scaleUp); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 154 | void executeAppTransition(); |
| 155 | void setAppStartingWindow(IBinder token, String pkg, int theme, |
Dianne Hackborn | 2f0b175 | 2011-05-31 17:59:49 -0700 | [diff] [blame] | 156 | in CompatibilityInfo compatInfo, CharSequence nonLocalizedLabel, int labelRes, |
Adam Powell | 04fe6eb | 2013-05-31 14:39:48 -0700 | [diff] [blame] | 157 | int icon, int logo, int windowFlags, IBinder transferFrom, boolean createIfNeeded); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 158 | void setAppVisibility(IBinder token, boolean visible); |
| 159 | void startAppFreezingScreen(IBinder token, int configChanges); |
| 160 | void stopAppFreezingScreen(IBinder token, boolean force); |
| 161 | void removeAppToken(IBinder token); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 162 | |
Filip Gruszczynski | 14b4e57 | 2015-11-03 15:53:55 -0800 | [diff] [blame] | 163 | /** Used by system ui to report that recents has shown itself. */ |
| 164 | void endProlongedAnimations(); |
| 165 | |
Dianne Hackborn | e36d6e2 | 2010-02-17 19:46:25 -0800 | [diff] [blame] | 166 | // Re-evaluate the current orientation from the caller's state. |
| 167 | // If there is a change, the new Configuration is returned and the |
| 168 | // caller must call setNewConfiguration() sometime later. |
| 169 | Configuration updateOrientationFromAppTokens(in Configuration currentConfig, |
| 170 | IBinder freezeThisOneIfNeeded); |
| 171 | void setNewConfiguration(in Configuration config); |
Jim Miller | 4eeb4f6 | 2012-11-08 00:04:29 -0800 | [diff] [blame] | 172 | |
Dianne Hackborn | 9d9ece3 | 2012-09-10 15:33:52 -0700 | [diff] [blame] | 173 | void startFreezingScreen(int exitAnim, int enterAnim); |
| 174 | void stopFreezingScreen(); |
| 175 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 176 | // these require DISABLE_KEYGUARD permission |
| 177 | void disableKeyguard(IBinder token, String tag); |
| 178 | void reenableKeyguard(IBinder token); |
| 179 | void exitKeyguardSecurely(IOnKeyguardExitResult callback); |
Mike Lockwood | 520d8bc | 2011-02-18 13:23:13 -0500 | [diff] [blame] | 180 | boolean isKeyguardLocked(); |
| 181 | boolean isKeyguardSecure(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 182 | boolean inKeyguardRestrictedInputMode(); |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 183 | void dismissKeyguard(); |
Jorim Jaggi | 84a3e7a | 2014-08-13 17:58:58 +0200 | [diff] [blame] | 184 | void keyguardGoingAway(boolean disableWindowAnimations, |
| 185 | boolean keyguardGoingToNotificationShade); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 186 | |
Dianne Hackborn | ffa4248 | 2009-09-23 22:20:11 -0700 | [diff] [blame] | 187 | void closeSystemDialogs(String reason); |
Jim Miller | 4eeb4f6 | 2012-11-08 00:04:29 -0800 | [diff] [blame] | 188 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 189 | // These can only be called with the SET_ANIMATON_SCALE permission. |
| 190 | float getAnimationScale(int which); |
| 191 | float[] getAnimationScales(); |
| 192 | void setAnimationScale(int which, float scale); |
| 193 | void setAnimationScales(in float[] scales); |
Jim Miller | 4eeb4f6 | 2012-11-08 00:04:29 -0800 | [diff] [blame] | 194 | |
Dianne Hackborn | eb94fa7 | 2014-06-03 17:48:12 -0700 | [diff] [blame] | 195 | float getCurrentAnimatorScale(); |
| 196 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 197 | // For testing |
| 198 | void setInTouchMode(boolean showFocus); |
Brad Fitzpatrick | 6804433 | 2010-11-22 18:19:48 -0800 | [diff] [blame] | 199 | |
| 200 | // For StrictMode flashing a red border on violations from the UI |
| 201 | // thread. The uid/pid is implicit from the Binder call, and the Window |
| 202 | // Manager uses that to determine whether or not the red border should |
| 203 | // actually be shown. (it will be ignored that pid doesn't have windows |
| 204 | // on screen) |
| 205 | void showStrictModeViolation(boolean on); |
| 206 | |
Brad Fitzpatrick | c1a968a | 2010-11-24 08:56:40 -0800 | [diff] [blame] | 207 | // Proxy to set the system property for whether the flashing |
| 208 | // should be enabled. The 'enabled' value is null or blank for |
| 209 | // the system default (differs per build variant) or any valid |
| 210 | // boolean string as parsed by SystemProperties.getBoolean(). |
| 211 | void setStrictModeVisualIndicatorPreference(String enabled); |
| 212 | |
Sander Alewijnse | d2a1eec | 2014-07-09 12:57:05 +0100 | [diff] [blame] | 213 | /** |
Sander Alewijnse | a87863a | 2014-07-29 12:01:38 +0100 | [diff] [blame] | 214 | * 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] | 215 | */ |
Sander Alewijnse | a87863a | 2014-07-29 12:01:38 +0100 | [diff] [blame] | 216 | void setScreenCaptureDisabled(int userId, boolean disabled); |
Sander Alewijnse | d2a1eec | 2014-07-09 12:57:05 +0100 | [diff] [blame] | 217 | |
Winson | c28098f | 2015-10-30 14:50:19 -0700 | [diff] [blame] | 218 | /** |
| 219 | * Cancels the window transitions for the given task. |
| 220 | */ |
| 221 | void cancelTaskWindowTransition(int taskId); |
| 222 | |
Winson | 13d3066 | 2015-11-06 15:30:29 -0800 | [diff] [blame] | 223 | /** |
| 224 | * Cancels the thumbnail transitions for the given task. |
| 225 | */ |
| 226 | void cancelTaskThumbnailTransition(int taskId); |
| 227 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 228 | // These can only be called with the SET_ORIENTATION permission. |
| 229 | /** |
Jeff Brown | 01a98dd | 2011-09-20 15:08:29 -0700 | [diff] [blame] | 230 | * Update the current screen rotation based on the current state of |
| 231 | * the world. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 232 | * @param alwaysSendConfiguration Flag to force a new configuration to |
| 233 | * be evaluated. This can be used when there are other parameters in |
| 234 | * configuration that are changing. |
Dianne Hackborn | f87d196 | 2012-04-04 12:48:24 -0700 | [diff] [blame] | 235 | * @param forceRelayout If true, the window manager will always do a relayout |
| 236 | * 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] | 237 | */ |
Dianne Hackborn | f87d196 | 2012-04-04 12:48:24 -0700 | [diff] [blame] | 238 | void updateRotation(boolean alwaysSendConfiguration, boolean forceRelayout); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 239 | |
| 240 | /** |
| 241 | * Retrieve the current screen orientation, constants as per |
| 242 | * {@link android.view.Surface}. |
| 243 | */ |
| 244 | int getRotation(); |
Jim Miller | 4eeb4f6 | 2012-11-08 00:04:29 -0800 | [diff] [blame] | 245 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 246 | /** |
| 247 | * Watch the rotation of the screen. Returns the current rotation, |
| 248 | * calls back when it changes. |
| 249 | */ |
| 250 | int watchRotation(IRotationWatcher watcher); |
Daniel Sandler | b73617d | 2010-08-17 00:41:00 -0400 | [diff] [blame] | 251 | |
Adam Powell | dfee59a | 2011-08-05 20:48:30 -0700 | [diff] [blame] | 252 | /** |
Brian Colonna | b1b9a8a | 2013-03-29 11:52:42 -0400 | [diff] [blame] | 253 | * Remove a rotation watcher set using watchRotation. |
| 254 | * @hide |
| 255 | */ |
| 256 | void removeRotationWatcher(IRotationWatcher watcher); |
| 257 | |
| 258 | /** |
Adam Powell | dfee59a | 2011-08-05 20:48:30 -0700 | [diff] [blame] | 259 | * Determine the preferred edge of the screen to pin the compact options menu against. |
| 260 | * @return a Gravity value for the options menu panel |
| 261 | * @hide |
| 262 | */ |
| 263 | int getPreferredOptionsPanelGravity(); |
| 264 | |
Jim Miller | 4eeb4f6 | 2012-11-08 00:04:29 -0800 | [diff] [blame] | 265 | /** |
| 266 | * Lock the device orientation to the specified rotation, or to the |
| 267 | * current rotation if -1. Sensor input will be ignored until |
| 268 | * thawRotation() is called. |
| 269 | * @hide |
| 270 | */ |
| 271 | void freezeRotation(int rotation); |
Daniel Sandler | b73617d | 2010-08-17 00:41:00 -0400 | [diff] [blame] | 272 | |
Jim Miller | 4eeb4f6 | 2012-11-08 00:04:29 -0800 | [diff] [blame] | 273 | /** |
| 274 | * Release the orientation lock imposed by freezeRotation(). |
| 275 | * @hide |
| 276 | */ |
| 277 | void thawRotation(); |
Dianne Hackborn | 0aae2d4 | 2010-12-07 23:51:29 -0800 | [diff] [blame] | 278 | |
Jim Miller | 4eeb4f6 | 2012-11-08 00:04:29 -0800 | [diff] [blame] | 279 | /** |
Svetoslav | 8e3feb1 | 2014-02-24 13:46:47 -0800 | [diff] [blame] | 280 | * Gets whether the rotation is frozen. |
Svetoslav Ganov | 80943d8 | 2013-01-02 10:25:37 -0800 | [diff] [blame] | 281 | * |
| 282 | * @return Whether the rotation is frozen. |
| 283 | */ |
| 284 | boolean isRotationFrozen(); |
| 285 | |
| 286 | /** |
Dianne Hackborn | 27eac1d | 2015-03-16 17:15:53 -0700 | [diff] [blame] | 287 | * Used only for assist -- request a screenshot of the current application. |
| 288 | */ |
| 289 | boolean requestAssistScreenshot(IAssistScreenshotReceiver receiver); |
| 290 | |
| 291 | /** |
Jim Miller | 4eeb4f6 | 2012-11-08 00:04:29 -0800 | [diff] [blame] | 292 | * Create a screenshot of the applications currently displayed. |
Winson | 8b1871d | 2015-11-20 09:56:20 -0800 | [diff] [blame] | 293 | * |
Filip Gruszczynski | 64cdc14 | 2015-11-29 21:10:07 -0800 | [diff] [blame^] | 294 | * @param frameScale the scale to apply to the frame, only used when width = -1 and |
Winson | 8b1871d | 2015-11-20 09:56:20 -0800 | [diff] [blame] | 295 | * height = -1 |
Jim Miller | 4eeb4f6 | 2012-11-08 00:04:29 -0800 | [diff] [blame] | 296 | */ |
Filip Gruszczynski | 64cdc14 | 2015-11-29 21:10:07 -0800 | [diff] [blame^] | 297 | Bitmap screenshotApplications(IBinder appToken, int displayId, int maxWidth, int maxHeight, |
Winson | 8b1871d | 2015-11-20 09:56:20 -0800 | [diff] [blame] | 298 | float frameScale); |
Joe Onorato | 664644d | 2011-01-23 17:53:23 -0800 | [diff] [blame] | 299 | |
| 300 | /** |
| 301 | * Called by the status bar to notify Views of changes to System UI visiblity. |
| 302 | */ |
John Spurlock | e7c2857 | 2013-10-29 14:23:51 -0400 | [diff] [blame] | 303 | oneway void statusBarVisibilityChanged(int visibility); |
Jeff Brown | 1a84fd1 | 2011-06-02 01:26:32 -0700 | [diff] [blame] | 304 | |
| 305 | /** |
Daniel Sandler | 0c4ccff | 2011-10-19 16:39:14 -0400 | [diff] [blame] | 306 | * Device has a software navigation bar (separate from the status bar). |
| 307 | */ |
| 308 | boolean hasNavigationBar(); |
Jim Miller | 93c518e | 2012-01-17 15:55:31 -0800 | [diff] [blame] | 309 | |
| 310 | /** |
Adam Cohen | f752202 | 2012-10-03 20:03:18 -0700 | [diff] [blame] | 311 | * Lock the device immediately with the specified options (can be null). |
Jim Miller | 93c518e | 2012-01-17 15:55:31 -0800 | [diff] [blame] | 312 | */ |
Adam Cohen | f752202 | 2012-10-03 20:03:18 -0700 | [diff] [blame] | 313 | void lockNow(in Bundle options); |
Svetoslav Ganov | c9c9a48 | 2012-07-16 08:46:07 -0700 | [diff] [blame] | 314 | |
| 315 | /** |
Jim Miller | bfec0a8 | 2012-11-05 20:05:22 -0800 | [diff] [blame] | 316 | * Device is in safe mode. |
| 317 | */ |
| 318 | boolean isSafeModeEnabled(); |
Jorim Jaggi | cff0acb | 2014-03-31 16:35:15 +0200 | [diff] [blame] | 319 | |
| 320 | /** |
| 321 | * Enables the screen if all conditions are met. |
| 322 | */ |
| 323 | void enableScreenIfNeeded(); |
Svetoslav | dd137a8 | 2014-04-10 12:48:07 -0700 | [diff] [blame] | 324 | |
| 325 | /** |
Svetoslav | 1376d60 | 2014-03-13 11:17:26 -0700 | [diff] [blame] | 326 | * Clears the frame statistics for a given window. |
| 327 | * |
| 328 | * @param token The window token. |
| 329 | * @return Whether the frame statistics were cleared. |
| 330 | */ |
| 331 | boolean clearWindowContentFrameStats(IBinder token); |
| 332 | |
| 333 | /** |
| 334 | * Gets the content frame statistics for a given window. |
| 335 | * |
| 336 | * @param token The window token. |
| 337 | * @return The frame statistics or null if the window does not exist. |
| 338 | */ |
| 339 | WindowContentFrameStats getWindowContentFrameStats(IBinder token); |
Jorim Jaggi | 61f39a7 | 2015-10-29 16:54:18 +0100 | [diff] [blame] | 340 | |
| 341 | /** |
| 342 | * @return the dock side the current docked stack is at; must be one of the |
| 343 | * WindowManagerGlobal.DOCKED_* values |
| 344 | */ |
| 345 | int getDockedStackSide(); |
| 346 | |
| 347 | /** |
| 348 | * Sets whether we are currently in a drag resize operation where we are changing the docked |
| 349 | * stack size. |
| 350 | */ |
| 351 | void setDockedStackResizing(boolean resizing); |
Filip Gruszczynski | 64cdc14 | 2015-11-29 21:10:07 -0800 | [diff] [blame^] | 352 | |
| 353 | /** |
| 354 | * Registers a listener that will be called when the dock divider changes its visibility. |
| 355 | */ |
| 356 | void registerDockDividerVisibilityListener(IDockDividerVisibilityListener listener); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 357 | } |