IWindowManager.aidl revision 9d9ece3c1e16001b63244459cdf4b428f4272d2e
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 17package android.view; 18 19import com.android.internal.view.IInputContext; 20import com.android.internal.view.IInputMethodClient; 21 22import android.content.res.CompatibilityInfo; 23import android.content.res.Configuration; 24import android.graphics.Bitmap; 25import android.graphics.Point; 26import android.graphics.Rect; 27import android.os.IRemoteCallback; 28import android.view.IApplicationToken; 29import android.view.IDisplayContentChangeListener; 30import android.view.IOnKeyguardExitResult; 31import android.view.IRotationWatcher; 32import android.view.IWindowSession; 33import android.view.KeyEvent; 34import android.view.InputEvent; 35import android.view.MotionEvent; 36import android.view.InputChannel; 37import android.view.InputDevice; 38import android.view.IInputFilter; 39import android.view.WindowInfo; 40 41/** 42 * System private interface to the window manager. 43 * 44 * {@hide} 45 */ 46interface IWindowManager 47{ 48 /** 49 * ===== NOTICE ===== 50 * The first three methods must remain the first three methods. Scripts 51 * and tools rely on their transaction number to work properly. 52 */ 53 // This is used for debugging 54 boolean startViewServer(int port); // Transaction #1 55 boolean stopViewServer(); // Transaction #2 56 boolean isViewServerRunning(); // Transaction #3 57 58 IWindowSession openSession(in IInputMethodClient client, 59 in IInputContext inputContext); 60 boolean inputMethodClientHasFocus(IInputMethodClient client); 61 62 void setForcedDisplaySize(int displayId, int longDimen, int shortDimen); 63 void clearForcedDisplaySize(int displayId); 64 void setForcedDisplayDensity(int displayId, int density); 65 void clearForcedDisplayDensity(int displayId); 66 67 // Is the device configured to have a full system bar for larger screens? 68 boolean hasSystemNavBar(); 69 70 // These can only be called when holding the MANAGE_APP_TOKENS permission. 71 void pauseKeyDispatching(IBinder token); 72 void resumeKeyDispatching(IBinder token); 73 void setEventDispatching(boolean enabled); 74 void addWindowToken(IBinder token, int type); 75 void removeWindowToken(IBinder token); 76 void addAppToken(int addPos, IApplicationToken token, 77 int groupId, int requestedOrientation, boolean fullscreen); 78 void setAppGroupId(IBinder token, int groupId); 79 void setAppOrientation(IApplicationToken token, int requestedOrientation); 80 int getAppOrientation(IApplicationToken token); 81 void setFocusedApp(IBinder token, boolean moveFocusNow); 82 void prepareAppTransition(int transit, boolean alwaysKeepCurrent); 83 int getPendingAppTransition(); 84 void overridePendingAppTransition(String packageName, int enterAnim, int exitAnim, 85 IRemoteCallback startedCallback); 86 void overridePendingAppTransitionScaleUp(int startX, int startY, int startWidth, 87 int startHeight); 88 void overridePendingAppTransitionThumb(in Bitmap srcThumb, int startX, int startY, 89 IRemoteCallback startedCallback, boolean scaleUp); 90 void executeAppTransition(); 91 void setAppStartingWindow(IBinder token, String pkg, int theme, 92 in CompatibilityInfo compatInfo, CharSequence nonLocalizedLabel, int labelRes, 93 int icon, int windowFlags, IBinder transferFrom, boolean createIfNeeded); 94 void setAppWillBeHidden(IBinder token); 95 void setAppVisibility(IBinder token, boolean visible); 96 void startAppFreezingScreen(IBinder token, int configChanges); 97 void stopAppFreezingScreen(IBinder token, boolean force); 98 void removeAppToken(IBinder token); 99 void moveAppToken(int index, IBinder token); 100 void moveAppTokensToTop(in List<IBinder> tokens); 101 void moveAppTokensToBottom(in List<IBinder> tokens); 102 103 // Re-evaluate the current orientation from the caller's state. 104 // If there is a change, the new Configuration is returned and the 105 // caller must call setNewConfiguration() sometime later. 106 Configuration updateOrientationFromAppTokens(in Configuration currentConfig, 107 IBinder freezeThisOneIfNeeded); 108 void setNewConfiguration(in Configuration config); 109 110 void startFreezingScreen(int exitAnim, int enterAnim); 111 void stopFreezingScreen(); 112 113 // these require DISABLE_KEYGUARD permission 114 void disableKeyguard(IBinder token, String tag); 115 void reenableKeyguard(IBinder token); 116 void exitKeyguardSecurely(IOnKeyguardExitResult callback); 117 boolean isKeyguardLocked(); 118 boolean isKeyguardSecure(); 119 boolean inKeyguardRestrictedInputMode(); 120 void dismissKeyguard(); 121 122 void closeSystemDialogs(String reason); 123 124 // These can only be called with the SET_ANIMATON_SCALE permission. 125 float getAnimationScale(int which); 126 float[] getAnimationScales(); 127 void setAnimationScale(int which, float scale); 128 void setAnimationScales(in float[] scales); 129 130 // For testing 131 void setInTouchMode(boolean showFocus); 132 133 // For StrictMode flashing a red border on violations from the UI 134 // thread. The uid/pid is implicit from the Binder call, and the Window 135 // Manager uses that to determine whether or not the red border should 136 // actually be shown. (it will be ignored that pid doesn't have windows 137 // on screen) 138 void showStrictModeViolation(boolean on); 139 140 // Proxy to set the system property for whether the flashing 141 // should be enabled. The 'enabled' value is null or blank for 142 // the system default (differs per build variant) or any valid 143 // boolean string as parsed by SystemProperties.getBoolean(). 144 void setStrictModeVisualIndicatorPreference(String enabled); 145 146 // These can only be called with the SET_ORIENTATION permission. 147 /** 148 * Update the current screen rotation based on the current state of 149 * the world. 150 * @param alwaysSendConfiguration Flag to force a new configuration to 151 * be evaluated. This can be used when there are other parameters in 152 * configuration that are changing. 153 * @param forceRelayout If true, the window manager will always do a relayout 154 * of its windows even if the rotation hasn't changed. 155 */ 156 void updateRotation(boolean alwaysSendConfiguration, boolean forceRelayout); 157 158 /** 159 * Retrieve the current screen orientation, constants as per 160 * {@link android.view.Surface}. 161 */ 162 int getRotation(); 163 164 /** 165 * Watch the rotation of the screen. Returns the current rotation, 166 * calls back when it changes. 167 */ 168 int watchRotation(IRotationWatcher watcher); 169 170 /** 171 * Determine the preferred edge of the screen to pin the compact options menu against. 172 * @return a Gravity value for the options menu panel 173 * @hide 174 */ 175 int getPreferredOptionsPanelGravity(); 176 177 /** 178 * Lock the device orientation to the specified rotation, or to the 179 * current rotation if -1. Sensor input will be ignored until 180 * thawRotation() is called. 181 * @hide 182 */ 183 void freezeRotation(int rotation); 184 185 /** 186 * Release the orientation lock imposed by freezeRotation(). 187 * @hide 188 */ 189 void thawRotation(); 190 191 /** 192 * Create a screenshot of the applications currently displayed. 193 */ 194 Bitmap screenshotApplications(IBinder appToken, int displayId, int maxWidth, int maxHeight); 195 196 /** 197 * Called by the status bar to notify Views of changes to System UI visiblity. 198 */ 199 void statusBarVisibilityChanged(int visibility); 200 201 /** 202 * Block until the given window has been drawn to the screen. 203 */ 204 void waitForWindowDrawn(IBinder token, in IRemoteCallback callback); 205 206 /** 207 * Device has a software navigation bar (separate from the status bar). 208 */ 209 boolean hasNavigationBar(); 210 211 /** 212 * Lock the device immediately. 213 */ 214 void lockNow(); 215 216 /** 217 * Gets the token for the focused window. 218 */ 219 IBinder getFocusedWindowToken(); 220 221 /** 222 * Gets the compatibility scale of e window given its token. 223 */ 224 float getWindowCompatibilityScale(IBinder windowToken); 225 226 /** 227 * Sets an input filter for manipulating the input event stream. 228 */ 229 void setInputFilter(in IInputFilter filter); 230 231 /** 232 * Sets the scale and offset for implementing accessibility magnification. 233 */ 234 void magnifyDisplay(int dipslayId, float scale, float offsetX, float offsetY); 235 236 /** 237 * Adds a listener for display content changes. 238 */ 239 void addDisplayContentChangeListener(int displayId, IDisplayContentChangeListener listener); 240 241 /** 242 * Removes a listener for display content changes. 243 */ 244 void removeDisplayContentChangeListener(int displayId, IDisplayContentChangeListener listener); 245 246 /** 247 * Gets the info for a window given its token. 248 */ 249 WindowInfo getWindowInfo(IBinder token); 250 251 /** 252 * Gets the infos for all visible windows. 253 */ 254 void getVisibleWindowsForDisplay(int displayId, out List<WindowInfo> outInfos); 255} 256