A user can put an app into different window states and the behavior of the app must properly match that window state.
There are three window states for all apps: Full screen, Thumbnail, and Invisible. These are the current window states, the way the app is shown, or not shown, on the device. The navigator event, NAVIGATOR_WINDOW_STATE, is sent to the app to notify of the change in the window state.
The Full Screen state occurs when the app is brought to the foreground and occupies the entire screen. In this state, the app can use all of the resources that it requires (i.e. no memory or CPU amount restrictions) and you can assume that the user is viewing your app and actively interacting with it.
The Thumbnail state occurs when the app is sent to the background and becomes a thumbnail. In this state, as you are viewing the thumbnail of your app, no other app is running in a full screen state. By default, the thumbnail image, called the cover, is the scaled-down version of the screenshot before the app was minimized.
The Invisible state occurs when the app is not visible anywhere on the screen. This state can include when another app is taking up the foreground partition and when the screen is dimmed, amongst others. In this state, without the run_when_backgrounded permission, the app is considered stopped and won’t receive any processing time.
Your code needs to receive the navigator event, signal the app's transition between the states above, and respond to them accordingly in your code.