Loading services/core/java/com/android/server/notification/NotificationManagerService.java +4 −0 Original line number Diff line number Diff line Loading @@ -6065,6 +6065,10 @@ public class NotificationManagerService extends SystemService { if (isInCall() || mScreenOn) { return false; } // check current user if (!isNotificationForCurrentUser(record)) { return false; } return true; } Loading services/tests/uiservicestests/src/com/android/server/notification/BuzzBeepBlinkTest.java +16 −0 Original line number Diff line number Diff line Loading @@ -1291,6 +1291,22 @@ public class BuzzBeepBlinkTest extends UiServiceTestCase { assertEquals(-1, group.getLastAudiblyAlertedMs()); } @Test public void testLightsCheckCurrentUser() { final Notification n = new Builder(getContext(), "test") .setSmallIcon(android.R.drawable.sym_def_app_icon).build(); int userId = mUser.getIdentifier() + 10; 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); verifyNeverLights(); assertFalse(r.isInterruptive()); assertEquals(-1, r.getLastAudiblyAlertedMs()); } @Test public void testListenerHintCall() throws Exception { NotificationRecord r = getCallRecord(1, true); Loading Loading
services/core/java/com/android/server/notification/NotificationManagerService.java +4 −0 Original line number Diff line number Diff line Loading @@ -6065,6 +6065,10 @@ public class NotificationManagerService extends SystemService { if (isInCall() || mScreenOn) { return false; } // check current user if (!isNotificationForCurrentUser(record)) { return false; } return true; } Loading
services/tests/uiservicestests/src/com/android/server/notification/BuzzBeepBlinkTest.java +16 −0 Original line number Diff line number Diff line Loading @@ -1291,6 +1291,22 @@ public class BuzzBeepBlinkTest extends UiServiceTestCase { assertEquals(-1, group.getLastAudiblyAlertedMs()); } @Test public void testLightsCheckCurrentUser() { final Notification n = new Builder(getContext(), "test") .setSmallIcon(android.R.drawable.sym_def_app_icon).build(); int userId = mUser.getIdentifier() + 10; 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); verifyNeverLights(); assertFalse(r.isInterruptive()); assertEquals(-1, r.getLastAudiblyAlertedMs()); } @Test public void testListenerHintCall() throws Exception { NotificationRecord r = getCallRecord(1, true); Loading