New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce Network Policy API #821
Conversation
8e90794
to
bc6a4ae
Compare
return (networkPolicy & NetworkPolicy.NO_STORE.index) == 0; | ||
} | ||
|
||
static boolean isOfflineOnly(int networkPolicy) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These methods will need to be public, otherwise how do I know what the integer value passed to the Downloader
means?
cf193cd
to
4269d61
Compare
Added some tests. Should be ready now. |
new com.squareup.okhttp.Request.Builder().url(uri.toString()); | ||
@Override public Response load(Uri uri, int networkPolicy) throws IOException { | ||
CacheControl cacheControl = null; | ||
if (networkPolicy > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be != 0
since it's a bit field
Rebase |
4269d61
to
eb60331
Compare
eb60331
to
eb2e973
Compare
/** Skips checking the disk cache and forces loading through the network. */ | ||
NO_CACHE(1 << 0), | ||
|
||
/** Skips storing the result into the disk cache. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: this should be on the next line
Introduce Network Policy API
closes #438