Loading services/core/java/com/android/server/notification/NotificationManagerService.java +2 −1 Original line number Diff line number Diff line Loading @@ -5922,7 +5922,8 @@ public class NotificationManagerService extends SystemService { boolean sentAccessibilityEvent = false; // If the notification will appear in the status bar, it should send an accessibility // event if (!record.isUpdate && record.getImportance() > IMPORTANCE_MIN) { if (!record.isUpdate && record.getImportance() > IMPORTANCE_MIN && isNotificationForCurrentUser(record)) { sendAccessibilityEvent(record); sentAccessibilityEvent = true; } Loading services/tests/uiservicestests/src/com/android/server/notification/BuzzBeepBlinkTest.java +15 −0 Original line number Diff line number Diff line Loading @@ -1220,6 +1220,21 @@ public class BuzzBeepBlinkTest extends UiServiceTestCase { verify(mAccessibilityService, times(1)).sendAccessibilityEvent(any(), anyInt()); } @Test public void testA11yCrossUserEventNotSent() throws Exception { final Notification n = new Builder(getContext(), "test") .setSmallIcon(android.R.drawable.sym_def_app_icon).build(); int userId = mUser.getIdentifier() + 1; StatusBarNotification sbn = new StatusBarNotification(mPkg, mPkg, 0, mTag, mUid, mPid, n, UserHandle.of(userId), null, System.currentTimeMillis()); NotificationRecord r = new NotificationRecord(getContext(), sbn, new NotificationChannel("test", "test", IMPORTANCE_HIGH)); mService.buzzBeepBlinkLocked(r); verify(mAccessibilityService, never()).sendAccessibilityEvent(any(), anyInt()); } @Test public void testLightsScreenOn() { mService.mScreenOn = true; Loading Loading
services/core/java/com/android/server/notification/NotificationManagerService.java +2 −1 Original line number Diff line number Diff line Loading @@ -5922,7 +5922,8 @@ public class NotificationManagerService extends SystemService { boolean sentAccessibilityEvent = false; // If the notification will appear in the status bar, it should send an accessibility // event if (!record.isUpdate && record.getImportance() > IMPORTANCE_MIN) { if (!record.isUpdate && record.getImportance() > IMPORTANCE_MIN && isNotificationForCurrentUser(record)) { sendAccessibilityEvent(record); sentAccessibilityEvent = true; } Loading
services/tests/uiservicestests/src/com/android/server/notification/BuzzBeepBlinkTest.java +15 −0 Original line number Diff line number Diff line Loading @@ -1220,6 +1220,21 @@ public class BuzzBeepBlinkTest extends UiServiceTestCase { verify(mAccessibilityService, times(1)).sendAccessibilityEvent(any(), anyInt()); } @Test public void testA11yCrossUserEventNotSent() throws Exception { final Notification n = new Builder(getContext(), "test") .setSmallIcon(android.R.drawable.sym_def_app_icon).build(); int userId = mUser.getIdentifier() + 1; StatusBarNotification sbn = new StatusBarNotification(mPkg, mPkg, 0, mTag, mUid, mPid, n, UserHandle.of(userId), null, System.currentTimeMillis()); NotificationRecord r = new NotificationRecord(getContext(), sbn, new NotificationChannel("test", "test", IMPORTANCE_HIGH)); mService.buzzBeepBlinkLocked(r); verify(mAccessibilityService, never()).sendAccessibilityEvent(any(), anyInt()); } @Test public void testLightsScreenOn() { mService.mScreenOn = true; Loading