Merge "Need to check current user when triggering notification lights" am: 819d39bf3e am: 5fc7c9d63a am: 7200f667be
Change-Id: I5368c6f46e7dbbb43b180dcc0370e67e899c54a1
This commit is contained in:
@@ -6873,6 +6873,10 @@ public class NotificationManagerService extends SystemService {
|
||||
if (isInCall() || mScreenOn) {
|
||||
return false;
|
||||
}
|
||||
// check current user
|
||||
if (!isNotificationForCurrentUser(record)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1345,6 +1345,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 {
|
||||
NotificationChannel ringtoneChannel =
|
||||
|
||||
Reference in New Issue
Block a user