Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7621b65d authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Need to check current user when triggering notification lights" am:...

Merge "Need to check current user when triggering notification lights" am: 819d39bf am: 5fc7c9d6 am: 7200f667 am: 39333aa1 am: d1ac608e

Change-Id: I5b2643c3178313f7220f7691d1d1b410b719ce8b
parents b40aa702 d1ac608e
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -6876,6 +6876,10 @@ public class NotificationManagerService extends SystemService {
        if (isInCall() || mScreenOn) {
            return false;
        }
        // check current user
        if (!isNotificationForCurrentUser(record)) {
            return false;
        }

        return true;
    }
+16 −0
Original line number Diff line number Diff line
@@ -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 =