What should I do if TCP connections are interrupted when the application is switched to the background?
- When an application is switched to the background, the background power consumption control policy is triggered, and all created network connections are terminated within a short period of time.
- Network Resources: Applications without continuous tasks should proactively release the TCP and UDP connections when they are switched to the background.
- If an application has a perceivable task that needs to run in an extended period of time in the background, it can request a continuous task to prevent itself from being suspended. Examples of continuous tasks include music playback and navigation in the background. The following types of continuous tasks are supported: data transfer, audio and video playback, recording, positioning and navigation, Bluetooth-related task, multi-device connection, WLAN-related task, and computing tasks.