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

Commit d000f2db authored by Daniel Norman's avatar Daniel Norman Committed by Automerger Merge Worker
Browse files

Merge "Do not send AccessibilityEvent if notification is for different user."...

Merge "Do not send AccessibilityEvent if notification is for different user." into rvc-dev am: f914ec17

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19608552



Change-Id: I5c4c7fb48f58441c5cba498916ffb83191599141
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 64f36a16 f914ec17
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -7026,7 +7026,8 @@ public class NotificationManagerService extends SystemService {
                && (record.getSuppressedVisualEffects() & SUPPRESSED_EFFECT_STATUS_BAR) != 0;
        if (!record.isUpdate
                && record.getImportance() > IMPORTANCE_MIN
                && !suppressedByDnd) {
                && !suppressedByDnd
                && isNotificationForCurrentUser(record)) {
            sendAccessibilityEvent(record);
            sentAccessibilityEvent = true;
        }
+15 −0
Original line number Diff line number Diff line
@@ -1281,6 +1281,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;