IWindowManager.aidl revision 81e56d535c853d73ff537357da5b935f51cb779d
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.Configuration; 23import android.graphics.Bitmap; 24import android.graphics.Point; 25import android.view.IApplicationToken; 26import android.view.IOnKeyguardExitResult; 27import android.view.IRotationWatcher; 28import android.view.IWindowSession; 29import android.view.KeyEvent; 30import android.view.InputEvent; 31import android.view.MotionEvent; 32import android.view.InputChannel; 33import android.view.InputDevice; 34 35/** 36 * System private interface to the window manager. 37 * 38 * {@hide} 39 */ 40interface IWindowManager 41{ 42 /** 43 * ===== NOTICE ===== 44 * The first three methods must remain the first three methods. Scripts 45 * and tools rely on their transaction number to work properly. 46 */ 47 // This is used for debugging 48 boolean startViewServer(int port); // Transaction #1 49 boolean stopViewServer(); // Transaction #2 50 boolean isViewServerRunning(); // Transaction #3 51 52 IWindowSession openSession(in IInputMethodClient client, 53 in IInputContext inputContext); 54 boolean inputMethodClientHasFocus(IInputMethodClient client); 55 56 void getDisplaySize(out Point size); 57 int getMaximumSizeDimension(); 58 59 void setForcedDisplaySize(int longDimen, int shortDimen); 60 void clearForcedDisplaySize(); 61 62 // Is device configured with a hideable status bar or a tablet system bar? 63 boolean canStatusBarHide(); 64 65 // These can only be called when injecting events to your own window, 66 // or by holding the INJECT_EVENTS permission. These methods may block 67 // until pending input events are finished being dispatched even when 'sync' is false. 68 // Avoid calling these methods on your UI thread or use the 'NoWait' version instead. 69 boolean injectKeyEvent(in KeyEvent ev, boolean sync); 70 boolean injectPointerEvent(in MotionEvent ev, boolean sync); 71 boolean injectTrackballEvent(in MotionEvent ev, boolean sync); 72 boolean injectInputEventNoWait(in InputEvent ev); 73 74 // These can only be called when holding the MANAGE_APP_TOKENS permission. 75 void pauseKeyDispatching(IBinder token); 76 void resumeKeyDispatching(IBinder token); 77 void setEventDispatching(boolean enabled); 78 void addWindowToken(IBinder token, int type); 79 void removeWindowToken(IBinder token); 80 void addAppToken(int addPos, IApplicationToken token, 81 int groupId, int requestedOrientation, boolean fullscreen); 82 void setAppGroupId(IBinder token, int groupId); 83 void setAppOrientation(IApplicationToken token, int requestedOrientation); 84 int getAppOrientation(IApplicationToken token); 85 void setFocusedApp(IBinder token, boolean moveFocusNow); 86 void prepareAppTransition(int transit, boolean alwaysKeepCurrent); 87 int getPendingAppTransition(); 88 void overridePendingAppTransition(String packageName, int enterAnim, int exitAnim); 89 void executeAppTransition(); 90 void setAppStartingWindow(IBinder token, String pkg, int theme, 91 CharSequence nonLocalizedLabel, int labelRes, 92 int icon, int windowFlags, IBinder transferFrom, boolean createIfNeeded); 93 void setAppWillBeHidden(IBinder token); 94 void setAppVisibility(IBinder token, boolean visible); 95 void startAppFreezingScreen(IBinder token, int configChanges); 96 void stopAppFreezingScreen(IBinder token, boolean force); 97 void removeAppToken(IBinder token); 98 void moveAppToken(int index, IBinder token); 99 void moveAppTokensToTop(in List<IBinder> tokens); 100 void moveAppTokensToBottom(in List<IBinder> tokens); 101 102 // Re-evaluate the current orientation from the caller's state. 103 // If there is a change, the new Configuration is returned and the 104 // caller must call setNewConfiguration() sometime later. 105 Configuration updateOrientationFromAppTokens(in Configuration currentConfig, 106 IBinder freezeThisOneIfNeeded); 107 void setNewConfiguration(in Configuration config); 108 109 // these require DISABLE_KEYGUARD permission 110 void disableKeyguard(IBinder token, String tag); 111 void reenableKeyguard(IBinder token); 112 void exitKeyguardSecurely(IOnKeyguardExitResult callback); 113 boolean isKeyguardLocked(); 114 boolean isKeyguardSecure(); 115 boolean inKeyguardRestrictedInputMode(); 116 117 void closeSystemDialogs(String reason); 118 119 // These can only be called with the SET_ANIMATON_SCALE permission. 120 float getAnimationScale(int which); 121 float[] getAnimationScales(); 122 void setAnimationScale(int which, float scale); 123 void setAnimationScales(in float[] scales); 124 125 // These require the READ_INPUT_STATE permission. 126 int getSwitchState(int sw); 127 int getSwitchStateForDevice(int devid, int sw); 128 int getScancodeState(int sw); 129 int getScancodeStateForDevice(int devid, int sw); 130 int getTrackballScancodeState(int sw); 131 int getDPadScancodeState(int sw); 132 int getKeycodeState(int sw); 133 int getKeycodeStateForDevice(int devid, int sw); 134 int getTrackballKeycodeState(int sw); 135 int getDPadKeycodeState(int sw); 136 InputChannel monitorInput(String inputChannelName); 137 138 // Report whether the hardware supports the given keys; returns true if successful 139 boolean hasKeys(in int[] keycodes, inout boolean[] keyExists); 140 141 // Get input device information. 142 InputDevice getInputDevice(int deviceId); 143 int[] getInputDeviceIds(); 144 145 // For testing 146 void setInTouchMode(boolean showFocus); 147 148 // For StrictMode flashing a red border on violations from the UI 149 // thread. The uid/pid is implicit from the Binder call, and the Window 150 // Manager uses that to determine whether or not the red border should 151 // actually be shown. (it will be ignored that pid doesn't have windows 152 // on screen) 153 void showStrictModeViolation(boolean on); 154 155 // Proxy to set the system property for whether the flashing 156 // should be enabled. The 'enabled' value is null or blank for 157 // the system default (differs per build variant) or any valid 158 // boolean string as parsed by SystemProperties.getBoolean(). 159 void setStrictModeVisualIndicatorPreference(String enabled); 160 161 // These can only be called with the SET_ORIENTATION permission. 162 /** 163 * Change the current screen rotation, constants as per 164 * {@link android.view.Surface}. 165 * @param rotation the intended rotation. 166 * @param alwaysSendConfiguration Flag to force a new configuration to 167 * be evaluated. This can be used when there are other parameters in 168 * configuration that are changing. 169 * @param animFlags Animation flags as per {@link android.view.Surface}. 170 */ 171 void setRotation(int rotation, boolean alwaysSendConfiguration, int animFlags); 172 173 /** 174 * Retrieve the current screen orientation, constants as per 175 * {@link android.view.Surface}. 176 */ 177 int getRotation(); 178 179 /** 180 * Watch the rotation of the screen. Returns the current rotation, 181 * calls back when it changes. 182 */ 183 int watchRotation(IRotationWatcher watcher); 184 185 /** 186 * Lock the device orientation to the current rotation. Sensor input will 187 * be ignored until thawRotation() is called. 188 * @hide 189 */ 190 void freezeRotation(); 191 192 /** 193 * Release the orientation lock imposed by freezeRotation(). 194 * @hide 195 */ 196 void thawRotation(); 197 198 /** 199 * Create a screenshot of the applications currently displayed. 200 */ 201 Bitmap screenshotApplications(IBinder appToken, int maxWidth, int maxHeight); 202 203 /** 204 * Called by the status bar to notify Views of changes to System UI visiblity. 205 */ 206 void statusBarVisibilityChanged(int visibility); 207} 208