Revoke SYSTEM_ALERT_WINDOW visibility when AppOp reverts to MODE_DEFAULT

When a temporary OP_SYSTEM_ALERT_WINDOW grant (e.g. from MediaProjection)
ends, the AppOp mode reverts to MODE_DEFAULT. WindowState.updateAppOpsState()
should check if the app has the static SYSTEM_ALERT_WINDOW permission
when the mode is MODE_DEFAULT. If it does not, visibility should be revoked.

Previously, updateAppOpsState() treated MODE_DEFAULT as allowed,
allowing unprivileged overlays to remain visible after the temporary
grant expired.

Bug: 523171206
Test: atest WmTests:WindowStateTests
Flag: EXEMPT CVE_FIX

TAG=agy
CONV=fde7ae22-eecb-40fc-8adf-365e8e59f3bf
Cherrypick-From: https://googleplex-android-review.googlesource.com/q/commit:d3342b34a80e84929a9d3fa2f8cc60e56e5f1136
Merged-In: I6d3b0e8f7eb01afe858bd9091b7dc616dfcf5aaa
Change-Id: I6d3b0e8f7eb01afe858bd9091b7dc616dfcf5aaa
1 file changed