Skip to content

Commit e92aad4

Browse files
author
Winson Chung
committed
Increase bitmap memory cap for widgets (Bug 6597440)
Change-Id: I4149b8c5f204f10ebf0ef1f8d03709c0559178d0
1 parent 137bfad commit e92aad4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

services/java/com/android/server/AppWidgetServiceImpl.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,9 @@ void computeMaximumWidgetBitmapMemory() {
190190
WindowManager wm = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
191191
int height = wm.getDefaultDisplay().getRawHeight();
192192
int width = wm.getDefaultDisplay().getRawWidth();
193-
mMaxWidgetBitmapMemory = 4 * width * height;
193+
// Cap memory usage at 1.5 times the size of the display
194+
// 1.5 * 4 bytes/pixel * w * h ==> 6 * w * h
195+
mMaxWidgetBitmapMemory = 6 * width * height;
194196
}
195197

196198
public void systemReady(boolean safeMode) {

0 commit comments

Comments
 (0)