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