Fix crash/OOM in DiskBasedCache

DiskBasedCache.writeHeader() can throw an IOException and swallow it. This causes the
cache entry to be partially written followed by the entry's data. When reading back,
it is possible to read back the data segment (garbled part) when attempting to parse
the cache header.

Change-Id: I3022ca1566bc60e5869bb4ec384c866b4ba5c1c5
Merge "Fix crash/OOM in DiskBasedCache"
allow use of custom ImageRequests in ImageLoader

This seems like the smallest change that will allow developers to
supply their own ImageRequest class to the ImageLoader without
changing the API. There are several use cases for supplying
custom ImageRequests, including setting custom headers, adjusting
the priority of ImageRequests, and working around Issue #71928.

Change-Id: Ic47452b5f8cada2491a6513cb56f383261c73c3a
Improve DiskBasedCache initial scan performance

Using a BufferedInputStream significantly reduces the time it takes
to initialize the cache. On my Nexus 5 with ~330 files in cache init
time went from ~2s to ~0.5s with this change.

Change-Id: I3dd909e3235583306ff5943f69e3947a275bf968
Signed-off-by: Fabian Frank <fabian.frank.de@gmail.com>
Merge "Improve DiskBasedCache initial scan performance"
Add a public accessor for a Request's ErrorListener.

Add a public accessor for a Request's ErrorListener.

Change-Id: Ifd3b8f818dd0e9db0183f08321043aae7c92c72c
Signed-off-by: Shirish Kalele <kalele@google.com>
Merge "Add a public accessor for a Request's ErrorListener."
Merge "allow use of custom ImageRequests in ImageLoader"
Don't hold onto requests indefinitely.

Move the request into NetworkDispatcher's loop so that the previously
processed request's reference is not held until the next request
comes off the queue.
Merge "Don't hold onto requests indefinitely."
Add locale to HttpHeaderParserTest.rfc1123Date(long millis)

There is a DateParseException when the test runs on a german system
org.apache.http.impl.cookie.DateParseException: Unable to parse the date So., 21 Sep. 2014 22:43:50 MESZ

Change-Id: I8a52af1dfc24d82f8f6157ff7d661014f1ee8d26
Merge "Add locale to HttpHeaderParserTest.rfc1123Date(long millis)"
configure Gradle build to use parent project tools & sdk settings
adding a more comprehensive .gitignore file