Merge "Do not send AccessibilityEvent if notification is for different user." into rvc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
f914ec1768
@@ -7014,7 +7014,8 @@ public class NotificationManagerService extends SystemService {
|
|||||||
&& (record.getSuppressedVisualEffects() & SUPPRESSED_EFFECT_STATUS_BAR) != 0;
|
&& (record.getSuppressedVisualEffects() & SUPPRESSED_EFFECT_STATUS_BAR) != 0;
|
||||||
if (!record.isUpdate
|
if (!record.isUpdate
|
||||||
&& record.getImportance() > IMPORTANCE_MIN
|
&& record.getImportance() > IMPORTANCE_MIN
|
||||||
&& !suppressedByDnd) {
|
&& !suppressedByDnd
|
||||||
|
&& isNotificationForCurrentUser(record)) {
|
||||||
sendAccessibilityEvent(record);
|
sendAccessibilityEvent(record);
|
||||||
sentAccessibilityEvent = true;
|
sentAccessibilityEvent = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1274,6 +1274,21 @@ public class BuzzBeepBlinkTest extends UiServiceTestCase {
|
|||||||
verify(mAccessibilityService, times(1)).sendAccessibilityEvent(any(), anyInt());
|
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
|
@Test
|
||||||
public void testLightsScreenOn() {
|
public void testLightsScreenOn() {
|
||||||
mService.mScreenOn = true;
|
mService.mScreenOn = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user