Commit bc218365 authored by Joy Ming's avatar Joy Ming Committed by Commit Bot

Disable StrictMode during notification call in DNS2.

There was a bug with a Strict Mode violation during the
NotificationManager.notify call in DownloadNotificationService2 due to
Samsung Knox. This CL fixes that by disabling Strict Mode during that
specific call.

Bug: 789134
Change-Id: Ie1ba03c1cbef942df2c832529ca85323f73dd2be
Reviewed-on: https://chromium-review.googlesource.com/804966Reviewed-by: default avatarDavid Trainor <dtrainor@chromium.org>
Reviewed-by: default avatarTommy Nyquist <nyquist@chromium.org>
Commit-Queue: Joy Ming <jming@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521795}
parent 9ee20d22
......@@ -24,6 +24,7 @@ import android.text.TextUtils;
import org.chromium.base.ApiCompatibilityUtils;
import org.chromium.base.ApplicationStatus;
import org.chromium.base.ContextUtils;
import org.chromium.base.StrictModeContext;
import org.chromium.base.VisibleForTesting;
import org.chromium.base.library_loader.LibraryProcessType;
import org.chromium.chrome.R;
......@@ -455,7 +456,10 @@ public class DownloadNotificationService2 {
@VisibleForTesting
void updateNotification(int id, Notification notification) {
// TODO(b/65052774): Add back NOTIFICATION_NAMESPACE when able to.
mNotificationManager.notify(id, notification);
// Disabling StrictMode to avoid violations (crbug.com/789134).
try (StrictModeContext unused = StrictModeContext.allowDiskReads()) {
mNotificationManager.notify(id, notification);
}
}
private void updateNotification(int notificationId, Notification notification, ContentId id,
......
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