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; |
| 29 | import android.view.MotionEvent; |
| 30 | |
| 31 | /** |
| 32 | * System private interface to the window manager. |
| 33 | * |
| 34 | * {@hide} |
| 35 | */ |
| 36 | interface 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); |
Dianne Hackborn | e4fbd62 | 2009-03-27 18:09:16 -0700 | [diff] [blame] | 62 | void addWindowToken(IBinder token, int type); |
| 63 | void removeWindowToken(IBinder token); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 64 | void addAppToken(int addPos, IApplicationToken token, |
| 65 | int groupId, int requestedOrientation, boolean fullscreen); |
| 66 | void setAppGroupId(IBinder token, int groupId); |
The Android Open Source Project | 1059253 | 2009-03-18 17:39:46 -0700 | [diff] [blame] | 67 | Configuration updateOrientationFromAppTokens(in Configuration currentConfig, |
| 68 | IBinder freezeThisOneIfNeeded); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 69 | void setAppOrientation(IApplicationToken token, int requestedOrientation); |
| 70 | int getAppOrientation(IApplicationToken token); |
| 71 | void setFocusedApp(IBinder token, boolean moveFocusNow); |
| 72 | void prepareAppTransition(int transit); |
| 73 | int getPendingAppTransition(); |
Dianne Hackborn | 3b3e145 | 2009-09-24 19:22:12 -0700 | [diff] [blame] | 74 | void overridePendingAppTransition(String packageName, int enterAnim, int exitAnim); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 75 | void executeAppTransition(); |
| 76 | void setAppStartingWindow(IBinder token, String pkg, int theme, |
| 77 | CharSequence nonLocalizedLabel, int labelRes, |
| 78 | int icon, IBinder transferFrom, boolean createIfNeeded); |
| 79 | void setAppWillBeHidden(IBinder token); |
| 80 | void setAppVisibility(IBinder token, boolean visible); |
| 81 | void startAppFreezingScreen(IBinder token, int configChanges); |
| 82 | void stopAppFreezingScreen(IBinder token, boolean force); |
| 83 | void removeAppToken(IBinder token); |
| 84 | void moveAppToken(int index, IBinder token); |
| 85 | void moveAppTokensToTop(in List<IBinder> tokens); |
| 86 | void moveAppTokensToBottom(in List<IBinder> tokens); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 87 | |
| 88 | // these require DISABLE_KEYGUARD permission |
| 89 | void disableKeyguard(IBinder token, String tag); |
| 90 | void reenableKeyguard(IBinder token); |
| 91 | void exitKeyguardSecurely(IOnKeyguardExitResult callback); |
| 92 | boolean inKeyguardRestrictedInputMode(); |
| 93 | |
Dianne Hackborn | ffa4248 | 2009-09-23 22:20:11 -0700 | [diff] [blame] | 94 | void closeSystemDialogs(String reason); |
| 95 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 96 | // These can only be called with the SET_ANIMATON_SCALE permission. |
| 97 | float getAnimationScale(int which); |
| 98 | float[] getAnimationScales(); |
| 99 | void setAnimationScale(int which, float scale); |
| 100 | void setAnimationScales(in float[] scales); |
| 101 | |
| 102 | // These require the READ_INPUT_STATE permission. |
| 103 | int getSwitchState(int sw); |
| 104 | int getSwitchStateForDevice(int devid, int sw); |
| 105 | int getScancodeState(int sw); |
| 106 | int getScancodeStateForDevice(int devid, int sw); |
Dianne Hackborn | 1d62ea9 | 2009-11-17 12:49:50 -0800 | [diff] [blame] | 107 | int getTrackballScancodeState(int sw); |
| 108 | int getDPadScancodeState(int sw); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 109 | int getKeycodeState(int sw); |
| 110 | int getKeycodeStateForDevice(int devid, int sw); |
Dianne Hackborn | 1d62ea9 | 2009-11-17 12:49:50 -0800 | [diff] [blame] | 111 | int getTrackballKeycodeState(int sw); |
| 112 | int getDPadKeycodeState(int sw); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 113 | |
| 114 | // Report whether the hardware supports the given keys; returns true if successful |
| 115 | boolean hasKeys(in int[] keycodes, inout boolean[] keyExists); |
| 116 | |
| 117 | // For testing |
| 118 | void setInTouchMode(boolean showFocus); |
| 119 | |
| 120 | // These can only be called with the SET_ORIENTATION permission. |
| 121 | /** |
| 122 | * Change the current screen rotation, constants as per |
| 123 | * {@link android.view.Surface}. |
| 124 | * @param rotation the intended rotation. |
| 125 | * @param alwaysSendConfiguration Flag to force a new configuration to |
| 126 | * be evaluated. This can be used when there are other parameters in |
| 127 | * configuration that are changing. |
Dianne Hackborn | e4fbd62 | 2009-03-27 18:09:16 -0700 | [diff] [blame] | 128 | * @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] | 129 | */ |
Dianne Hackborn | e4fbd62 | 2009-03-27 18:09:16 -0700 | [diff] [blame] | 130 | void setRotation(int rotation, boolean alwaysSendConfiguration, int animFlags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 131 | |
| 132 | /** |
| 133 | * Retrieve the current screen orientation, constants as per |
| 134 | * {@link android.view.Surface}. |
| 135 | */ |
| 136 | int getRotation(); |
| 137 | |
| 138 | /** |
| 139 | * Watch the rotation of the screen. Returns the current rotation, |
| 140 | * calls back when it changes. |
| 141 | */ |
| 142 | int watchRotation(IRotationWatcher watcher); |
| 143 | } |