Fix notification bugs, cleanup DownloadService + DownloadReceiver
authorSteve Howard <showard@google.com>
Wed, 15 Sep 2010 19:29:50 +0000 (12:29 -0700)
committerSteve Howard <showard@google.com>
Mon, 20 Sep 2010 18:34:54 +0000 (11:34 -0700)
commit3398db8f3b195959faa2a7cf09918f364432ac28
treeb274d3f30d22bb3d56100cb18e3ade5a83c91b71
parent4bebe75b3e2361d7fb0aa966598c41c45ad9317f
Fix notification bugs, cleanup DownloadService + DownloadReceiver

This change started out just fixing a few regressions related to
notifications:

* Browser downloads weren't picking up a title from the determined
  filename.  This was due to my change to default the title field to
  "" instead of null.

* Notification click/hide events weren't being handled properly.  This
  was due to previous change to the URI structure of DownloadProvider.
  DownloadReceiver needed to be changed to perform queries through
  /all_downloads URIs, like all other parts of the download manager
  code.  I did some general refactoring of the DownloadReceiver code
  while I was there.

* The code in DownloadNotification wasn't picking up some updates to
  downloads properly.  This was due to my change to make
  DownloadNotification use the DownloadInfo objects rather than
  querying the database directly, so that it could make use of info
  provided by the DownloadThread that didn't go into the DB.  Fixing
  this didn't turn out to be all that complicated, but along the way
  to figuring this out I made some substantial refactoring in
  DownloadService which made it much cleaner anyway and eliminated a
  lot of duplication.  That's something that had to happen eventually,
  so I'm leaving it all in.

Change-Id: I847ccf80e3d928c84e36bc24791b33204104e1b2
src/com/android/providers/downloads/DownloadInfo.java
src/com/android/providers/downloads/DownloadNotification.java
src/com/android/providers/downloads/DownloadProvider.java
src/com/android/providers/downloads/DownloadReceiver.java
src/com/android/providers/downloads/DownloadService.java
src/com/android/providers/downloads/RealSystemFacade.java
src/com/android/providers/downloads/SystemFacade.java
tests/src/com/android/providers/downloads/FakeSystemFacade.java
ui/src/com/android/providers/downloads/ui/DownloadList.java