aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2015-05-08Use a BufferedOutputStream to write cache entries.Ficus Kirkpatrick
Turns out to be almost 20% faster in a simple benchmark.
2015-03-19Merge "Add support for all HTTP methods to JsonArrayRequest"Ficus Kirkpatrick
2015-03-19Add support for all HTTP methods to JsonArrayRequestJoris Bolsens
Change-Id: I6e89f69885a63d524c48b1dec54553d6e16edd48 Signed-off-by: Joris Bolsens <epicblood@gmail.com>
2015-03-11Modify header parser to handle must-revalidate.Dave Santoro
This flag indicates that the response must NOT be returned after the cache TTL has expired, but it does not mandate that the response should not be cached at all (which the code was doing previously). Change-Id: I61532f3aa8144c50dcee442dc30215bb81ada868
2015-03-06Fix broken DiskBasedCacheRalph Bergmann
Change-Id: Ia5db47122af11223b55845ef8423424a9cddbb21 Signed-off-by: Ralph Bergmann <ralph@the4thfloor.eu>
2015-03-06Merge "fix ImageLoader.getCacheKey()"Ficus Kirkpatrick
2015-03-06fix ImageLoader.getCacheKey()Ralph Bergmann
The ScaleType was missing. Change-Id: I57cba7cbf60df1e47ea9d8baf480765c6e39d821 Signed-off-by: Ralph Bergmann <ralph@the4thfloor.eu>
2015-03-06clean up a little bitRalph Bergmann
Change-Id: Ibbe796c05e406acd48a0d59090e6be746db24867 Signed-off-by: Ralph Bergmann <ralph@the4thfloor.eu>
2015-02-27Add a RequestFinishedListener to RequestQueue.Brett Chabot
Change-Id: I51a1beacea4e448e71b7e9c3ec580165d799994a
2015-02-25add test for public apiRalph Bergmann
add test for public api. not for all classes but for the most important ones Change-Id: I494f60568c6caafc23754154fe930d9f90a3bde0
2015-02-20Merge "Change the default character encoding for JSON responses to UTF-8"Ficus Kirkpatrick
2015-02-19A little work on unit testing.Ficus Kirkpatrick
Add emma and mockito to the Maven build, and test a couple random things.
2015-02-17Add a backwards-compatible ImageRequest constructor.Ficus Kirkpatrick
Restores the API surface to before ScaleType was required.
2015-02-16Fix volley related build breakage.Narayan Kamath
(cherry picked from commit 46741f2f5165cbf3cdc0c51107e5ffff8002af5b) Change-Id: I6fc32971f03d7958a75250e14a7efdb0a12d8d30
2015-02-15Adds Cache-Control "stale-while-revalidate"Ralph Bergmann
Adds Cache-Control "stale-while-revalidate" header parsing for better server side cache entry expire setup. see: https://www.mnot.net/blog/2007/12/12/stale http://tools.ietf.org/html/rfc5861 https://groups.google.com/a/chromium.org/forum/m/#!msg/chromium-dev/zchogDvIYrY/ZqWSdt3LJdMJ Signed-off-by: Ralph Bergmann <ralph@the4thfloor.eu> Change-Id: I1b7baf9997d3a8a251d21631a11deb503e3a7461
2015-02-15Uses the "Last-Modified" header for "If-Modified-Since"Ralph Bergmann
Uses the "Last-Modified" header for "If-Modified-Since" see http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.3.4 Change-Id: I0f5e9b45f4f79d7c1b286e465f9750dcd71b6bfd Signed-off-by: Ralph Bergmann <ralph@the4thfloor.eu>
2015-02-15Merge "Use the view size and scale type to restrict NIV requests."Ficus Kirkpatrick
2015-02-15Help Robolectric find AndroidManifest.xmlFicus Kirkpatrick
2015-01-20Change the default character encoding for JSON responses to UTF-8Zdeněk Kořán
According to RFC 7159 (Section 8.1), the default encoding of JSON should be UTF-8. Using ISO-8859-1 as default causes incompatibility with some JSON APIs (e.g. wrong interpretation of internationalized strings).
2014-12-15Use the view size and scale type to restrict NIV requests.Ralph Bergmann
Change-Id: I77e705c09937f78af746cd73b6e6d94fd4ee2a03
2014-12-05Migrate from Gradle to Maven.Ficus Kirkpatrick
- Restructure source to src/{main,test} style - Add pom.xml and update Android.mk - Migrate all tests to JUnit4 and Robolectric - RequestQueueTest is currently @Ignored as fixing it will involve more extensive refactoring. - Main library still builds in Gradle; tests do not Change-Id: I1edc53bb1a54f64d3e806e4572901295ef63e2ca
2014-11-04Metric for network time and getBackoffMultiplier()Ivan Stalev
Added networkTimeMs to both NetworkResponse and VolleyError. Set the networkTimeMs in NetworkDispatcher Added getter method for backoff multiplier of RetryPolicy. Change-Id: Ief1e079642fea03fe9c4685bb87a29469ae4b8a7
2014-10-17Clarify javadocs for getBody() and getBodyContentType().Jeff Davidson
Change-Id: I83a538bb466b6fd7801961ef47952009bb0defdb
2014-10-09Merge "HTTP headers are case insensitive per RFC 2616 §4.2 "Message Headers""Ficus Kirkpatrick
2014-10-08HTTP headers are case insensitive per RFC 2616 §4.2 "Message Headers"Ralph Bergmann
Change-Id: I6459f8ecf9f32411ca387631d1298a9ce1c6446b Signed-off-by: Ralph Bergmann <ralph@the4thfloor.eu>
2014-10-07Copy cache header for 304 responseRalph Bergmann
A HTTP 304 response does not have all header fields. We have to copy the header from the cache entry. see http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.5 Change-Id: I197864ad4f2b103edc4a718afea2a35127b7c203 Signed-off-by: Ralph Bergmann <ralph@the4thfloor.eu>
2014-09-03Don't hold onto requests indefinitely.Ficus Kirkpatrick
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.
2014-09-03Merge "allow use of custom ImageRequests in ImageLoader"Ficus Kirkpatrick
2014-08-19Add a public accessor for a Request's ErrorListener.Shirish Kalele
Add a public accessor for a Request's ErrorListener. Change-Id: Ifd3b8f818dd0e9db0183f08321043aae7c92c72c Signed-off-by: Shirish Kalele <kalele@google.com>
2014-08-11Improve DiskBasedCache initial scan performanceFabian Frank
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>
2014-07-16allow use of custom ImageRequests in ImageLoaderKevin Schultz
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
2014-06-24Fix crash/OOM in DiskBasedCacheAurash Mahbod
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
2014-06-16Fixes bug in PATCH method. Sets the method before setting the body.Miguel A. Martin
Just look at PUT and POST methods some lines above. The method is set before calling to addBodyIfExists(). The method should be set before adding the body. Otherwise, some libraries will try to establish a connection with the wrong method (GET by default). Change-Id: I993a62cdc5cbccbf54f9bae4f6b183e2edf4304d
2014-03-29ImageLoader: setError after null checkAndrew Sutherland
if request was canceled it will have already been removed from mInFlightRequests and cause NPE Change-Id: I1ce78bb6b3b2964545a47b5e3bb59bdf1a6d940e
2014-02-27Guard against NullPointerException currentlykang
occurring in Volley when a Request is given a url whose host is null. Change-Id: Idab1dadaa43bb9176356028221cbdc0f8dd52cdc
2014-02-10Fix generic type parameter for RequestQueue.add(Request)Max Cai
Change-Id: If977c965c8ae3b4d00b958e65679e99a1d29a03a
2014-02-08Merge "Allow method chaining on setters"Ficus Kirkpatrick
2014-02-08Use the view size to restrict NIV requests.Aurash Mahbod
Change-Id: Ib09a68c815f147ade31233d03267df687d8341e0
2014-02-08Clean up some warningsFicus Kirkpatrick
2014-02-03Volley to create valid NetworkResponse object when cache is disabledMax Zhou
* Add null check to request.CacheEntry() when creating NetworkResponse. Currently when cache is not used, rather than creating a valid NetworkResponse object, BasicNetwork.performRequest() throws NPE when processing a http 304 no modified response. The NetworkResponse object, if returned with the Volley error, can be used by the volley caller to determine the http status code. Change-Id: I007468ed98fb7ed5719a94f871323466e1bd0f8a
2013-12-19Revert "Revert "Add in additional http request types""Maurice Chu
This reverts commit 9e5c44f22b47fcb0d37c7b10de3b5db542424fa5. Also, to run tests, the android:targetPackage in the <instrumentation>needs to be set to com.android.volley.tests (i.e., the volley_tests apk itself) because volley is just a jar that is statically linked into the test apk. Change-Id: I41ad41e401084b79fbf9712e24d7f7fdeb358223
2013-11-03Fix default image not displaying prior to loadAdam W. Brown
Previously, if a default image was set, it would not be displayed until a network load had begun. In some use cases where the load would not be started until some arbitrary time in the future, this would leave an empty image view visible to the user. This patch checks to see if there is a default image set, and if so, uses that to clear the view, so prior to loading, the defualt image will be shown. Change-Id: I6fcee408d95d708676d68f3f0bc7222e56570f39
2013-10-09make all 2xx be a valid success codesReed Ellsworth
Change-Id: I94313e2f89c38277d36b7a2aaa525862d2740c98
2013-09-12Support no-content (204) requests in BasicNetwork.Ray Colline
When we get an empty response for say, a 204, we create a 0 byte response and pass it on to the NetworkResponse. Implementers of Request can then return appropriate Responses. The behavior before this change results in an NPE because we attempt to getContentLength() bytes from a null entity.. Change-Id: Ia5f92ffd99b8f3e88cc92dc50ba43c4721d83e79 Signed-off-by: Ray Colline <rayc@google.com>
2013-08-20ImageRequest.doParse() now adds NetworkResponse to all ParseError createdEmmanuel Rodriguez
This will help the caller to debug which image couldn't be parsed by peeking at the NetworkResponse. doParse() already returns the NetworkResponse of bitmaps successfully parsed, adding it to failed bitmaps should not take too much overhead.
2013-07-09Remote executable bit from ImageLoaderEvan Charlton
This shouldn't have been executable. Change-Id: Ib5c23ed853a99a4db55f1f2605528f4d9717ad24
2013-07-01NetworkImage - fix nullPointerException.Vladimir Baryshnikov
1. getLayoutParams() can be null. 2. old version used LinearLayout.LayoutParams instead of ViewGroup.LayoutParams
2013-06-26Allow per-app VolleyLog tagsEvan Charlton
To clean up the logs when multiple apps are using Volley, optionally customize the VolleyLog tag so that the app has its own namespace. Change-Id: I5b2129ab41bcfb7f309d324f696f905c98833551
2013-06-24Allow method chaining on settersEvan Charlton
Return "this" from the setter functions so that the methods can be chained. Change-Id: I5b03f1a9f265af451f5b1807347007569483b580
2013-06-21Port CacheHeader away from ObjectOutputStream.Ficus Kirkpatrick
The standard Java serialization system relies heavily on reflection, even for primitive types and Strings, which generates a lot of garbage. Move to a simple built-in implementation. Change-Id: I7f35cbfd1963f2aaf726f5b747cef1b2f8a0ad69