diff --git a/library/src/main/java/com/bumptech/glide/load/engine/cache/MemorySizeCalculator.java b/library/src/main/java/com/bumptech/glide/load/engine/cache/MemorySizeCalculator.java index e2c56dd001..49ee8459b1 100644 --- a/library/src/main/java/com/bumptech/glide/load/engine/cache/MemorySizeCalculator.java +++ b/library/src/main/java/com/bumptech/glide/load/engine/cache/MemorySizeCalculator.java @@ -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; + } } /** @@ -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 {