Patent ID: 8429674

Claim:
A method comprising: executing, by a mobile device, an application program, the application program configured to receive an input from a user interface item of the mobile device that is external to the application program forcing the application program to terminate, the application program being connected to one or more data stores through one or more connections; receiving, by the mobile device, the input forcing the application program to terminate; upon receiving the input, inquiring, by the application program and to an operating system of the mobile device, a time window in which the application program is allowed to perform one or more actions before the application program is forced to terminate, wherein the time window includes a length of time between receiving the input and a time that the operating system revokes resources provided by the operating system to the application program; within the time window, performing the actions, including storing data states on a storage device, the data states including states of at least one of the one or more connections; and terminating the one or more connections.