Methods Summary |
---|
public View | addStartingWindow(android.os.IBinder appToken, java.lang.String packageName, int theme, android.content.res.CompatibilityInfo compatInfo, java.lang.CharSequence nonLocalizedLabel, int labelRes, int icon, int logo, int windowFlags)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, int keyboardPresence, int navigationPresence)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 int | adjustSystemUiVisibilityLw(int visibility)Called when a new system UI visibility is being reported, allowing
the policy to adjust what is actually reported.
|
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 boolean | allowAppAnimationsLw()Return true if it is okay to perform animations for an app transition
that is about to occur. You may return false for this if, for example,
the lock screen is currently displayed so the switch should happen
immediately.
|
public void | applyPostLayoutPolicyLw(android.view.WindowManagerPolicy$WindowState win, WindowManager.LayoutParams attrs, android.view.WindowManagerPolicy$WindowState attached)Called following layout of all window to apply policy to each window.
|
public void | beginLayoutLw(boolean isDefaultDisplay, int displayWidth, int displayHeight, int displayRotation)Called when layout of the windows is about to start.
|
public void | beginPostLayoutPolicyLw(int displayWidth, int displayHeight)Called following layout of all windows before each window has policy applied.
|
public boolean | canBeForceHidden(android.view.WindowManagerPolicy$WindowState win, WindowManager.LayoutParams attrs)Determine if a window that is behind one that is force hiding
(as determined by {@link #isForceHiding}) should actually be hidden.
For example, typically returns false for the status bar. Be careful
to return false for any window that you may hide yourself, since this
will conflict with what you set.
|
public boolean | canMagnifyWindow(int windowType)Returns whether a given window type can be magnified.
|
public int | checkAddPermission(WindowManager.LayoutParams attrs, int[] outAppOp)Check permissions when adding a window.
|
public boolean | checkShowToOwnerOnly(WindowManager.LayoutParams attrs)Check permissions when adding a window.
|
public android.view.animation.Animation | createForceHideEnterAnimation(boolean onWallpaper, boolean goingToNotificationShade)Create and return an animation to re-display a force hidden window.
|
public android.view.animation.Animation | createForceHideWallpaperExitAnimation(boolean goingToNotificationShade)Create and return an animation to let the wallpaper disappear after being shown on a force
hiding window.
|
public void | dismissKeyguardLw()Ask the policy to dismiss the keyguard, if it is currently shown.
|
public KeyEvent | dispatchUnhandledKey(android.view.WindowManagerPolicy$WindowState win, KeyEvent event, int policyFlags)Called from the input dispatcher thread when an application did not handle
a key that was dispatched to it.
Allows you to define default global behavior for keys that were not handled
by applications. This method is called from the input thread, with no locks held.
|
public void | dump(java.lang.String prefix, java.io.PrintWriter writer, java.lang.String[] args)Print the WindowManagerPolicy's state into the given stream.
|
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 will 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 void | 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 int | finishPostLayoutPolicyLw()Called following layout of all windows and after policy has been applied
to each window. If in this function you do
something that may have modified the animation state of another window,
be sure to return non-zero in order to perform another pass through layout.
|
public int | focusChangedLw(android.view.WindowManagerPolicy$WindowState lastFocus, android.view.WindowManagerPolicy$WindowState newFocus)A new window has been focused.
|
public int | getAboveUniverseLayer()Return the window layer at which windows appear above the normal
universe (that is no longer impacted by the universe background
transform).
|
public int | getConfigDisplayHeight(int fullWidth, int fullHeight, int rotation)Return the available screen height that we should report for the
configuration. This must be no larger than
{@link #getNonDecorDisplayHeight(int, int, int)}; it may be smaller than
that to account for more transient decoration like a status bar.
|
public int | getConfigDisplayWidth(int fullWidth, int fullHeight, int rotation)Return the available screen width that we should report for the
configuration. This must be no larger than
{@link #getNonDecorDisplayWidth(int, int, int)}; it may be smaller than
that to account for more transient decoration like a status bar.
|
public void | getContentRectLw(android.graphics.Rect r)Return the rectangle of the screen that is available for applications to run in.
This will be called immediately after {@link #beginLayoutLw}.
|
public int | getInputMethodWindowVisibleHeightLw()
|
public void | getInsetHintLw(WindowManager.LayoutParams attrs, android.graphics.Rect outContentInsets, android.graphics.Rect outStableInsets)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 int | getMaxWallpaperLayer()Get the highest layer (actually one more than) that the wallpaper is
allowed to be in.
|
public int | getNonDecorDisplayHeight(int fullWidth, int fullHeight, int rotation)Return the display height available after excluding any screen
decorations that can never be removed. That is, system bar or
button bar.
|
public int | getNonDecorDisplayWidth(int fullWidth, int fullHeight, int rotation)Return the display width available after excluding any screen
decorations that can never be removed. That is, system bar or
button bar.
|
public int | getSystemDecorLayerLw()Returns the bottom-most layer of the system decor, above which no policy decor should
be applied.
|
public int | getUserRotationMode()Gets the current user rotation mode.
|
public android.view.WindowManagerPolicy$WindowState | getWinShowWhenLockedLw()Return the window that is hiding the keyguard, if such a thing exists.
|
public void | goingToSleep(int why)Called when the device is going to sleep.
|
public boolean | hasNavigationBar()Specifies whether there is an on-screen navigation bar separate from the status bar.
|
public void | hideBootMessages()Hide the UI for showing boot messages, never to be displayed again.
|
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.view.WindowManagerPolicy$WindowManagerFuncs windowManagerFuncs)Perform initialization of the policy.
|
public long | interceptKeyBeforeDispatching(android.view.WindowManagerPolicy$WindowState win, KeyEvent event, int policyFlags)Called from the input dispatcher thread before a key is dispatched to a window.
Allows you to define
behavior for keys that can not be overridden by applications.
This method is called from the input thread, with no locks held.
|
public int | interceptKeyBeforeQueueing(KeyEvent event, int policyFlags)Called from the input reader thread before a key is enqueued.
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 int | interceptMotionBeforeQueueingNonInteractive(long whenNanos, int policyFlags)Called from the input reader thread before a motion is enqueued when the device is in a
non-interactive state.
There are some actions that need to be handled here because they
affect the power state of the device, for example, waking on motions.
Generally, it's best to keep as little as possible in the queue thread
because it's the most fragile.
|
public boolean | isDefaultOrientationForced()
|
public boolean | isForceHiding(WindowManager.LayoutParams attrs)Return whether the given window is forcibly hiding all windows except windows with
FLAG_SHOW_WHEN_LOCKED set. Typically returns true for the keyguard.
|
public boolean | isKeyguardDrawnLw()Ask the policy whether the Keyguard has drawn. If the Keyguard is disabled, this method
returns true as soon as we know that Keyguard is disabled.
|
public boolean | isKeyguardHostWindow(WindowManager.LayoutParams attrs)Return whether the given window can become one that passes isForceHiding() test.
Typically returns true for the StatusBar.
|
public boolean | isKeyguardLocked()isKeyguardLocked
Return whether the keyguard is currently locked.
|
public boolean | isKeyguardSecure()isKeyguardSecure
Return whether the keyguard requires a password to unlock.
|
public boolean | isScreenOn()Return whether the default display is on and not blocked by a black surface.
|
public boolean | isTopLevelWindow(int windowType)Returns whether a given window type is considered a top level one.
A top level window does not have a container, i.e. attached window,
or if it has a container it is laid out as a top-level window, not
as a child of its container.
|
public void | keepScreenOnStartedLw()Called when we have started keeping the screen on because a window
requesting this has become visible.
|
public void | keepScreenOnStoppedLw()Called when we have stopped keeping the screen on because the last window
requesting this is no longer visible.
|
public void | layoutWindowLw(android.view.WindowManagerPolicy$WindowState win, 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 void | lockNow(android.os.Bundle options)Lock the device now.
|
public void | notifyActivityDrawnForKeyguardLw()Notifies the keyguard that the activity has drawn it was waiting for.
|
public void | notifyCameraLensCoverSwitchChanged(long whenNanos, boolean lensCovered)Tell the policy that the camera lens has been covered or uncovered.
|
public void | notifyLidSwitchChanged(long whenNanos, boolean lidOpen)Tell the policy that the lid switch has changed state.
|
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 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)Given an orientation constant, returns the appropriate surface rotation,
taking into account sensors, docking mode, rotation lock, and other factors.
|
public boolean | rotationHasCompatibleMetricsLw(int orientation, int rotation)Given an orientation constant and a rotation, returns true if the rotation
has compatible metrics to the requested orientation. For example, if
the application requested landscape and got seascape, then the rotation
has compatible metrics; if the application requested portrait and got landscape,
then the rotation has incompatible metrics; if the application did not specify
a preference, then anything goes.
|
public void | screenTurnedOff()Called when the device has turned the screen off.
|
public void | screenTurningOn(android.view.WindowManagerPolicy$ScreenOnListener screenOnListener)Called when the device is about to turn on the screen to show content.
When waking up, this method will be called once after the call to wakingUp().
When dozing, the method will be called sometime after the call to goingToSleep() and
may be called repeatedly in the case where the screen is pulsing on and off.
Must call back on the listener to tell it when the higher-level system
is ready for the screen to go on (i.e. the lock screen is shown).
|
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 | selectRotationAnimationLw(int[] anim)Determine the animation to run for a rotation transition based on the
top fullscreen windows {@link WindowManager.LayoutParams#rotationAnimation}
and whether it is currently fullscreen and frontmost.
|
public void | setCurrentOrientationLw(int newOrientation)
|
public void | setCurrentUserLw(int newUserId)Called when the current user changes. Guaranteed to be called before the broadcast
of the new user id is made to all listeners.
|
public void | setDisplayOverscan(Display display, int left, int top, int right, int bottom)Called by window manager to set the overscan region that should be used for the
given display.
|
public void | setInitialDisplaySize(Display display, int width, int height, int density)Called by window manager once it has the initial, default native
display dimensions.
|
public void | setLastInputMethodWindowLw(android.view.WindowManagerPolicy$WindowState ime, android.view.WindowManagerPolicy$WindowState target)Set the last used input method window state. This state is used to make IME transition
smooth.
|
public void | setRotationLw(int rotation)Called by the window manager when the rotation changes.
|
public void | setSafeMode(boolean safeMode)Called when the system is mostly done booting to set whether
the system should go into safe mode.
|
public void | setUserRotationMode(int mode, int rotation)Inform the policy that the user has chosen a preferred orientation ("rotation lock").
|
public void | showBootMessage(java.lang.CharSequence msg, boolean always)Show boot time message to the user.
|
public void | showGlobalActions()Show the global actions dialog.
|
public void | showRecentApps()Show the recents task list app.
|
public void | startKeyguardExitAnimation(long startTime, long fadeoutDuration)Notifies the keyguard to start fading out.
|
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 | systemBooted()Called when the system is done booting to the point where the
user can start interacting with it.
|
public void | systemReady()Called when the system is mostly done booting.
|
public void | userActivity()Called when userActivity is signalled in the power manager.
This is safe to call from any thread, with any window manager locks held or not.
|
public boolean | validateRotationAnimationLw(int exitAnimId, int enterAnimId, boolean forceDefault)Validate whether the current top fullscreen has specified the same
{@link WindowManager.LayoutParams#rotationAnimation} value as that
being passed in from the previous top fullscreen window.
|
public void | wakingUp()Called when the device is waking up.
|
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.
|