/**@class android.app.UiAutomation
@extends java.lang.Object

 Class for interacting with the device's UI by simulation user actions and
 introspection of the screen content. It relies on the platform accessibility
 APIs to introspect the screen and to perform some actions on the remote view
 tree. It also allows injecting of arbitrary raw input events simulating user
 interaction with keyboards and touch devices. One can think of a UiAutomation
 as a special type of {@link android.accessibilityservice.AccessibilityService}
 which does not provide hooks for the service life cycle and exposes other
 APIs that are useful for UI test automation.
 <p>
 The APIs exposed by this class are low-level to maximize flexibility when
 developing UI test automation tools and libraries. Generally, a UiAutomation
 client should be using a higher-level library or implement high-level functions.
 For example, performing a tap on the screen requires construction and injecting
 of a touch down and up events which have to be delivered to the system by a
 call to {@link #injectInputEvent(InputEvent, boolean)}.
 </p>
 <p>
 The APIs exposed by this class operate across applications enabling a client
 to write tests that cover use cases spanning over multiple applications. For
 example, going to the settings application to change a setting and then
 interacting with another application whose behavior depends on that setting.
 </p>
*/
var UiAutomation = {

/**Rotation constant: Unfreeze rotation (rotating the device changes its rotation state). */
ROTATION_UNFREEZE : "-2",
/**Rotation constant: Freeze rotation to its current state. */
ROTATION_FREEZE_CURRENT : "-1",
/**Rotation constant: Freeze rotation to 0 degrees (natural orientation) */
ROTATION_FREEZE_0 : "0",
/**Rotation constant: Freeze rotation to 90 degrees . */
ROTATION_FREEZE_90 : "1",
/**Rotation constant: Freeze rotation to 180 degrees . */
ROTATION_FREEZE_180 : "2",
/**Rotation constant: Freeze rotation to 270 degrees . */
ROTATION_FREEZE_270 : "3",
/** UiAutomation supresses accessibility services by default. This flag specifies that
 existing accessibility services should continue to run, and that new ones may start.
 This flag is set when obtaining the UiAutomation from
 {@link android.app.Instrumentation#getUiAutomation(int)}.
*/
FLAG_DONT_SUPPRESS_ACCESSIBILITY_SERVICES : "1",
/**Connects this UiAutomation to the accessibility introspection APIs with default flags.
@hide 
*/
connect : function(  ) {},

/**Connects this UiAutomation to the accessibility introspection APIs.
@param {Number} flags Any flags to apply to the automation as it gets connected
@hide 
*/
connect : function(  ) {},

/**Get the flags used to connect the service.
@return {Number} The flags used to connect
@hide 
*/
getFlags : function(  ) {},

/**Disconnects this UiAutomation from the accessibility introspection APIs.
@hide 
*/
disconnect : function(  ) {},

/**The id of the {@link IAccessibilityInteractionConnection} for querying
 the screen content. This is here for legacy purposes since some tools use
 hidden APIs to introspect the screen.
@hide 
*/
getConnectionId : function(  ) {},

/**Reports if the object has been destroyed
@return {Boolean} {code true} if the object has been destroyed.
@hide 
*/
isDestroyed : function(  ) {},

/**Sets a callback for observing the stream of {@link AccessibilityEvent}s.
 The callbacks are delivered on the main application thread.
@param {Object {UiAutomation.OnAccessibilityEventListener}} listener The callback.
*/
setOnAccessibilityEventListener : function(  ) {},

/**Destroy this UiAutomation. After calling this method, attempting to use the object will
 result in errors.
@hide 
*/
destroy : function(  ) {},

/**Adopt the permission identity of the shell UID for all permissions. This allows
 you to call APIs protected permissions which normal apps cannot hold but are
 granted to the shell UID. If you already adopted all shell permissions by calling
 this method or {@link #adoptShellPermissionIdentity(String...)} a subsequent call
 would be a no-op. Note that your permission state becomes that of the shell UID
 and it is not a combination of your and the shell UID permissions.
 <p>
 <strong>Note:<strong/> Calling this method adopts all shell permissions and overrides
 any subset of adopted permissions via {@link #adoptShellPermissionIdentity(String...)}.
@see #adoptShellPermissionIdentity(String...)
@see #dropShellPermissionIdentity()
*/
adoptShellPermissionIdentity : function(  ) {},

/**Adopt the permission identity of the shell UID only for the provided permissions.
 This allows you to call APIs protected permissions which normal apps cannot hold
 but are granted to the shell UID. If you already adopted the specified shell
 permissions by calling this method or {@link #adoptShellPermissionIdentity}() a
 subsequent call would be a no-op. Note that your permission state becomes that of the
 shell UID and it is not a combination of your and the shell UID permissions.
 <p>
 <strong>Note:<strong/> Calling this method adopts only the specified shell permissions
 and overrides all adopted permissions via {@link #adoptShellPermissionIdentity}().
@param {Object {java.lang.String[]}} permissions The permissions to adopt or <code>null</code> to adopt all.
@see #adoptShellPermissionIdentity()
@see #dropShellPermissionIdentity()
*/
adoptShellPermissionIdentity : function(  ) {},

/**Drop the shell permission identity adopted by a previous call to
 {@link #adoptShellPermissionIdentity}(). If you did not adopt the shell permission
 identity this method would be a no-op.
@see #adoptShellPermissionIdentity()
*/
dropShellPermissionIdentity : function(  ) {},

/**Performs a global action. Such an action can be performed at any moment
 regardless of the current application or user location in that application.
 For example going back, going home, opening recents, etc.
@param {Number} action The action to perform.
@return {Boolean} Whether the action was successfully performed.
@see android.accessibilityservice.AccessibilityService#GLOBAL_ACTION_BACK
@see android.accessibilityservice.AccessibilityService#GLOBAL_ACTION_HOME
@see android.accessibilityservice.AccessibilityService#GLOBAL_ACTION_NOTIFICATIONS
@see android.accessibilityservice.AccessibilityService#GLOBAL_ACTION_RECENTS
*/
performGlobalAction : function(  ) {},

/**Find the view that has the specified focus type. The search is performed
 across all windows.
 <p>
 <strong>Note:</strong> In order to access the windows you have to opt-in
 to retrieve the interactive windows by setting the
 {@link AccessibilityServiceInfo#FLAG_RETRIEVE_INTERACTIVE_WINDOWS} flag.
 Otherwise, the search will be performed only in the active window.
 </p>
@param {Number} focus The focus to find. One of {@link AccessibilityNodeInfo#FOCUS_INPUT} or
         {@link AccessibilityNodeInfo#FOCUS_ACCESSIBILITY}.
@return {Object {android.view.accessibility.AccessibilityNodeInfo}} The node info of the focused view or null.
@see AccessibilityNodeInfo#FOCUS_INPUT
@see AccessibilityNodeInfo#FOCUS_ACCESSIBILITY
*/
findFocus : function(  ) {},

/**Gets the an {@link AccessibilityServiceInfo} describing this UiAutomation.
 This method is useful if one wants to change some of the dynamically
 configurable properties at runtime.
@return {Object {android.accessibilityservice.AccessibilityServiceInfo}} The accessibility service info.
@see AccessibilityServiceInfo
*/
getServiceInfo : function(  ) {},

/**Sets the {@link AccessibilityServiceInfo} that describes how this
 UiAutomation will be handled by the platform accessibility layer.
@param {Object {AccessibilityServiceInfo}} info The info.
@see AccessibilityServiceInfo
*/
setServiceInfo : function(  ) {},

/**Gets the windows on the screen. This method returns only the windows
 that a sighted user can interact with, as opposed to all windows.
 For example, if there is a modal dialog shown and the user cannot touch
 anything behind it, then only the modal window will be reported
 (assuming it is the top one). For convenience the returned windows
 are ordered in a descending layer order, which is the windows that
 are higher in the Z-order are reported first.
 <p>
 <strong>Note:</strong> In order to access the windows you have to opt-in
 to retrieve the interactive windows by setting the
 {@link AccessibilityServiceInfo#FLAG_RETRIEVE_INTERACTIVE_WINDOWS} flag.
 </p>
@return {Object {java.util.List}} The windows if there are windows such, otherwise an empty list.
*/
getWindows : function(  ) {},

/**Gets the root {@link AccessibilityNodeInfo} in the active window.
@return {Object {android.view.accessibility.AccessibilityNodeInfo}} The root info.
*/
getRootInActiveWindow : function(  ) {},

/**A method for injecting an arbitrary input event.
 <p>
 <strong>Note:</strong> It is caller's responsibility to recycle the event.
 </p>
@param {Object {InputEvent}} event The event to inject.
@param {Boolean} sync Whether to inject the event synchronously.
@return {Boolean} Whether event injection succeeded.
*/
injectInputEvent : function(  ) {},

/**A request for WindowManagerService to wait until all animations have completed and input
 information has been sent from WindowManager to native InputManager.
@hide 
*/
syncInputTransactions : function(  ) {},

/**Sets the device rotation. A client can freeze the rotation in
 desired state or freeze the rotation to its current state or
 unfreeze the rotation (rotating the device changes its rotation
 state).
@param {Number} rotation The desired rotation.
@return {Boolean} Whether the rotation was set successfully.
@see #ROTATION_FREEZE_0
@see #ROTATION_FREEZE_90
@see #ROTATION_FREEZE_180
@see #ROTATION_FREEZE_270
@see #ROTATION_FREEZE_CURRENT
@see #ROTATION_UNFREEZE
*/
setRotation : function(  ) {},

/**Executes a command and waits for a specific accessibility event up to a
 given wait timeout. To detect a sequence of events one can implement a
 filter that keeps track of seen events of the expected sequence and
 returns true after the last event of that sequence is received.
 <p>
 <strong>Note:</strong> It is caller's responsibility to recycle the returned event.
 </p>
@param {Object {Runnable}} command The command to execute.
@param {Object {UiAutomation.AccessibilityEventFilter}} filter Filter that recognizes the expected event.
@param {Number} timeoutMillis The wait timeout in milliseconds.
@throws TimeoutException If the expected event is not received within the timeout.
*/
executeAndWaitForEvent : function(  ) {},

/**Waits for the accessibility event stream to become idle, which is not to
 have received an accessibility event within <code>idleTimeoutMillis</code>.
 The total time spent to wait for an idle accessibility event stream is bounded
 by the <code>globalTimeoutMillis</code>.
@param {Number} idleTimeoutMillis The timeout in milliseconds between two events
            to consider the device idle.
@param {Number} globalTimeoutMillis The maximal global timeout in milliseconds in
            which to wait for an idle state.
@throws TimeoutException If no idle state was detected within
            <code>globalTimeoutMillis.</code>
*/
waitForIdle : function(  ) {},

/**Takes a screenshot.
@return {Object {android.graphics.Bitmap}} The screenshot bitmap on success, null otherwise.
*/
takeScreenshot : function(  ) {},

/**Sets whether this UiAutomation to run in a "monkey" mode. Applications can query whether
 they are executed in a "monkey" mode, i.e. run by a test framework, and avoid doing
 potentially undesirable actions such as calling 911 or posting on public forums etc.
@param {Boolean} enable whether to run in a "monkey" mode or not. Default is not.
@see ActivityManager#isUserAMonkey()
*/
setRunAsMonkey : function(  ) {},

/**Clears the frame statistics for the content of a given window. These
 statistics contain information about the most recently rendered content
 frames.
@param {Number} windowId The window id.
@return {Boolean} Whether the window is present and its frame statistics
         were cleared.
@see android.view.WindowContentFrameStats
@see #getWindowContentFrameStats(int)
@see #getWindows()
@see AccessibilityWindowInfo#getId() AccessibilityWindowInfo.getId()
*/
clearWindowContentFrameStats : function(  ) {},

/**Gets the frame statistics for a given window. These statistics contain
 information about the most recently rendered content frames.
 <p>
 A typical usage requires clearing the window frame statistics via {@link #clearWindowContentFrameStats}(int) followed by an interaction with the UI and
 finally getting the window frame statistics via calling this method.
 </p>
 <pre>
 // Assume we have at least one window.
 final int windowId = getWindows().get(0).getId();

 // Start with a clean slate.
 uiAutimation.clearWindowContentFrameStats(windowId);

 // Do stuff with the UI.

 // Get the frame statistics.
 WindowContentFrameStats stats = uiAutomation.getWindowContentFrameStats(windowId);
 </pre>
@param {Number} windowId The window id.
@return {Object {android.view.WindowContentFrameStats}} The window frame statistics, or null if the window is not present.
@see android.view.WindowContentFrameStats
@see #clearWindowContentFrameStats(int)
@see #getWindows()
@see AccessibilityWindowInfo#getId() AccessibilityWindowInfo.getId()
*/
getWindowContentFrameStats : function(  ) {},

/**Clears the window animation rendering statistics. These statistics contain
 information about the most recently rendered window animation frames, i.e.
 for window transition animations.
@see android.view.WindowAnimationFrameStats
@see #getWindowAnimationFrameStats()
@see android.R.styleable#WindowAnimation
*/
clearWindowAnimationFrameStats : function(  ) {},

/**Gets the window animation frame statistics. These statistics contain
 information about the most recently rendered window animation frames, i.e.
 for window transition animations.

 <p>
 A typical usage requires clearing the window animation frame statistics via
 {@link #clearWindowAnimationFrameStats}() followed by an interaction that causes
 a window transition which uses a window animation and finally getting the window
 animation frame statistics by calling this method.
 </p>
 <pre>
 // Start with a clean slate.
 uiAutimation.clearWindowAnimationFrameStats();

 // Do stuff to trigger a window transition.

 // Get the frame statistics.
 WindowAnimationFrameStats stats = uiAutomation.getWindowAnimationFrameStats();
 </pre>
@return {Object {android.view.WindowAnimationFrameStats}} The window animation frame statistics.
@see android.view.WindowAnimationFrameStats
@see #clearWindowAnimationFrameStats()
@see android.R.styleable#WindowAnimation
*/
getWindowAnimationFrameStats : function(  ) {},

/**Grants a runtime permission to a package.
@param {String} packageName The package to which to grant.
@param {String} permission The permission to grant.
@throws SecurityException if unable to grant the permission.
*/
grantRuntimePermission : function(  ) {},

/**
@deprecated replaced by
             {@link #grantRuntimePermissionAsUser(String, String, UserHandle)}.
@hide 
*/
grantRuntimePermission : function(  ) {},

/**Grants a runtime permission to a package for a user.
@param {String} packageName The package to which to grant.
@param {String} permission The permission to grant.
@throws SecurityException if unable to grant the permission.
*/
grantRuntimePermissionAsUser : function(  ) {},

/**Revokes a runtime permission from a package.
@param {String} packageName The package to which to grant.
@param {String} permission The permission to grant.
@throws SecurityException if unable to revoke the permission.
*/
revokeRuntimePermission : function(  ) {},

/**
@deprecated replaced by
             {@link #revokeRuntimePermissionAsUser(String, String, UserHandle)}.
@hide 
*/
revokeRuntimePermission : function(  ) {},

/**Revokes a runtime permission from a package.
@param {String} packageName The package to which to grant.
@param {String} permission The permission to grant.
@throws SecurityException if unable to revoke the permission.
*/
revokeRuntimePermissionAsUser : function(  ) {},

/**Executes a shell command. This method returns a file descriptor that points
 to the standard output stream. The command execution is similar to running
 "adb shell <command>" from a host connected to the device.
 <p>
 <strong>Note:</strong> It is your responsibility to close the returned file
 descriptor once you are done reading.
 </p>
@param {String} command The command to execute.
@return {Object {android.os.ParcelFileDescriptor}} A file descriptor to the standard output stream.
@see #adoptShellPermissionIdentity()
*/
executeShellCommand : function(  ) {},

/**Executes a shell command. This method returns two file descriptors,
 one that points to the standard output stream (element at index 0), and one that points
 to the standard input stream (element at index 1). The command execution is similar
 to running "adb shell <command>" from a host connected to the device.
 <p>
 <strong>Note:</strong> It is your responsibility to close the returned file
 descriptors once you are done reading/writing.
 </p>
@param {String} command The command to execute.
@return {Object {android.os.ParcelFileDescriptor}} File descriptors (out, in) to the standard output/input streams.
@hide 
*/
executeShellCommandRw : function(  ) {},


};