Skip to content

Commit

Permalink
Default isLowRam to true on APIs < 19.
Browse files Browse the repository at this point in the history
Fixes #2650.
  • Loading branch information
sjudd committed Dec 21, 2017
1 parent 6c7cf3f commit b221d4b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ private static boolean isLowMemoryDevice(ActivityManager activityManager) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
return activityManager.isLowRamDevice();
} else {
return false;
return true;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public class MemorySizeCalculatorTest {
@Before
public void setUp() {
initialSdkVersion = Build.VERSION.SDK_INT;
Util.setSdkVersionInt(18);
harness = new MemorySizeHarness();
}

Expand Down Expand Up @@ -139,7 +138,6 @@ public void testCumulativePoolAndMemoryCacheSizesAreSmallerOnLowMemoryDevices()
@Test
public void testByteArrayPoolSize_withLowRamDevice_isHalfTheSpecifiedBytes() {
LowRamActivityManager activityManager = Shadow.extract(harness.activityManager);
Util.setSdkVersionInt(19);
activityManager.setMemoryClass(getLargeEnoughMemoryClass());
activityManager.setIsLowRam();

Expand Down

0 comments on commit b221d4b

Please sign in to comment.