Migrate managed services from setting to policy xml

Change-Id: Ie20f91dbdd0ba6b57b5909cbf0152a32754fe02d
Fixes: 62263757
Test: runtest systemui-notification, cts AudioManagerTest,
cts-verifier DND tests, verify bug reports after toggling
access for various types of managed services, verified
default approved services aren't renabled on boot; verified that
they are reenabled after a device reset, verified that
settings are migrated after a restore from OC backup.
diff --git a/core/java/android/app/INotificationManager.aidl b/core/java/android/app/INotificationManager.aidl
index 1c1883b..08821be 100644
--- a/core/java/android/app/INotificationManager.aidl
+++ b/core/java/android/app/INotificationManager.aidl
@@ -116,6 +116,16 @@
     boolean matchesCallFilter(in Bundle extras);
     boolean isSystemConditionProviderEnabled(String path);
 
+    boolean isNotificationListenerAccessGranted(in ComponentName listener);
+    boolean isNotificationListenerAccessGrantedForUser(in ComponentName listener, int userId);
+    boolean isNotificationAssistantAccessGranted(in ComponentName assistant);
+    void setNotificationListenerAccessGranted(in ComponentName listener, boolean enabled);
+    void setNotificationAssistantAccessGranted(in ComponentName assistant, boolean enabled);
+    void setNotificationListenerAccessGrantedForUser(in ComponentName listener, int userId, boolean enabled);
+    void setNotificationAssistantAccessGrantedForUser(in ComponentName assistant, int userId, boolean enabled);
+    List<String> getEnabledNotificationListenerPackages();
+    List<ComponentName> getEnabledNotificationListeners(int userId);
+
     int getZenMode();
     ZenModeConfig getZenModeConfig();
     oneway void setZenMode(int mode, in Uri conditionId, String reason);
@@ -123,7 +133,6 @@
     boolean isNotificationPolicyAccessGranted(String pkg);
     NotificationManager.Policy getNotificationPolicy(String pkg);
     void setNotificationPolicy(String pkg, in NotificationManager.Policy policy);
-    String[] getPackagesRequestingNotificationPolicyAccess();
     boolean isNotificationPolicyAccessGrantedForPackage(String pkg);
     void setNotificationPolicyAccessGranted(String pkg, boolean granted);
     AutomaticZenRule getAutomaticZenRule(String id);