Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(398)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotificationService.java

Issue 2771353002: Don't force the download notifier to unbind (Closed)
Patch Set: Rebased Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/download/SystemDownloadNotifier.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotificationService.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotificationService.java b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotificationService.java
index 17d11c7cf2e4c1dced3df0404c0ce779b0b593f6..a4a34eaaf06c52f41820b21860be18a3f54b8e4e 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotificationService.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotificationService.java
@@ -112,13 +112,10 @@ public class DownloadNotificationService extends Service {
private static final String KEY_NEXT_DOWNLOAD_NOTIFICATION_ID = "NextDownloadNotificationId";
/**
- * An Observer interface that allows other classes to know when this class wants to shut itself
- * down. This lets them unbind if necessary.
+ * An Observer interface that allows other classes to know when this class is canceling
+ * downloads.
*/
public interface Observer {
- /** Called when this service is about to start attempting to stop itself. */
- void onServiceShutdownRequested();
-
/**
* Called when a download was canceled from the notification. The implementer is not
* responsible for canceling the actual download (that should be triggered internally from
@@ -647,12 +644,10 @@ public class DownloadNotificationService extends Service {
stopForegroundInternal(false);
}
- // Notify all observers that we are requesting a chance to shut down. This will let any
- // observers unbind from us if necessary.
- for (Observer observer : mObservers) observer.onServiceShutdownRequested();
-
// Stop the service which should start the destruction process. At this point we should be
- // (1) a background service and (2) unbound from any clients.
+ // a background service. We might not be unbound from any clients. When they unbind we
+ // will shut down. That is okay because they will only unbind from us when they are ok with
+ // us going away (e.g. we shouldn't be unbound while in the foreground).
stopSelf();
return true;
}
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/download/SystemDownloadNotifier.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698