Add MANAGE_APP_OVERLAY_PERMISSION intent action

In order to support system use-cases, such as when the user wants do
revoke SYSTEM_ALERT_WINDOW (SAW) permission via notification, we are
introducing a new intent, MANAGE_APP_OVERLAY_PERMISSION (notice the
"APP_"), that directs the user to the app-specific screen to toggle SAW
permission.

The intent can only be started if the caller has INTERNAL_SYSTEM_WINDOW
permission, which sysui and the system have. This is verified in CTS.

In this change we also update usage in NotificationGutsManager and
AlertWindowNotification.

Test: Builds
Test: atest TestManageOverlayPermissionIntents
      (cts in one of the topic CLs)
Test: Let an app draw on top of other apps, via its notification go to
      settings, verify that the screen for controlling such capability
      for the app is dispayed.
Bug: 145198756
Bug: 135920175

Change-Id: Iba29e1eaee729268a4dec9561946f6ed74b36619
diff --git a/services/core/java/com/android/server/wm/AlertWindowNotification.java b/services/core/java/com/android/server/wm/AlertWindowNotification.java
index 9177d25..0de94d9 100644
--- a/services/core/java/com/android/server/wm/AlertWindowNotification.java
+++ b/services/core/java/com/android/server/wm/AlertWindowNotification.java
@@ -21,7 +21,7 @@
 import static android.content.Context.NOTIFICATION_SERVICE;
 import static android.content.Intent.FLAG_ACTIVITY_CLEAR_TASK;
 import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
-import static android.provider.Settings.ACTION_MANAGE_OVERLAY_PERMISSION;
+import static android.provider.Settings.ACTION_MANAGE_APP_OVERLAY_PERMISSION;
 
 import android.app.Notification;
 import android.app.NotificationChannel;
@@ -29,13 +29,11 @@
 import android.app.NotificationManager;
 import android.app.PendingIntent;
 import android.content.Context;
-
 import android.content.Intent;
 import android.content.pm.ApplicationInfo;
 import android.content.pm.PackageManager;
 import android.graphics.Bitmap;
 import android.graphics.drawable.Drawable;
-
 import android.net.Uri;
 import android.os.Bundle;
 
@@ -137,7 +135,7 @@
     }
 
     private PendingIntent getContentIntent(Context context, String packageName) {
-        final Intent intent = new Intent(ACTION_MANAGE_OVERLAY_PERMISSION,
+        final Intent intent = new Intent(ACTION_MANAGE_APP_OVERLAY_PERMISSION,
                 Uri.fromParts("package", packageName, null));
         intent.setFlags(FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_CLEAR_TASK);
         // Calls into activity manager...