Skip to content
This repository was archived by the owner on Oct 15, 2018. It is now read-only.
This repository was archived by the owner on Oct 15, 2018. It is now read-only.

RecyclePolicy not interpreted as expected #42

Description

@elroid

I'm having issues with the implementation of the BitmapLruCache$RecyclePolicy.canInBitmap method. Here is how it stands:

boolean canInBitmap() {
    switch (this) {
        case PRE_HONEYCOMB_ONLY:
        case DISABLED:
            return Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB;
    }
    return false;
}

This implies that it will return true (e.g. bitmaps can be re-used) when the policy is set to DISABLED (and you are running on a post-honeycomb device), which i believe is incorrect. May i suggest the following:

boolean canInBitmap() {
    switch (this) {
        case PRE_HONEYCOMB_ONLY:
            return Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB;
        case DISABLED:
            return false;
    }
    return true;
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions