Loading services/core/java/com/android/server/notification/NotificationManagerService.java +9 −5 Original line number Diff line number Diff line Loading @@ -806,7 +806,7 @@ public class NotificationManagerService extends SystemService { if (DBG) Slog.d(TAG, "loadPolicyFile"); synchronized (mPolicyFile) { InputStream infile = null; mListeners.loadForceNotificationEnabledServices(); mListeners.loadForceNotificationEnabledServices(USER_SYSTEM); try { infile = mPolicyFile.openRead(); readPolicyXml(infile, false /*forRestore*/, UserHandle.USER_ALL); Loading Loading @@ -9566,7 +9566,7 @@ public class NotificationManagerService extends SystemService { } protected void loadForceNotificationEnabledServices() { protected void loadForceNotificationEnabledServices(int userId) { String forceEnabledPackages = mContext.getResources().getString( R.string.config_forceNotificationPermission); Loading @@ -9574,16 +9574,20 @@ public class NotificationManagerService extends SystemService { String[] packages = forceEnabledPackages.split(ManagedServices.ENABLED_SERVICES_SEPARATOR); for (int i = 0; i < packages.length; i++) { if (TextUtils.isEmpty(packages[i])) { String pkg = packages[i]; if (TextUtils.isEmpty(pkg)) { continue; } allowDndPackage(pkg); ArraySet<ComponentName> approvedListeners = this.queryPackageForServices(packages[i], this.queryPackageForServices(pkg, MATCH_DIRECT_BOOT_AWARE | MATCH_DIRECT_BOOT_UNAWARE, USER_SYSTEM); for (int k = 0; k < approvedListeners.size(); k++) { ComponentName cn = approvedListeners.valueAt(k); addDefaultComponentOrPackage(cn.flattenToString()); allowNotificationListener(userId, cn); } } } Loading Loading
services/core/java/com/android/server/notification/NotificationManagerService.java +9 −5 Original line number Diff line number Diff line Loading @@ -806,7 +806,7 @@ public class NotificationManagerService extends SystemService { if (DBG) Slog.d(TAG, "loadPolicyFile"); synchronized (mPolicyFile) { InputStream infile = null; mListeners.loadForceNotificationEnabledServices(); mListeners.loadForceNotificationEnabledServices(USER_SYSTEM); try { infile = mPolicyFile.openRead(); readPolicyXml(infile, false /*forRestore*/, UserHandle.USER_ALL); Loading Loading @@ -9566,7 +9566,7 @@ public class NotificationManagerService extends SystemService { } protected void loadForceNotificationEnabledServices() { protected void loadForceNotificationEnabledServices(int userId) { String forceEnabledPackages = mContext.getResources().getString( R.string.config_forceNotificationPermission); Loading @@ -9574,16 +9574,20 @@ public class NotificationManagerService extends SystemService { String[] packages = forceEnabledPackages.split(ManagedServices.ENABLED_SERVICES_SEPARATOR); for (int i = 0; i < packages.length; i++) { if (TextUtils.isEmpty(packages[i])) { String pkg = packages[i]; if (TextUtils.isEmpty(pkg)) { continue; } allowDndPackage(pkg); ArraySet<ComponentName> approvedListeners = this.queryPackageForServices(packages[i], this.queryPackageForServices(pkg, MATCH_DIRECT_BOOT_AWARE | MATCH_DIRECT_BOOT_UNAWARE, USER_SYSTEM); for (int k = 0; k < approvedListeners.size(); k++) { ComponentName cn = approvedListeners.valueAt(k); addDefaultComponentOrPackage(cn.flattenToString()); allowNotificationListener(userId, cn); } } } Loading