I am debugging some code where A service adds a system alert window on top of an activity as a result of a key event.
The window has input fields, for which the keyboard gets displayed which clears the fullscreen flags which the top activity had set when it was created.
This can only happen if the top activity wasn't sent to the background when the service added the system_alert_window on top of the activity.
Thus i wanted to confirm whether, an activity goes to background or onPause() when a system_alert_window is added on top of it, like would happen if an another activity starts on top of it.
I did more research as part of an ongoing bug to modify AOSP.
In the process, i learnt that
No opening an alert window on top of an activity shouldn't and doesn't send it to background or call onPause().
The activity window is no more in focus, when an alert window gets opened on top of it, but the activity view is still visible, ie. view.visibility =VISIBLE.
When the overlay window is exited, the activity window again gains focus.