Loading services/core/java/com/android/server/notification/NotificationManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -3962,7 +3962,7 @@ public class NotificationManagerService extends SystemService { } } private static boolean isUidSystem(int uid) { protected static boolean isUidSystem(int uid) { final int appid = UserHandle.getAppId(uid); return (appid == Process.SYSTEM_UID || appid == Process.PHONE_UID || uid == 0); } Loading services/core/java/com/android/server/notification/NotificationRecord.java +6 −0 Original line number Diff line number Diff line Loading @@ -136,6 +136,12 @@ public final class NotificationRecord { private boolean isPreChannelsNotification() { try { if (NotificationChannel.DEFAULT_CHANNEL_ID.equals(getChannel().getId())) { final boolean isSystemNotification = NotificationManagerService.isUidSystem(sbn.getUid()) || ("android".equals(sbn.getPackageName())); if (isSystemNotification) { return false; } final ApplicationInfo applicationInfo = mContext.getPackageManager().getApplicationInfoAsUser(sbn.getPackageName(), 0, sbn.getUserId()); Loading services/tests/notification/src/com/android/server/notification/NotificationRecordTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -59,7 +59,7 @@ public class NotificationRecordTest { @Mock PackageManager mPm; private final String pkg = "com.android.server.notification"; private final int uid = 0; private final int uid = 9583; private final String pkg2 = "pkg2"; private final int uid2 = 1111111; private final int id1 = 1; Loading Loading
services/core/java/com/android/server/notification/NotificationManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -3962,7 +3962,7 @@ public class NotificationManagerService extends SystemService { } } private static boolean isUidSystem(int uid) { protected static boolean isUidSystem(int uid) { final int appid = UserHandle.getAppId(uid); return (appid == Process.SYSTEM_UID || appid == Process.PHONE_UID || uid == 0); } Loading
services/core/java/com/android/server/notification/NotificationRecord.java +6 −0 Original line number Diff line number Diff line Loading @@ -136,6 +136,12 @@ public final class NotificationRecord { private boolean isPreChannelsNotification() { try { if (NotificationChannel.DEFAULT_CHANNEL_ID.equals(getChannel().getId())) { final boolean isSystemNotification = NotificationManagerService.isUidSystem(sbn.getUid()) || ("android".equals(sbn.getPackageName())); if (isSystemNotification) { return false; } final ApplicationInfo applicationInfo = mContext.getPackageManager().getApplicationInfoAsUser(sbn.getPackageName(), 0, sbn.getUserId()); Loading
services/tests/notification/src/com/android/server/notification/NotificationRecordTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -59,7 +59,7 @@ public class NotificationRecordTest { @Mock PackageManager mPm; private final String pkg = "com.android.server.notification"; private final int uid = 0; private final int uid = 9583; private final String pkg2 = "pkg2"; private final int uid2 = 1111111; private final int id1 = 1; Loading