Hide toast windows when permissions UI shown

When the permissions UI is showing we are hiding the
system alrert windows that can overlay it in an attempt
to redress the UI. It is however, also possible to use a
toast window to overlay the permissions UI. This change
makes sure we hide the toasts in addition to system
alert windows when the permissions UI is showing.


Change-Id: Ifb9ecf4593ca24b628212f0737d574a537f0cccd
(cherry picked from commit cc5e0323e83d6124f45ca75f55bc58793b550035)
diff --git a/src/com/android/packageinstaller/permission/ui/OverlayTouchActivity.java b/src/com/android/packageinstaller/permission/ui/OverlayTouchActivity.java
index b23ab2e..a7800ca 100644
--- a/src/com/android/packageinstaller/permission/ui/OverlayTouchActivity.java
+++ b/src/com/android/packageinstaller/permission/ui/OverlayTouchActivity.java
@@ -40,6 +40,8 @@
         if (appOpsManager != null) {
                     !allowed, mToken);
+            appOpsManager.setUserRestriction(AppOpsManager.OP_TOAST_WINDOW,
+                    !allowed, mToken);