Skip to content

Commit

Permalink
Don't rely on short-circuiting for sdk checks.
Browse files Browse the repository at this point in the history
Fixes bumptech#578.
Conflicts:
	library/src/main/java/com/bumptech/glide/load/engine/cache/MemorySizeCalculator.java
	library/src/test/resources/exif-orientation-examples
  • Loading branch information
sjudd committed Nov 4, 2015
1 parent 3534357 commit 0a082ca
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,11 @@ private String toMb(int bytes) {

@TargetApi(Build.VERSION_CODES.KITKAT)
private static boolean isLowMemoryDevice(ActivityManager activityManager) {
final int sdkInt = Build.VERSION.SDK_INT;
return sdkInt < Build.VERSION_CODES.HONEYCOMB
|| (sdkInt >= Build.VERSION_CODES.KITKAT && activityManager.isLowRamDevice());
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
return activityManager.isLowRamDevice();
} else {
return Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB;
}
}

/**
Expand Down Expand Up @@ -232,7 +234,7 @@ public MemorySizeCalculator build() {
return new MemorySizeCalculator(context, activityManager, screenDimensions,
memoryCacheScreens, bitmapPoolScreens, arrayPoolSizeBytes, maxSizeMultiplier,
lowMemoryMaxSizeMultiplier);
}
}
}

private static final class DisplayMetricsScreenDimensions implements ScreenDimensions {
Expand Down

0 comments on commit 0a082ca

Please sign in to comment.