diff options
| author | 2022-08-19 21:59:48 +0000 | |
|---|---|---|
| committer | 2022-08-19 21:59:48 +0000 | |
| commit | d000f2dbec846598d599cf30d4ee710f43ed84a8 (patch) | |
| tree | 868a4dd7ee1ca6eb08ed3d9101985a5648a3b4a7 | |
| parent | 64f36a1646fd96107a13e651d571cd45f8a6a117 (diff) | |
| parent | f914ec1768d06ce756891d0625a27f123a969fbf (diff) | |
Merge "Do not send AccessibilityEvent if notification is for different user." into rvc-dev am: f914ec1768
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19608552
Change-Id: I5c4c7fb48f58441c5cba498916ffb83191599141
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| -rwxr-xr-x | services/core/java/com/android/server/notification/NotificationManagerService.java | 3 | ||||
| -rw-r--r-- | services/tests/uiservicestests/src/com/android/server/notification/BuzzBeepBlinkTest.java | 15 |
2 files changed, 17 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java index c6bb547e6a30..fc46fd0a1ea9 100755 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java @@ -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; } diff --git a/services/tests/uiservicestests/src/com/android/server/notification/BuzzBeepBlinkTest.java b/services/tests/uiservicestests/src/com/android/server/notification/BuzzBeepBlinkTest.java index a21bfda58529..9bf8758c6a8b 100644 --- a/services/tests/uiservicestests/src/com/android/server/notification/BuzzBeepBlinkTest.java +++ b/services/tests/uiservicestests/src/com/android/server/notification/BuzzBeepBlinkTest.java @@ -1282,6 +1282,21 @@ public class BuzzBeepBlinkTest extends UiServiceTestCase { } @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; NotificationRecord r = getLightsNotification(); |