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
  • Loading branch information
sjudd committed Aug 15, 2015
1 parent 125f5b3 commit 9f550c2
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,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;
}
}

private static class DisplayMetricsScreenDimensions implements ScreenDimensions {
Expand Down

0 comments on commit 9f550c2

Please sign in to comment.