Skip to content
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

Merged
merged 1 commit into from Jan 5, 2015
Merged

Conversation

dnkoutso
Copy link
Collaborator

closes #438

@dnkoutso dnkoutso added this to the Picasso 2.5 milestone Dec 31, 2014
@dnkoutso dnkoutso force-pushed the dimitris/network-policy branch 2 times, most recently from 8e90794 to bc6a4ae Compare December 31, 2014 02:40
return (networkPolicy & NetworkPolicy.NO_STORE.index) == 0;
}

static boolean isOfflineOnly(int networkPolicy) {
Copy link
Member

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?

@dnkoutso dnkoutso force-pushed the dimitris/network-policy branch 7 times, most recently from cf193cd to 4269d61 Compare January 1, 2015 23:15
@dnkoutso dnkoutso changed the title Do not merge - Introduce Network Policy API Introduce Network Policy API Jan 1, 2015
@dnkoutso
Copy link
Collaborator Author

dnkoutso commented Jan 1, 2015

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) {
Copy link
Member

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

@JakeWharton
Copy link
Member

Rebase

/** Skips checking the disk cache and forces loading through the network. */
NO_CACHE(1 << 0),

/** Skips storing the result into the disk cache.
Copy link
Member

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

JakeWharton added a commit that referenced this pull request Jan 5, 2015
@JakeWharton JakeWharton merged commit 3b7300b into master Jan 5, 2015
@JakeWharton JakeWharton deleted the dimitris/network-policy branch January 5, 2015 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Declarative Cache Control API
3 participants