Simplify download flow control, handle redirects.
authorJeff Sharkey <jsharkey@android.com>
Mon, 24 Dec 2012 03:28:09 +0000 (19:28 -0800)
committerJeff Sharkey <jsharkey@android.com>
Thu, 10 Jan 2013 02:32:03 +0000 (18:32 -0800)
commit0de55602ec6d350548248feddc68c91b29326eff
treef64aa79577aa145c331a81bdbf23f12c6e8bd9be
parent8ac10e0e0667a4fe35191deebb5fa9786bf4226c
Simplify download flow control, handle redirects.

Move redirection handling into a single loop, and handle each HTTP
response code inline to make flow control easier to reason about.

Fix race condition in tests by waiting for first status update.

Bug: 7887226
Change-Id: Id4bfd182941baad4cd0bb702376c4beeb7275bb2
src/com/android/providers/downloads/DownloadInfo.java
src/com/android/providers/downloads/DownloadThread.java
src/com/android/providers/downloads/Helpers.java
src/com/android/providers/downloads/StopRequestException.java
tests/src/com/android/providers/downloads/AbstractPublicApiTest.java
tests/src/com/android/providers/downloads/PublicApiFunctionalTest.java