The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 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 | |
| 18 | package android.view; |
| 19 | |
| 20 | import com.android.internal.view.IInputContext; |
| 21 | import com.android.internal.view.IInputMethodClient; |
| 22 | |
| 23 | import android.content.res.Configuration; |
| 24 | import android.view.IApplicationToken; |
| 25 | import android.view.IOnKeyguardExitResult; |
| 26 | import android.view.IRotationWatcher; |
| 27 | import android.view.IWindowSession; |
| 28 | import android.view.KeyEvent; |
Jeff Brown | 6ec402b | 2010-07-28 15:48:59 -0700 | [diff] [blame] | 29 | import android.view.InputEvent; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 30 | import android.view.MotionEvent; |
Jeff Brown | a41ca77 | 2010-08-11 14:46:32 -0700 | [diff] [blame^] | 31 | import android.view.InputChannel; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 32 | |
| 33 | /** |
| 34 | * System private interface to the window manager. |
| 35 | * |
| 36 | * {@hide} |
| 37 | */ |
| 38 | interface IWindowManager |
| 39 | { |
| 40 | /** |
| 41 | * ===== NOTICE ===== |
| 42 | * The first three methods must remain the first three methods. Scripts |
| 43 | * and tools rely on their transaction number to work properly. |
| 44 | */ |
| 45 | // This is used for debugging |
| 46 | boolean startViewServer(int port); // Transaction #1 |
| 47 | boolean stopViewServer(); // Transaction #2 |
| 48 | boolean isViewServerRunning(); // Transaction #3 |
| 49 | |
| 50 | IWindowSession openSession(in IInputMethodClient client, |
| 51 | in IInputContext inputContext); |
| 52 | boolean inputMethodClientHasFocus(IInputMethodClient client); |
| 53 | |
| 54 | // These can only be called when injecting events to your own window, |
Jeff Brown | 6ec402b | 2010-07-28 15:48:59 -0700 | [diff] [blame] | 55 | // or by holding the INJECT_EVENTS permission. These methods may block |
| 56 | // until pending input events are finished being dispatched even when 'sync' is false. |
| 57 | // Avoid calling these methods on your UI thread or use the 'NoWait' version instead. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 58 | boolean injectKeyEvent(in KeyEvent ev, boolean sync); |
| 59 | boolean injectPointerEvent(in MotionEvent ev, boolean sync); |
| 60 | boolean injectTrackballEvent(in MotionEvent ev, boolean sync); |
Jeff Brown | 6ec402b | 2010-07-28 15:48:59 -0700 | [diff] [blame] | 61 | boolean injectInputEventNoWait(in InputEvent ev); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 62 | |
| 63 | // These can only be called when holding the MANAGE_APP_TOKENS permission. |
| 64 | void pauseKeyDispatching(IBinder token); |
| 65 | void resumeKeyDispatching(IBinder token); |
| 66 | void setEventDispatching(boolean enabled); |
Dianne Hackborn | e4fbd62 | 2009-03-27 18:09:16 -0700 | [diff] [blame] | 67 | void addWindowToken(IBinder token, int type); |
| 68 | void removeWindowToken(IBinder token); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 69 | void addAppToken(int addPos, IApplicationToken token, |
| 70 | int groupId, int requestedOrientation, boolean fullscreen); |
| 71 | void setAppGroupId(IBinder token, int groupId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 72 | void setAppOrientation(IApplicationToken token, int requestedOrientation); |
| 73 | int getAppOrientation(IApplicationToken token); |
| 74 | void setFocusedApp(IBinder token, boolean moveFocusNow); |
| 75 | void prepareAppTransition(int transit); |
| 76 | int getPendingAppTransition(); |
Dianne Hackborn | 3b3e145 | 2009-09-24 19:22:12 -0700 | [diff] [blame] | 77 | void overridePendingAppTransition(String packageName, int enterAnim, int exitAnim); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 78 | void executeAppTransition(); |
| 79 | void setAppStartingWindow(IBinder token, String pkg, int theme, |
| 80 | CharSequence nonLocalizedLabel, int labelRes, |
| 81 | int icon, IBinder transferFrom, boolean createIfNeeded); |
| 82 | void setAppWillBeHidden(IBinder token); |
| 83 | void setAppVisibility(IBinder token, boolean visible); |
| 84 | void startAppFreezingScreen(IBinder token, int configChanges); |
| 85 | void stopAppFreezingScreen(IBinder token, boolean force); |
| 86 | void removeAppToken(IBinder token); |
| 87 | void moveAppToken(int index, IBinder token); |
| 88 | void moveAppTokensToTop(in List<IBinder> tokens); |
| 89 | void moveAppTokensToBottom(in List<IBinder> tokens); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 90 | |
Dianne Hackborn | e36d6e2 | 2010-02-17 19:46:25 -0800 | [diff] [blame] | 91 | // Re-evaluate the current orientation from the caller's state. |
| 92 | // If there is a change, the new Configuration is returned and the |
| 93 | // caller must call setNewConfiguration() sometime later. |
| 94 | Configuration updateOrientationFromAppTokens(in Configuration currentConfig, |
| 95 | IBinder freezeThisOneIfNeeded); |
| 96 | void setNewConfiguration(in Configuration config); |
| 97 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 98 | // these require DISABLE_KEYGUARD permission |
| 99 | void disableKeyguard(IBinder token, String tag); |
| 100 | void reenableKeyguard(IBinder token); |
| 101 | void exitKeyguardSecurely(IOnKeyguardExitResult callback); |
| 102 | boolean inKeyguardRestrictedInputMode(); |
| 103 | |
Dianne Hackborn | ffa4248 | 2009-09-23 22:20:11 -0700 | [diff] [blame] | 104 | void closeSystemDialogs(String reason); |
| 105 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 106 | // These can only be called with the SET_ANIMATON_SCALE permission. |
| 107 | float getAnimationScale(int which); |
| 108 | float[] getAnimationScales(); |
| 109 | void setAnimationScale(int which, float scale); |
| 110 | void setAnimationScales(in float[] scales); |
| 111 | |
| 112 | // These require the READ_INPUT_STATE permission. |
| 113 | int getSwitchState(int sw); |
| 114 | int getSwitchStateForDevice(int devid, int sw); |
| 115 | int getScancodeState(int sw); |
| 116 | int getScancodeStateForDevice(int devid, int sw); |
Dianne Hackborn | 1d62ea9 | 2009-11-17 12:49:50 -0800 | [diff] [blame] | 117 | int getTrackballScancodeState(int sw); |
| 118 | int getDPadScancodeState(int sw); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 119 | int getKeycodeState(int sw); |
| 120 | int getKeycodeStateForDevice(int devid, int sw); |
Dianne Hackborn | 1d62ea9 | 2009-11-17 12:49:50 -0800 | [diff] [blame] | 121 | int getTrackballKeycodeState(int sw); |
| 122 | int getDPadKeycodeState(int sw); |
Jeff Brown | a41ca77 | 2010-08-11 14:46:32 -0700 | [diff] [blame^] | 123 | InputChannel monitorInput(String inputChannelName); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 124 | |
| 125 | // Report whether the hardware supports the given keys; returns true if successful |
| 126 | boolean hasKeys(in int[] keycodes, inout boolean[] keyExists); |
| 127 | |
| 128 | // For testing |
| 129 | void setInTouchMode(boolean showFocus); |
| 130 | |
| 131 | // These can only be called with the SET_ORIENTATION permission. |
| 132 | /** |
| 133 | * Change the current screen rotation, constants as per |
| 134 | * {@link android.view.Surface}. |
| 135 | * @param rotation the intended rotation. |
| 136 | * @param alwaysSendConfiguration Flag to force a new configuration to |
| 137 | * be evaluated. This can be used when there are other parameters in |
| 138 | * configuration that are changing. |
Dianne Hackborn | e4fbd62 | 2009-03-27 18:09:16 -0700 | [diff] [blame] | 139 | * @param animFlags Animation flags as per {@link android.view.Surface}. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 140 | */ |
Dianne Hackborn | e4fbd62 | 2009-03-27 18:09:16 -0700 | [diff] [blame] | 141 | void setRotation(int rotation, boolean alwaysSendConfiguration, int animFlags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 142 | |
| 143 | /** |
| 144 | * Retrieve the current screen orientation, constants as per |
| 145 | * {@link android.view.Surface}. |
| 146 | */ |
| 147 | int getRotation(); |
| 148 | |
| 149 | /** |
| 150 | * Watch the rotation of the screen. Returns the current rotation, |
| 151 | * calls back when it changes. |
| 152 | */ |
| 153 | int watchRotation(IRotationWatcher watcher); |
| 154 | } |