Package com.hp.lft.sdk.mobile
Class EventResponseArgs
java.lang.Object
com.hp.lft.sdk.mobile.EventResponseArgs
Configures how to simulate events that interrupt the application flow on the device, such as an incoming call or SMS.
These simulated events can help you test that your application responds properly to the event itself and to state transitions. For example, you may want to verify that when an incoming SMS is received, your app is sent to the background for several seconds, and, when it returns to the foreground, the app is in an active state, ready to continue.
These simulated events can help you test that your application responds properly to the event itself and to state transitions. For example, you may want to verify that when an incoming SMS is received, your app is sent to the background for several seconds, and, when it returns to the foreground, the app is in an active state, ready to continue.
-
Constructor Summary
ConstructorsConstructorDescriptionInitializes a new instance of the EventResponseArgs class with default arguments (timeInBackground = 10 seconds; respondToEvent = false).EventResponseArgs
(int timeInBackground, boolean respondToEvent) Initializes a new instance of the EventResponseArgs class with the provided arguments. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the time (in seconds) that the application remains in the background while the event is being handled.boolean
Indicates whether there is a response to the simulated event.void
setRespondToEvent
(boolean respondToEvent) Sets whether there is a response to the simulated event (for example, sending the app to the background).void
setTimeInBackground
(int timeInBackground) Sets the time (in seconds) that the application remains in the background while the event is being handled.
-
Constructor Details
-
EventResponseArgs
public EventResponseArgs()Initializes a new instance of the EventResponseArgs class with default arguments (timeInBackground = 10 seconds; respondToEvent = false). -
EventResponseArgs
public EventResponseArgs(int timeInBackground, boolean respondToEvent) Initializes a new instance of the EventResponseArgs class with the provided arguments.- Parameters:
timeInBackground
- the time (in seconds) that the application remains in the background while the event is being handled.respondToEvent
- indicates whether there is a response to the simulated event.
-
-
Method Details
-
getTimeInBackground
public int getTimeInBackground()Returns the time (in seconds) that the application remains in the background while the event is being handled.- Returns:
- the time (in seconds) that the application remains in the background while the event is being handled.
-
setTimeInBackground
public void setTimeInBackground(int timeInBackground) Sets the time (in seconds) that the application remains in the background while the event is being handled.- Parameters:
timeInBackground
- the time (in seconds) that the application remains in the background while the event is being handled. Default = 10
-
isRespondToEvent
public boolean isRespondToEvent()Indicates whether there is a response to the simulated event.- Returns:
- true, if there is a response to the simulated event.
-
setRespondToEvent
public void setRespondToEvent(boolean respondToEvent) Sets whether there is a response to the simulated event (for example, sending the app to the background). Default = false- Parameters:
respondToEvent
- true, if there is a response to the simulated event.
-