1. A wireless electronic device, comprising:an interface circuit configured to communicate application data with another electronic device through a connection;
a processor; and
a memory that stores an operating system of the electronic device and an application, wherein, during operation:
the processor executes the operating system and selectively executes the application;
after execution of the application by the processor, the application transitions from a runnable mode to a suspended state, and the operating system receives a request from the application to maintain the connection while the application is in the suspended state; and
in response to the request, the operating system provides an instruction to the interface circuit to maintain the connection for a time interval while the application is in the suspended state, wherein the time interval is set based on at least one of a current power state of a battery included in the electronic device and a current available space within the memory.