Use setHideOverlayWindows instead of AppOpsManager ... to hide non-system overlay windows Previously, DeviceAdminAdd added the check in onResume, and removed the check in onPause. However it didn't stop overlay window showing again without SYSTEM_ALERT_WINDOW permission when the restrictions are released. This fix use Window#setHideOverlayWindows mechanism instead to prevent any non-system overlay window shown on top of the window. Test: presubmit Bug: 463364901 Flag: EXEMPT bugfix Cherrypick-From: https://googleplex-android-review.googlesource.com/q/commit:c5f056067eb6d0f2ca3d2502bcee798c99cd2ef2 Cherrypick-From: https://googleplex-android-review.googlesource.com/q/commit:02835b1f6b008c5fe871fbbb1b4322e7f790dbe6 Merged-In: Iff59eec12280db291f153e32691187a503118b9d Change-Id: Iff59eec12280db291f153e32691187a503118b9d