Fixes UI hang issue in browser
- Tab's capture API was not calling OnThumbnailUpdatedListener on
certain conditions. Modified the code to call OnThumbnailUpdatedListener
with empty bitmap to fix the UI hang issue.
diff --git a/src/com/android/browser/Tab.java b/src/com/android/browser/Tab.java
index a7be480..5e1f614 100644
--- a/src/com/android/browser/Tab.java
+++ b/src/com/android/browser/Tab.java
@@ -1902,12 +1902,14 @@
}
protected void capture() {
- if (mMainView == null || mCapture == null) return;
+ boolean returnEmptyCapture = false;
+ if (mMainView == null || mCapture == null || !mMainView.isReady())
+ returnEmptyCapture = true;
if (mMainView.getContentWidth() <= 0 || mMainView.getContentHeight() <= 0) {
- return;
+ returnEmptyCapture = true;
}
- if (!mFirstVisualPixelPainted || mMainView.isShowingCrashView()) {
+ if (returnEmptyCapture || !mFirstVisualPixelPainted || mMainView.isShowingCrashView()) {
mCapture = Bitmap.createBitmap(
mCaptureWidth,
mCaptureHeight,