Create DownloadBroadcastManager to handle communication to native

Desktop / Chromium - Joy Ming [chromium.org] - 9 August 2017 12:51 EDT

This is part of a larger refactor to make downloads a foreground service. This handles the propagation of notification interaction to native. Before, the path was DownloadBroadcastReceiver-> DownloadNotificationService->native. This CL takes the logic relating to spinning up and communicating to the native out of the DownloadNotificationService and into DownloadBroadcastManager, making the path DBR->DNS->DBM->native. The reason this still routes through the DownloadNotificationService is because currently DNS still handles some non-native logic (ie. updating the notifications). After the refactor is completed, the notification interaction will no longer have to be routed through the DownloadNotificationService and the path will be DBR->DBM->native, where the DownloadBroadcastManager will be a service that just spins up and communicates to native.

Bug: 747569,747563 Change-Id: I27ff959b31cebba8f44fc2cc1cebfbeaf466cb64 Reviewed-on: https://chromium-review.googlesource.com/581870 Commit-Queue: Joy Ming

fe41630 Create DownloadBroadcastManager to handle communication to native.
.../browser/download/DownloadBroadcastManager.java | 174 +++++++++++++++
.../download/DownloadNotificationService.java | 243 ++++++++-------------
chrome/android/java_sources.gni | 1 +
.../download/DownloadNotificationServiceTest.java | 12 +
.../download/MockDownloadNotificationService.java | 5 -
5 files changed, 280 insertions(+), 155 deletions(-)

Upstream: git.chromium.org


  • Share