| Index: chrome/android/java/src/org/chromium/chrome/browser/download/SystemDownloadNotifier.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/SystemDownloadNotifier.java b/chrome/android/java/src/org/chromium/chrome/browser/download/SystemDownloadNotifier.java
|
| index de1d292fdc8e4b5e6d990abcd70b9847ce4fcd63..5b6a2766b718475f25b0f1f4935af1841e8379d5 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/download/SystemDownloadNotifier.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/SystemDownloadNotifier.java
|
| @@ -111,7 +111,7 @@ public class SystemDownloadNotifier implements DownloadNotifier {
|
| void handlePendingNotifications() {
|
| if (mPendingNotifications.isEmpty()) return;
|
| for (PendingNotificationInfo info : mPendingNotifications) {
|
| - updateDownloadNotificationOnUiThread(info);
|
| + updateDownloadNotification(info);
|
| }
|
| mPendingNotifications.clear();
|
| }
|
| @@ -227,25 +227,12 @@ public class SystemDownloadNotifier implements DownloadNotifier {
|
| }
|
|
|
| /**
|
| - * Helper method to schedule download notification updates, can be called on any thread.
|
| + * Helper method to schedule download notification updates.
|
| * @param info Pending notification information to be handled.
|
| */
|
| - private void updateDownloadNotification(final PendingNotificationInfo notificationInfo) {
|
| - ThreadUtils.postOnUiThread(new Runnable() {
|
| - @Override
|
| - public void run() {
|
| - updateDownloadNotificationOnUiThread(notificationInfo);
|
| - }
|
| - });
|
| - }
|
| -
|
| - /**
|
| - * Updates the download notification on UI thread if the notification service is started.
|
| - * Otherwise, wait for the notification service to become ready.
|
| - * @param info Pending notification information to be handled.
|
| - */
|
| - private void updateDownloadNotificationOnUiThread(
|
| - final PendingNotificationInfo notificationInfo) {
|
| + @VisibleForTesting
|
| + void updateDownloadNotification(final PendingNotificationInfo notificationInfo) {
|
| + assert ThreadUtils.runningOnUiThread();
|
| startAndBindToServiceIfNeeded();
|
| final DownloadInfo info = notificationInfo.downloadInfo;
|
| if (notificationInfo.type == DOWNLOAD_NOTIFICATION_TYPE_PROGRESS) {
|
|
|