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 startViewServer(int port)44 boolean startViewServer(int port); // Transaction #1 stopViewServer()45 boolean stopViewServer(); // Transaction #2 isViewServerRunning()46 boolean isViewServerRunning(); // Transaction #3 47 openSession(in IInputMethodClient client, in IInputContext inputContext)48 IWindowSession openSession(in IInputMethodClient client, 49 in IInputContext inputContext); inputMethodClientHasFocus(IInputMethodClient client)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. injectKeyEvent(in KeyEvent ev, boolean sync)54 boolean injectKeyEvent(in KeyEvent ev, boolean sync); injectPointerEvent(in MotionEvent ev, boolean sync)55 boolean injectPointerEvent(in MotionEvent ev, boolean sync); injectTrackballEvent(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. pauseKeyDispatching(IBinder token)59 void pauseKeyDispatching(IBinder token); resumeKeyDispatching(IBinder token)60 void resumeKeyDispatching(IBinder token); setEventDispatching(boolean enabled)61 void setEventDispatching(boolean enabled); addWindowToken(IBinder token, int type)62 void addWindowToken(IBinder token, int type); removeWindowToken(IBinder token)63 void removeWindowToken(IBinder token); addAppToken(int addPos, IApplicationToken token, int groupId, int requestedOrientation, boolean fullscreen)64 void addAppToken(int addPos, IApplicationToken token, 65 int groupId, int requestedOrientation, boolean fullscreen); setAppGroupId(IBinder token, int groupId)66 void setAppGroupId(IBinder token, int groupId); updateOrientationFromAppTokens(in Configuration currentConfig, IBinder freezeThisOneIfNeeded)67 Configuration updateOrientationFromAppTokens(in Configuration currentConfig, 68 IBinder freezeThisOneIfNeeded); setAppOrientation(IApplicationToken token, int requestedOrientation)69 void setAppOrientation(IApplicationToken token, int requestedOrientation); getAppOrientation(IApplicationToken token)70 int getAppOrientation(IApplicationToken token); setFocusedApp(IBinder token, boolean moveFocusNow)71 void setFocusedApp(IBinder token, boolean moveFocusNow); prepareAppTransition(int transit)72 void prepareAppTransition(int transit); getPendingAppTransition()73 int getPendingAppTransition(); overridePendingAppTransition(String packageName, int enterAnim, int exitAnim)74 void overridePendingAppTransition(String packageName, int enterAnim, int exitAnim); executeAppTransition()75 void executeAppTransition(); setAppStartingWindow(IBinder token, String pkg, int theme, CharSequence nonLocalizedLabel, int labelRes, int icon, IBinder transferFrom, boolean createIfNeeded)76 void setAppStartingWindow(IBinder token, String pkg, int theme, 77 CharSequence nonLocalizedLabel, int labelRes, 78 int icon, IBinder transferFrom, boolean createIfNeeded); setAppWillBeHidden(IBinder token)79 void setAppWillBeHidden(IBinder token); setAppVisibility(IBinder token, boolean visible)80 void setAppVisibility(IBinder token, boolean visible); startAppFreezingScreen(IBinder token, int configChanges)81 void startAppFreezingScreen(IBinder token, int configChanges); stopAppFreezingScreen(IBinder token, boolean force)82 void stopAppFreezingScreen(IBinder token, boolean force); removeAppToken(IBinder token)83 void removeAppToken(IBinder token); moveAppToken(int index, IBinder token)84 void moveAppToken(int index, IBinder token); moveAppTokensToTop(in List<IBinder> tokens)85 void moveAppTokensToTop(in List<IBinder> tokens); moveAppTokensToBottom(in List<IBinder> tokens)86 void moveAppTokensToBottom(in List<IBinder> tokens); 87 88 // these require DISABLE_KEYGUARD permission disableKeyguard(IBinder token, String tag)89 void disableKeyguard(IBinder token, String tag); reenableKeyguard(IBinder token)90 void reenableKeyguard(IBinder token); exitKeyguardSecurely(IOnKeyguardExitResult callback)91 void exitKeyguardSecurely(IOnKeyguardExitResult callback); inKeyguardRestrictedInputMode()92 boolean inKeyguardRestrictedInputMode(); 93 closeSystemDialogs(String reason)94 void closeSystemDialogs(String reason); 95 96 // These can only be called with the SET_ANIMATON_SCALE permission. getAnimationScale(int which)97 float getAnimationScale(int which); getAnimationScales()98 float[] getAnimationScales(); setAnimationScale(int which, float scale)99 void setAnimationScale(int which, float scale); setAnimationScales(in float[] scales)100 void setAnimationScales(in float[] scales); 101 102 // These require the READ_INPUT_STATE permission. getSwitchState(int sw)103 int getSwitchState(int sw); getSwitchStateForDevice(int devid, int sw)104 int getSwitchStateForDevice(int devid, int sw); getScancodeState(int sw)105 int getScancodeState(int sw); getScancodeStateForDevice(int devid, int sw)106 int getScancodeStateForDevice(int devid, int sw); getKeycodeState(int sw)107 int getKeycodeState(int sw); getKeycodeStateForDevice(int devid, int sw)108 int getKeycodeStateForDevice(int devid, int sw); 109 110 // Report whether the hardware supports the given keys; returns true if successful hasKeys(in int[] keycodes, inout boolean[] keyExists)111 boolean hasKeys(in int[] keycodes, inout boolean[] keyExists); 112 113 // For testing setInTouchMode(boolean showFocus)114 void setInTouchMode(boolean showFocus); 115 116 // These can only be called with the SET_ORIENTATION permission. 117 /** 118 * Change the current screen rotation, constants as per 119 * {@link android.view.Surface}. 120 * @param rotation the intended rotation. 121 * @param alwaysSendConfiguration Flag to force a new configuration to 122 * be evaluated. This can be used when there are other parameters in 123 * configuration that are changing. 124 * @param animFlags Animation flags as per {@link android.view.Surface}. 125 */ setRotation(int rotation, boolean alwaysSendConfiguration, int animFlags)126 void setRotation(int rotation, boolean alwaysSendConfiguration, int animFlags); 127 128 /** 129 * Retrieve the current screen orientation, constants as per 130 * {@link android.view.Surface}. 131 */ getRotation()132 int getRotation(); 133 134 /** 135 * Watch the rotation of the screen. Returns the current rotation, 136 * calls back when it changes. 137 */ watchRotation(IRotationWatcher watcher)138 int watchRotation(IRotationWatcher watcher); 139 } 140