Better sanity checking for finished downloads. rel-roth-mp-3-partner rel-roth-ota-1-partner daily-2013.07.26.0_rel-roth-mp-3-partner daily-2013.07.26.1_rel-roth-mp-3-partner daily-2013.07.29.0_rel-roth-mp-3-partner daily-2013.07.29.1_rel-roth-mp-3-partner daily-2013.07.29.2_rel-roth-mp-3-partner daily-2013.07.31.1_rel-roth-ota-1-partner daily-2013.09.09.0_rel-roth-ota-1-partner
authorJeff Sharkey <jsharkey@android.com>
Thu, 25 Oct 2012 00:18:32 +0000 (17:18 -0700)
committerJeff Sharkey <jsharkey@android.com>
Thu, 25 Oct 2012 00:33:06 +0000 (17:33 -0700)
commit2fa007ef678b2283d47d007aa3dc91af683cc52c
tree90b289d03a4aded4f7da35dfaee40c09a1dc27f8
parent169ab531ca6bb2f43ed18fe2b03f66c808f12b81
Better sanity checking for finished downloads.

Downloads in the RUNNING state are considered ready to start so that
downloads are correctly resumed when the process crashes. However,
this causes a race condition while UpdateThread is processing a
Cursor when a DownloadThread finishes.

With this change, DownloadThread now skips requests for downloads
already marked as finished. Apps listening for the DOWNLOAD_COMPLETE
broadcast will no longer see data mutated by the second thread, and
will not see the broadcast duplicated.

Bug: 6948938, 6970458, 6818900
Change-Id: I35deac3cedbfe7f50091fab5818d85594dba558c
src/com/android/providers/downloads/DownloadInfo.java
src/com/android/providers/downloads/DownloadThread.java