Fields Summary |
---|
public static final int | FLAG_WAKE |
public static final int | FLAG_WAKE_DROPPED |
public static final int | FLAG_SHIFT |
public static final int | FLAG_CAPS_LOCK |
public static final int | FLAG_ALT |
public static final int | FLAG_ALT_GR |
public static final int | FLAG_MENU |
public static final int | FLAG_LAUNCHER |
public static final int | FLAG_WOKE_HERE |
public static final int | FLAG_BRIGHT_HERE |
public static final boolean | WATCH_POINTER |
public static final int | ACTION_PASS_TO_USERPass this event to the user / app. To be returned from {@link #interceptKeyTq}. |
public static final int | ACTION_POKE_USER_ACTIVITYThis key event should extend the user activity timeout and turn the lights on.
To be returned from {@link #interceptKeyTq}. Do not return this and
{@link #ACTION_GO_TO_SLEEP} or {@link #ACTION_PASS_TO_USER}. |
public static final int | ACTION_GO_TO_SLEEPThis key event should put the device to sleep (and engage keyguard if necessary)
To be returned from {@link #interceptKeyTq}. Do not return this and
{@link #ACTION_POKE_USER_ACTIVITY} or {@link #ACTION_PASS_TO_USER}. |
public final int | TRANSIT_NONENo transition happening. |
public final int | TRANSIT_ENTERWindow has been added to the screen. |
public final int | TRANSIT_EXITWindow has been removed from the screen. |
public final int | TRANSIT_SHOWWindow has been made visible. |
public final int | TRANSIT_HIDEWindow has been made invisible. |
public final int | TRANSIT_PREVIEW_DONEThe "application starting" preview window is no longer needed, and will
animate away to show the real window. |
public final int | TRANSIT_ACTIVITY_OPENA window in a new activity is being opened on top of an existing one
in the same task. |
public final int | TRANSIT_ACTIVITY_CLOSEThe window in the top-most activity is being closed to reveal the
previous activity in the same task. |
public final int | TRANSIT_TASK_OPENA window in a new task is being opened on top of an existing one
in another activity's task. |
public final int | TRANSIT_TASK_CLOSEA window in the top-most activity is being closed to reveal the
previous activity in a different task. |
public final int | TRANSIT_TASK_TO_FRONTA window in an existing task is being displayed on top of an existing one
in another activity's task. |
public final int | TRANSIT_TASK_TO_BACKA window in an existing task is being put below all other tasks. |
public final int | OFF_BECAUSE_OF_USERScreen turned off because of power button |
public final int | OFF_BECAUSE_OF_TIMEOUTScreen turned off because of timeout |
public final int | USE_LAST_ROTATIONMagic constant to {@link IWindowManager#setRotation} to not actually
modify the rotation. |
Methods Summary |
---|
public View | addStartingWindow(android.os.IBinder appToken, java.lang.String packageName, int theme, java.lang.CharSequence nonLocalizedLabel, int labelRes, int icon)Called when the system would like to show a UI to indicate that an
application is starting. You can use this to add a
APPLICATION_STARTING_TYPE window with the given appToken to the window
manager (using the normal window manager APIs) that will be shown until
the application displays its own window. This is called without the
window manager locked so that you can call back into it.
|
public void | adjustConfigurationLw(android.content.res.Configuration config)After the window manager has computed the current configuration based
on its knowledge of the display and input devices, it gives the policy
a chance to adjust the information contained in it. If you want to
leave it as-is, simply do nothing.
This method may be called by any thread in the window manager, but
no internal locks in the window manager will be held.
|
public void | adjustWindowParamsLw(WindowManager.LayoutParams attrs)Sanitize the layout parameters coming from a client. Allows the policy
to do things like ensure that windows of a specific type can't take
input focus.
|
public void | animatingWindowLw(android.view.WindowManagerPolicy$WindowState win, WindowManager.LayoutParams attrs)Called each time a window is animating.
|
public void | beginAnimationLw(int displayWidth, int displayHeight)Called when animation of the windows is about to start.
|
public void | beginLayoutLw(int displayWidth, int displayHeight)Called when layout of the windows is about to start.
|
public int | checkAddPermission(WindowManager.LayoutParams attrs)Check permissions when adding a window.
|
public boolean | detectSafeMode()Called when the system is mostly done booting to dentermine whether
the system should go into safe mode.
|
public void | enableKeyguard(boolean enabled)Tell the policy if anyone is requesting that keyguard not come on.
|
public void | enableScreenAfterBoot()Called when we have finished booting and can now display the home
screen to the user. This wilWl happen after systemReady(), and at
this point the display is active.
|
public void | exitKeyguardSecurely(android.view.WindowManagerPolicy$OnKeyguardExitResult callback)Tell the policy if anyone is requesting the keyguard to exit securely
(this would be called after the keyguard was disabled)
|
public boolean | finishAnimationLw()Called when animation of the windows is finished. If in this function you do
something that may have modified the animation state of another window,
be sure to return true in order to perform another animation frame.
|
public boolean | finishLayoutLw()Called when layout of the windows is finished. After this function has
returned, all windows given to layoutWindow() must have had a
frame assigned.
|
public void | getContentInsetHintLw(WindowManager.LayoutParams attrs, android.graphics.Rect contentInset)Return the insets for the areas covered by system windows. These values
are computed on the most recent layout, so they are not guaranteed to
be correct.
|
public boolean | inKeyguardRestrictedKeyInputMode()inKeyguardRestrictedKeyInputMode
if keyguard screen is showing or in restricted key input mode (i.e. in
keyguard password emergency screen). When in such mode, certain keys,
such as the Home key and the right soft keys, don't work.
|
public void | init(android.content.Context context, IWindowManager windowManager, android.os.LocalPowerManager powerManager)Perform initialization of the policy.
|
public boolean | interceptKeyTi(android.view.WindowManagerPolicy$WindowState win, int code, int metaKeys, boolean down, int repeatCount)Called from the input thread before a key is dispatched to a window.
Allows you to define
behavior for keys that can not be overridden by applications or redirect
key events to a different window. This method is called from the
input thread, with no locks held.
Note that if you change the window a key is dispatched to, the new
target window will receive the key event without having input focus.
|
public int | interceptKeyTq(RawInputEvent event, boolean screenIsOn)Called from the key queue thread before a key is dispatched to the
input thread.
There are some actions that need to be handled here because they
affect the power state of the device, for example, the power keys.
Generally, it's best to keep as little as possible in the queue thread
because it's the most fragile.
|
public boolean | isAppSwitchKeyTqTiLwLi(int keycode)Determine whether a given key code is used to cause an app switch
to occur (most often the HOME key, also often ENDCALL). If you return
true, then the system will go into a special key processing state
where it drops any pending events that it cans and adjusts timeouts to
try to get to this key as quickly as possible.
Note that this function is called from the low-level input queue
thread, with either/or the window or input lock held; be very careful
about what you do here. You absolutely should never acquire a lock
that you would ever hold elsewhere while calling out into the window
manager or view hierarchy.
|
public boolean | isCheekPressedAgainstScreen(MotionEvent ev)Returns true if the user's cheek has been pressed against the phone. This is
determined by comparing the event's size attribute with a threshold value.
For example for a motion event like down or up or move, if the size exceeds
the threshold, it is considered as cheek press.
|
public boolean | isMovementKeyTi(int keycode)Determine whether a given key code is used for movement within a UI,
and does not generally cause actions to be performed (normally the DPAD
movement keys, NOT the DPAD center press key). This is called
when {@link #isAppSwitchKeyTiLi} returns true to remove any pending events
in the key queue that are not needed to switch applications.
Note that this function is called from the low-level input queue
thread; be very careful about what you do here.
|
public boolean | isWakeAbsMovementTq(int device, int classes, RawInputEvent event)Given the current state of the world, should this absolute movement
wake up the device?
|
public boolean | isWakeRelMovementTq(int device, int classes, RawInputEvent event)Given the current state of the world, should this relative movement
wake up the device?
|
public boolean | keyguardIsShowingTq()Return if keyguard is currently showing.
|
public void | layoutWindowLw(android.view.WindowManagerPolicy$WindowState win, WindowManager.LayoutParams attrs, android.view.WindowManagerPolicy$WindowState attached)Called for each window attached to the window manager as layout is
proceeding. The implementation of this function must take care of
setting the window's frame, either here or in finishLayout().
|
public boolean | performHapticFeedbackLw(android.view.WindowManagerPolicy$WindowState win, int effectId, boolean always)Call from application to perform haptic feedback on its window.
|
public int | prepareAddWindowLw(android.view.WindowManagerPolicy$WindowState win, WindowManager.LayoutParams attrs)Prepare for a window being added to the window manager. You can throw an
exception here to prevent the window being added, or do whatever setup
you need to keep track of the window.
|
public boolean | preprocessInputEventTq(RawInputEvent event)Perform any initial processing of a low-level input event before the
window manager handles special keys and generates a high-level event
that is dispatched to the application.
|
public void | removeStartingWindow(android.os.IBinder appToken, View window)Called when the first window of an application has been displayed, while
{@link #addStartingWindow} has created a temporary initial window for
that application. You should at this point remove the window from the
window manager. This is called without the window manager locked so
that you can call back into it.
Note: due to the nature of these functions not being called with the
window manager locked, you must be prepared for this function to be
called multiple times and/or an initial time with a null View window
even if you previously returned one.
|
public void | removeWindowLw(android.view.WindowManagerPolicy$WindowState win)Called when a window is being removed from a window manager. Must not
throw an exception -- clean up as much as possible.
|
public int | rotationForOrientationLw(int orientation, int lastRotation, boolean displayEnabled)Given an orientation constant
({@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_LANDSCAPE
ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE} or
{@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_PORTRAIT
ActivityInfo.SCREEN_ORIENTATION_PORTRAIT}), return a surface
rotation.
|
public void | screenOnStoppedLw()Called when we have stopped keeping the screen on because a window
requesting this is no longer visible.
|
public void | screenTurnedOff(int why)Called after the screen turns off.
|
public void | screenTurnedOn()Called after the screen turns on.
|
public int | selectAnimationLw(android.view.WindowManagerPolicy$WindowState win, int transit)Control the animation to run when a window's state changes. Return a
non-0 number to force the animation to a specific resource ID, or 0
to use the default animation.
|
public void | setCurrentOrientationLw(int newOrientation)
|
public int | subWindowTypeToLayerLw(int type)Return how to Z-order sub-windows in relation to the window they are
attached to. Return positive to have them ordered in front, negative for
behind.
|
public void | systemReady()Called when the system is mostly done booting.
|
public int | windowTypeToLayerLw(int type)Assign a window type to a layer. Allows you to control how different
kinds of windows are ordered on-screen.
|