RESTRICT AUTOMERGE
Prevent non-system overlays from showing over notification listener consent dialog

Bug: 170731783
Test: use a visible overlay, ensure it's gone when notification consent is open
Change-Id: I58e017982f385ffc0d0ba2174512490b1d83dd36
diff --git a/src/com/android/settings/notification/NotificationAccessConfirmationActivity.java b/src/com/android/settings/notification/NotificationAccessConfirmationActivity.java
index f9eabb9..db75f62 100644
--- a/src/com/android/settings/notification/NotificationAccessConfirmationActivity.java
+++ b/src/com/android/settings/notification/NotificationAccessConfirmationActivity.java
@@ -17,6 +17,8 @@
 
 package com.android.settings.notification;
 
+import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS;
+
 import static com.android.internal.notification.NotificationAccessConfirmationActivityContract
         .EXTRA_COMPONENT_NAME;
 import static com.android.internal.notification.NotificationAccessConfirmationActivityContract
@@ -58,6 +60,8 @@
     protected void onCreate(@Nullable Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
 
+        getWindow().addPrivateFlags(PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);
+
         mNm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
 
         mComponentName = getIntent().getParcelableExtra(EXTRA_COMPONENT_NAME);