IWindowManager.aidl revision f013e1afd1e68af5e3b868c26a653bbfb39538f8
1/* //device/java/android/android/view/IWindowManager.aidl 2** 3** Copyright 2006, The Android Open Source Project 4** 5** Licensed under the Apache License, Version 2.0 (the "License"); 6** you may not use this file except in compliance with the License. 7** You may obtain a copy of the License at 8** 9** http://www.apache.org/licenses/LICENSE-2.0 10** 11** Unless required by applicable law or agreed to in writing, software 12** distributed under the License is distributed on an "AS IS" BASIS, 13** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14** See the License for the specific language governing permissions and 15** limitations under the License. 16*/ 17 18package android.view; 19 20import com.android.internal.view.IInputContext; 21import com.android.internal.view.IInputMethodClient; 22 23import android.content.res.Configuration; 24import android.view.IApplicationToken; 25import android.view.IOnKeyguardExitResult; 26import android.view.IRotationWatcher; 27import android.view.IWindowSession; 28import android.view.KeyEvent; 29import android.view.MotionEvent; 30 31/** 32 * System private interface to the window manager. 33 * 34 * {@hide} 35 */ 36interface IWindowManager 37{ 38 /** 39 * ===== NOTICE ===== 40 * The first three methods must remain the first three methods. Scripts 41 * and tools rely on their transaction number to work properly. 42 */ 43 // This is used for debugging 44 boolean startViewServer(int port); // Transaction #1 45 boolean stopViewServer(); // Transaction #2 46 boolean isViewServerRunning(); // Transaction #3 47 48 IWindowSession openSession(in IInputMethodClient client, 49 in IInputContext inputContext); 50 boolean inputMethodClientHasFocus(IInputMethodClient client); 51 52 // These can only be called when injecting events to your own window, 53 // or by holding the INJECT_EVENTS permission. 54 boolean injectKeyEvent(in KeyEvent ev, boolean sync); 55 boolean injectPointerEvent(in MotionEvent ev, boolean sync); 56 boolean injectTrackballEvent(in MotionEvent ev, boolean sync); 57 58 // These can only be called when holding the MANAGE_APP_TOKENS permission. 59 void pauseKeyDispatching(IBinder token); 60 void resumeKeyDispatching(IBinder token); 61 void setEventDispatching(boolean enabled); 62 void addAppToken(int addPos, IApplicationToken token, 63 int groupId, int requestedOrientation, boolean fullscreen); 64 void setAppGroupId(IBinder token, int groupId); 65 Configuration updateOrientationFromAppTokens(IBinder freezeThisOneIfNeeded); 66 void setAppOrientation(IApplicationToken token, int requestedOrientation); 67 int getAppOrientation(IApplicationToken token); 68 void setFocusedApp(IBinder token, boolean moveFocusNow); 69 void prepareAppTransition(int transit); 70 void executeAppTransition(); 71 void setAppStartingWindow(IBinder token, String pkg, int theme, 72 CharSequence nonLocalizedLabel, int labelRes, 73 int icon, IBinder transferFrom, boolean createIfNeeded); 74 void setAppWillBeHidden(IBinder token); 75 void setAppVisibility(IBinder token, boolean visible); 76 void startAppFreezingScreen(IBinder token, int configChanges); 77 void stopAppFreezingScreen(IBinder token, boolean force); 78 void removeAppToken(IBinder token); 79 void moveAppToken(int index, IBinder token); 80 void moveAppTokensToTop(in List<IBinder> tokens); 81 void moveAppTokensToBottom(in List<IBinder> tokens); 82 void addWindowToken(IBinder token, int type); 83 void removeWindowToken(IBinder token); 84 85 // these require DISABLE_KEYGUARD permission 86 void disableKeyguard(IBinder token, String tag); 87 void reenableKeyguard(IBinder token); 88 void exitKeyguardSecurely(IOnKeyguardExitResult callback); 89 boolean inKeyguardRestrictedInputMode(); 90 91 92 // These can only be called with the SET_ANIMATON_SCALE permission. 93 float getAnimationScale(int which); 94 float[] getAnimationScales(); 95 void setAnimationScale(int which, float scale); 96 void setAnimationScales(in float[] scales); 97 98 // These require the READ_INPUT_STATE permission. 99 int getSwitchState(int sw); 100 int getSwitchStateForDevice(int devid, int sw); 101 int getScancodeState(int sw); 102 int getScancodeStateForDevice(int devid, int sw); 103 int getKeycodeState(int sw); 104 int getKeycodeStateForDevice(int devid, int sw); 105 106 // For testing 107 void setInTouchMode(boolean showFocus); 108 109 // These can only be called with the SET_ORIENTATION permission. 110 /** 111 * Change the current screen rotation, constants as per 112 * {@link android.view.Surface}. 113 * @param rotation the intended rotation. 114 * @param alwaysSendConfiguration Flag to force a new configuration to 115 * be evaluated. This can be used when there are other parameters in 116 * configuration that are changing. 117 * {@link android.view.Surface}. 118 */ 119 void setRotation(int rotation, boolean alwaysSendConfiguration); 120 121 /** 122 * Retrieve the current screen orientation, constants as per 123 * {@link android.view.Surface}. 124 */ 125 int getRotation(); 126 127 /** 128 * Watch the rotation of the screen. Returns the current rotation, 129 * calls back when it changes. 130 */ 131 int watchRotation(IRotationWatcher watcher); 132} 133