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