Commit aee9c152 authored by Evan Stade's avatar Evan Stade Committed by Chromium LUCI CQ

Fix flaky failure in MediaCaptureTest

Bug: 1161031
Change-Id: I87886fe6c86580299474fafab76a70eaf74964fb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2639940Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Evan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#845676}
parent d2347bcf
...@@ -242,10 +242,16 @@ public final class MediaCaptureTest { ...@@ -242,10 +242,16 @@ public final class MediaCaptureTest {
*/ */
@TargetApi(Build.VERSION_CODES.M) @TargetApi(Build.VERSION_CODES.M)
private Notification getMediaCaptureNotification() { private Notification getMediaCaptureNotification() {
StatusBarNotification notifications[] = StatusBarNotification notifications[];
((NotificationManager) mActivity.getApplicationContext().getSystemService( try {
Context.NOTIFICATION_SERVICE)) // Workaround for Android bug fixed in 34a80841cb8fa8cdbe6c584831f0e531618d331d.
.getActiveNotifications(); notifications =
((NotificationManager) mActivity.getApplicationContext().getSystemService(
Context.NOTIFICATION_SERVICE))
.getActiveNotifications();
} catch (NullPointerException e) {
return null;
}
Notification notification = null; Notification notification = null;
for (StatusBarNotification statusBarNotification : notifications) { for (StatusBarNotification statusBarNotification : notifications) {
if (statusBarNotification.getTag().equals("org.chromium.weblayer.webrtc.avstream")) { if (statusBarNotification.getTag().equals("org.chromium.weblayer.webrtc.avstream")) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment