Fixes OOM bitmap crash.
Change-Id: Ied0293b7f1dbfe16c3517dbb9e2b19c8030d31a5
diff --git a/src/com/android/browser/PhoneUi.java b/src/com/android/browser/PhoneUi.java
index b5d0a38..7ae9bf7 100644
--- a/src/com/android/browser/PhoneUi.java
+++ b/src/com/android/browser/PhoneUi.java
@@ -572,6 +572,10 @@
mTitle.setImageBitmap(mTitleBarBitmap);
mTitle.setVisibility(View.VISIBLE);
// SWE: WebView.draw() wouldn't draw anything if SurfaceView is enabled.
+ if (mContentBitmap != null) {
+ mContentBitmap.recycle();
+ mContentBitmap = null;
+ }
mContentBitmap = web.getViewportBitmap();
if (mContentBitmap == null) {
int h = web.getHeight() - embTbarHeight;