Build 1.0_r1(from source)

android.view
Interface WindowManagerPolicy


public interface WindowManagerPolicy

This interface supplies all UI-specific behavior of the window manager. An instance of it is created by the window manager when it starts up, and allows customization of window layering, special window types, key dispatching, and layout.

Because this provides deep interaction with the system window manager, specific methods on this interface can be called from a variety of contexts with various restrictions on what they can do. These are encoded through a suffixes at the end of a method encoding the thread the method is called from and any locks that are held when it is being called; if no suffix is attached to a method, then it is not called with any locks and may be called from the main window manager thread or another thread calling into the window manager.

The current suffixes are:

Ti
Called from the input thread. This is the thread that collects pending input events and dispatches them to the appropriate window. It may block waiting for events to be processed, so that the input stream is properly serialized.
Tq
Called from the low-level input queue thread. This is the thread that reads events out of the raw input devices and places them into the global input queue that is read by the Ti thread. This thread should not block for a long period of time on anything but the key driver.
Lw
Called with the main window manager lock held. Because the window manager is a very low-level system service, there are few other system services you can call with this lock held. It is explicitly okay to make calls into the package manager and power manager; it is explicitly not okay to make calls into the activity manager. Note that Context.checkPermission(String, int, int) and variations require calling into the activity manager.
Li
Called with the input thread lock held. This lock can be acquired by the window manager while it holds the window lock, so this is even more restrictive than Lw.


Nested Class Summary
static interface WindowManagerPolicy.OnKeyguardExitResult
          Callback used by exitKeyguardSecurely(android.view.WindowManagerPolicy.OnKeyguardExitResult)
static interface WindowManagerPolicy.WindowState
          Interface to the Window Manager state associated with a particular window.
 
Field Summary
static int ACTION_GO_TO_SLEEP
          This key event should put the device to sleep (and engage keyguard if necessary) To be returned from interceptKeyTq(android.view.RawInputEvent, boolean).
static int ACTION_PASS_TO_USER
          Pass this event to the user / app.
static int ACTION_POKE_USER_ACTIVITY
          This key event should extend the user activity timeout and turn the lights on.
static int FLAG_ALT
           
static int FLAG_ALT_GR
           
static int FLAG_BRIGHT_HERE
           
static int FLAG_CAPS_LOCK
           
static int FLAG_LAUNCHER
           
static int FLAG_MENU
           
static int FLAG_SHIFT
           
static int FLAG_WAKE
           
static int FLAG_WAKE_DROPPED
           
static int FLAG_WOKE_HERE
           
static int OFF_BECAUSE_OF_TIMEOUT
          Screen turned off because of timeout
static int OFF_BECAUSE_OF_USER
          Screen turned off because of power button
static int TRANSIT_ACTIVITY_CLOSE
          The window in the top-most activity is being closed to reveal the previous activity in the same task.
static int TRANSIT_ACTIVITY_OPEN
          A window in a new activity is being opened on top of an existing one in the same task.
static int TRANSIT_ENTER
          Window has been added to the screen.
static int TRANSIT_EXIT
          Window has been removed from the screen.
static int TRANSIT_HIDE
          Window has been made invisible.
static int TRANSIT_NONE
          No transition happening.
static int TRANSIT_PREVIEW_DONE
          The "application starting" preview window is no longer needed, and will animate away to show the real window.
static int TRANSIT_SHOW
          Window has been made visible.
static int TRANSIT_TASK_CLOSE
          A window in the top-most activity is being closed to reveal the previous activity in a different task.
static int TRANSIT_TASK_OPEN
          A window in a new task is being opened on top of an existing one in another activity's task.
static int TRANSIT_TASK_TO_BACK
          A window in an existing task is being put below all other tasks.
static int TRANSIT_TASK_TO_FRONT
          A window in an existing task is being displayed on top of an existing one in another activity's task.
static int USE_LAST_ROTATION
          Magic constant to IWindowManager.setRotation(int, boolean) to not actually modify the rotation.
static boolean WATCH_POINTER
           
 
Method Summary
 View addStartingWindow(IBinder appToken, String packageName, int theme, CharSequence nonLocalizedLabel, int labelRes, int icon)
          Called when the system would like to show a UI to indicate that an application is starting.
 void adjustConfigurationLw(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.
 void adjustWindowParamsLw(WindowManager.LayoutParams attrs)
          Sanitize the layout parameters coming from a client.
 void animatingWindowLw(WindowManagerPolicy.WindowState win, WindowManager.LayoutParams attrs)
          Called each time a window is animating.
 void beginAnimationLw(int displayWidth, int displayHeight)
          Called when animation of the windows is about to start.
 void beginLayoutLw(int displayWidth, int displayHeight)
          Called when layout of the windows is about to start.
 int checkAddPermission(WindowManager.LayoutParams attrs)
          Check permissions when adding a window.
 void enableKeyguard(boolean enabled)
          Tell the policy if anyone is requesting that keyguard not come on.
 void enableScreenAfterBoot()
          Called when we have finished booting and can now display the home screen to the user.
 void exitKeyguardSecurely(WindowManagerPolicy.OnKeyguardExitResult callback)
          Tell the policy if anyone is requesting the keyguard to exit securely (this would be called after the keyguard was disabled)
 boolean finishAnimationLw()
          Called when animation of the windows is finished.
 void finishLayoutLw()
          Called when layout of the windows is finished.
 void getCoveredInsetHintLw(WindowManager.LayoutParams attrs, Rect coveredInset)
          Return the insets for the areas covered by system windows.
 void init(Context context, IWindowManager windowManager, LocalPowerManager powerManager)
          Perform initialization of the policy.
 boolean inKeyguardRestrictedKeyInputMode()
          inKeyguardRestrictedKeyInputMode if keyguard screen is showing or in restricted key input mode (i.e.
 boolean interceptKeyTi(WindowManagerPolicy.WindowState win, int code, int metaKeys, boolean down, int repeatCount)
          Called from the input thread before a key is dispatched to a window.
 int interceptKeyTq(RawInputEvent event, boolean screenIsOn)
          Called from the key queue thread before a key is dispatched to the input thread.
 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).
 boolean isCheekPressedAgainstScreen(MotionEvent ev)
          Returns true if the user's cheek has been pressed against the phone.
 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).
 boolean isWakeAbsMovementTq(int device, int classes, RawInputEvent event)
          Given the current state of the world, should this absolute movement wake up the device?
 boolean isWakeRelMovementTq(int device, int classes, RawInputEvent event)
          Given the current state of the world, should this relative movement wake up the device?
 boolean keyguardIsShowingTq()
          Return if keyguard is currently showing.
 void layoutWindowLw(WindowManagerPolicy.WindowState win, WindowManager.LayoutParams attrs, WindowManagerPolicy.WindowState attached)
          Called for each window attached to the window manager as layout is proceeding.
 int prepareAddWindowLw(WindowManagerPolicy.WindowState win, WindowManager.LayoutParams attrs)
          Prepare for a window being added to the window manager.
 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.
 void removeStartingWindow(IBinder appToken, View window)
          Called when the first window of an application has been displayed, while addStartingWindow(android.os.IBinder, java.lang.String, int, java.lang.CharSequence, int, int) has created a temporary initial window for that application.
 void removeWindowLw(WindowManagerPolicy.WindowState win)
          Called when a window is being removed from a window manager.
 int rotationForOrientation(int orientation)
          Given an orientation constant (ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE or ActivityInfo.SCREEN_ORIENTATION_PORTRAIT), return a surface rotation.
 void screenTurnedOff(int why)
          Called after the screen turns off.
 void screenTurnedOn()
          Called after the screen turns on.
 int selectAnimationLw(WindowManagerPolicy.WindowState win, int transit)
          Control the animation to run when a window's state changes.
 void setCurrentOrientation(int newOrientation)
           
 int subWindowTypeToLayerLw(int type)
          Return how to Z-order sub-windows in relation to the window they are attached to.
 void systemReady()
          Called when the system is mostly done booting
 int windowTypeToLayerLw(int type)
          Assign a window type to a layer.
 

Field Detail

FLAG_WAKE

static final int FLAG_WAKE
See Also:
Constant Field Values

FLAG_WAKE_DROPPED

static final int FLAG_WAKE_DROPPED
See Also:
Constant Field Values

FLAG_SHIFT

static final int FLAG_SHIFT
See Also:
Constant Field Values

FLAG_CAPS_LOCK

static final int FLAG_CAPS_LOCK
See Also:
Constant Field Values

FLAG_ALT

static final int FLAG_ALT
See Also:
Constant Field Values

FLAG_ALT_GR

static final int FLAG_ALT_GR
See Also:
Constant Field Values

FLAG_MENU

static final int FLAG_MENU
See Also:
Constant Field Values

FLAG_LAUNCHER

static final int FLAG_LAUNCHER
See Also:
Constant Field Values

FLAG_WOKE_HERE

static final int FLAG_WOKE_HERE
See Also:
Constant Field Values

FLAG_BRIGHT_HERE

static final int FLAG_BRIGHT_HERE
See Also:
Constant Field Values

WATCH_POINTER

static final boolean WATCH_POINTER
See Also:
Constant Field Values

ACTION_PASS_TO_USER

static final int ACTION_PASS_TO_USER
Pass this event to the user / app. To be returned from interceptKeyTq(android.view.RawInputEvent, boolean).

See Also:
Constant Field Values

ACTION_POKE_USER_ACTIVITY

static final int ACTION_POKE_USER_ACTIVITY
This key event should extend the user activity timeout and turn the lights on. To be returned from interceptKeyTq(android.view.RawInputEvent, boolean). Do not return this and ACTION_GO_TO_SLEEP or ACTION_PASS_TO_USER.

See Also:
Constant Field Values

ACTION_GO_TO_SLEEP

static final int ACTION_GO_TO_SLEEP
This key event should put the device to sleep (and engage keyguard if necessary) To be returned from interceptKeyTq(android.view.RawInputEvent, boolean). Do not return this and ACTION_POKE_USER_ACTIVITY or ACTION_PASS_TO_USER.

See Also:
Constant Field Values

TRANSIT_NONE

static final int TRANSIT_NONE
No transition happening.

See Also:
Constant Field Values

TRANSIT_ENTER

static final int TRANSIT_ENTER
Window has been added to the screen.

See Also:
Constant Field Values

TRANSIT_EXIT

static final int TRANSIT_EXIT
Window has been removed from the screen.

See Also:
Constant Field Values

TRANSIT_SHOW

static final int TRANSIT_SHOW
Window has been made visible.

See Also:
Constant Field Values

TRANSIT_HIDE

static final int TRANSIT_HIDE
Window has been made invisible.

See Also:
Constant Field Values

TRANSIT_PREVIEW_DONE

static final int TRANSIT_PREVIEW_DONE
The "application starting" preview window is no longer needed, and will animate away to show the real window.

See Also:
Constant Field Values

TRANSIT_ACTIVITY_OPEN

static final int TRANSIT_ACTIVITY_OPEN
A window in a new activity is being opened on top of an existing one in the same task.

See Also:
Constant Field Values

TRANSIT_ACTIVITY_CLOSE

static final int TRANSIT_ACTIVITY_CLOSE
The window in the top-most activity is being closed to reveal the previous activity in the same task.

See Also:
Constant Field Values

TRANSIT_TASK_OPEN

static final int TRANSIT_TASK_OPEN
A window in a new task is being opened on top of an existing one in another activity's task.

See Also:
Constant Field Values

TRANSIT_TASK_CLOSE

static final int TRANSIT_TASK_CLOSE
A window in the top-most activity is being closed to reveal the previous activity in a different task.

See Also:
Constant Field Values

TRANSIT_TASK_TO_FRONT

static final int TRANSIT_TASK_TO_FRONT
A window in an existing task is being displayed on top of an existing one in another activity's task.

See Also:
Constant Field Values

TRANSIT_TASK_TO_BACK

static final int TRANSIT_TASK_TO_BACK
A window in an existing task is being put below all other tasks.

See Also:
Constant Field Values

OFF_BECAUSE_OF_USER

static final int OFF_BECAUSE_OF_USER
Screen turned off because of power button

See Also:
Constant Field Values

OFF_BECAUSE_OF_TIMEOUT

static final int OFF_BECAUSE_OF_TIMEOUT
Screen turned off because of timeout

See Also:
Constant Field Values

USE_LAST_ROTATION

static final int USE_LAST_ROTATION
Magic constant to IWindowManager.setRotation(int, boolean) to not actually modify the rotation.

See Also:
Constant Field Values
Method Detail

init

void init(Context context,
          IWindowManager windowManager,
          LocalPowerManager powerManager)
Perform initialization of the policy.

Parameters:
context - The system context we are running in.
powerManager -

checkAddPermission

int checkAddPermission(WindowManager.LayoutParams attrs)
Check permissions when adding a window.

Parameters:
attrs - The window's LayoutParams.
Returns:
WindowManagerImpl.ADD_OKAY if the add can proceed; else an error code, usually WindowManagerImpl.ADD_PERMISSION_DENIED, to abort the add.

adjustWindowParamsLw

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.

Parameters:
attrs - The window layout parameters to be modified. These values are modified in-place.

adjustConfigurationLw

void adjustConfigurationLw(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.

Parameters:
config - The Configuration being computed, for you to change as desired.

windowTypeToLayerLw

int windowTypeToLayerLw(int type)
Assign a window type to a layer. Allows you to control how different kinds of windows are ordered on-screen.

Parameters:
type - The type of window being assigned.
Returns:
int An arbitrary integer used to order windows, with lower numbers below higher ones.

subWindowTypeToLayerLw

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.

Parameters:
type - The sub-window type code.
Returns:
int Layer in relation to the attached window, where positive is above and negative is below.

addStartingWindow

View addStartingWindow(IBinder appToken,
                       String packageName,
                       int theme,
                       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.

Parameters:
appToken - Token of the application being started.
packageName - The name of the application package being started.
theme - Resource defining the application's overall visual theme.
nonLocalizedLabel - The default title label of the application if no data is found in the resource.
labelRes - The resource ID the application would like to use as its name.
icon - The resource ID the application would like to use as its icon.
Returns:
Optionally you can return the View that was used to create the window, for easy removal in removeStartingWindow.
See Also:
removeStartingWindow(android.os.IBinder, android.view.View)

removeStartingWindow

void removeStartingWindow(IBinder appToken,
                          View window)
Called when the first window of an application has been displayed, while addStartingWindow(android.os.IBinder, java.lang.String, int, java.lang.CharSequence, int, int) 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.

Parameters:
appToken - Token of the application that has started.
window - Window View that was returned by createStartingWindow.
See Also:
addStartingWindow(android.os.IBinder, java.lang.String, int, java.lang.CharSequence, int, int)

prepareAddWindowLw

int prepareAddWindowLw(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.

Parameters:
win - The window being added.
attrs - The window's LayoutParams.
Returns:
WindowManagerImpl.ADD_OKAY if the add can proceed, else an error code to abort the add.

removeWindowLw

void removeWindowLw(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.

Parameters:
win - The window being removed.

selectAnimationLw

int selectAnimationLw(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.

Parameters:
win - The window that is changing.
transit - What is happening to the window: TRANSIT_ENTER, TRANSIT_EXIT, TRANSIT_SHOW, or TRANSIT_HIDE.
Returns:
Resource ID of the actual animation to use, or 0 for none.

interceptKeyTq

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.

Parameters:
event - the raw input event as read from the driver
screenIsOn - true if the screen is already on
Returns:
The bitwise or of the ACTION_PASS_TO_USER, ACTION_POKE_USER_ACTIVITY and ACTION_GO_TO_SLEEP flags.

interceptKeyTi

boolean interceptKeyTi(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.

Parameters:
win - The window that currently has focus. This is where the key event will normally go.
code - Key code.
metaKeys - TODO
down - Is this a key press (true) or release (false)?
repeatCount - Number of times a key down has repeated.
Returns:
Returns true if the policy consumed the event and it should not be further dispatched.

beginLayoutLw

void beginLayoutLw(int displayWidth,
                   int displayHeight)
Called when layout of the windows is about to start.

Parameters:
displayWidth - The current full width of the screen.
displayHeight - The current full height of the screen.

layoutWindowLw

void layoutWindowLw(WindowManagerPolicy.WindowState win,
                    WindowManager.LayoutParams attrs,
                    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().

Parameters:
win - The window being positioned.
attrs - The LayoutParams of the window.
attached - For sub-windows, the window it is attached to; this window will already have had layoutWindow() called on it so you can use its Rect. Otherwise null.

getCoveredInsetHintLw

void getCoveredInsetHintLw(WindowManager.LayoutParams attrs,
                           Rect coveredInset)
Return the insets for the areas covered by system windows. These values are computed on the mose recent layout, so they are not guaranteed to be correct.

Parameters:
attrs - The LayoutParams of the window.
coveredInset - The areas covered by system windows, expressed as positive insets

finishLayoutLw

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.


beginAnimationLw

void beginAnimationLw(int displayWidth,
                      int displayHeight)
Called when animation of the windows is about to start.

Parameters:
displayWidth - The current full width of the screen.
displayHeight - The current full height of the screen.

animatingWindowLw

void animatingWindowLw(WindowManagerPolicy.WindowState win,
                       WindowManager.LayoutParams attrs)
Called each time a window is animating.

Parameters:
win - The window being positioned.
attrs - The LayoutParams of the window.

finishAnimationLw

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.

Returns:
Return true if animation state may have changed (so that another frame of animation will be run).

screenTurnedOff

void screenTurnedOff(int why)
Called after the screen turns off.

Parameters:
why - OFF_BECAUSE_OF_USER or OFF_BECAUSE_OF_TIMEOUT.

screenTurnedOn

void screenTurnedOn()
Called after the screen turns on.


preprocessInputEventTq

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.

Parameters:
event - The input event that has occurred.
Returns:
Return true if you have consumed the event and do not want further processing to occur; return false for normal processing.

isAppSwitchKeyTqTiLwLi

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.

Parameters:
keycode - The key that should be checked for performing an app switch before delivering to the application.
Returns:
Return true if this is an app switch key and special processing should happen; return false for normal processing.

isMovementKeyTi

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 #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.

Parameters:
keycode - The key that is waiting to be delivered to the application.
Returns:
Return true if this is a purely navigation key and can be dropped without negative consequences; return false to keep it.

isWakeRelMovementTq

boolean isWakeRelMovementTq(int device,
                            int classes,
                            RawInputEvent event)
Given the current state of the world, should this relative movement wake up the device?

Parameters:
device - The device the movement came from.
classes - The input classes associated with the device.
event - The input event that occurred.
Returns:

isWakeAbsMovementTq

boolean isWakeAbsMovementTq(int device,
                            int classes,
                            RawInputEvent event)
Given the current state of the world, should this absolute movement wake up the device?

Parameters:
device - The device the movement came from.
classes - The input classes associated with the device.
event - The input event that occurred.
Returns:

enableKeyguard

void enableKeyguard(boolean enabled)
Tell the policy if anyone is requesting that keyguard not come on.

Parameters:
enabled - Whether keyguard can be on or not. does not actually turn it on, unless it was previously disabled with this function.
See Also:
KeyguardManager.KeyguardLock.disableKeyguard(), KeyguardManager.KeyguardLock.reenableKeyguard()

exitKeyguardSecurely

void exitKeyguardSecurely(WindowManagerPolicy.OnKeyguardExitResult callback)
Tell the policy if anyone is requesting the keyguard to exit securely (this would be called after the keyguard was disabled)

Parameters:
callback - Callback to send the result back.
See Also:
KeyguardManager.exitKeyguardSecurely(android.app.KeyguardManager.OnKeyguardExitResult)

keyguardIsShowingTq

boolean keyguardIsShowingTq()
Return if keyguard is currently showing.


inKeyguardRestrictedKeyInputMode

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.

Returns:
true if in keyguard restricted input mode.

rotationForOrientation

int rotationForOrientation(int orientation)
Given an orientation constant (ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE or ActivityInfo.SCREEN_ORIENTATION_PORTRAIT), return a surface rotation.


systemReady

void systemReady()
Called when the system is mostly done booting


enableScreenAfterBoot

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.


isCheekPressedAgainstScreen

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.

Parameters:
ev - the motion event generated when the cheek is pressed against the phone
Returns:
Returns true if the user's cheek has been pressed against the phone screen resulting in an invalid motion event

setCurrentOrientation

void setCurrentOrientation(int newOrientation)

Build 1.0_r1(from source)

Please submit a feedback, bug or feature