Skip to content

Commit 887c2ee

Browse files
author
Romain Guy
committed
Use the actual screen size for the max bitmap cache size.
Change-Id: I2177f91aea7c449c377fde6337180d15487cecef
1 parent 67b3a9e commit 887c2ee

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/java/android/view/ViewConfiguration.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,9 @@ private ViewConfiguration(Context context) {
305305
mScaledTouchExplorationTapSlop = (int) (density * TOUCH_EXPLORATION_TAP_SLOP + 0.5f);
306306
mWindowTouchSlop = (int) (sizeAndDensity * WINDOW_TOUCH_SLOP + 0.5f);
307307

308+
final Display display = WindowManagerImpl.getDefault().getDefaultDisplay();
308309
// Size of the screen in bytes, in ARGB_8888 format
309-
mMaximumDrawingCacheSize = 4 * metrics.widthPixels * metrics.heightPixels;
310+
mMaximumDrawingCacheSize = 4 * display.getRawWidth() * display.getRawHeight();
310311

311312
mOverscrollDistance = (int) (sizeAndDensity * OVERSCROLL_DISTANCE + 0.5f);
312313
mOverflingDistance = (int) (sizeAndDensity * OVERFLING_DISTANCE + 0.5f);

0 commit comments

Comments
 (0)