From 918e1d78b2db6ef21c71a07868572d9cda498476 Mon Sep 17 00:00:00 2001 From: Grace Kloba Date: Thu, 13 Aug 2009 14:55:06 -0700 Subject: [PATCH] Fix http://b/issue?id=2052775. According to the comment, we try to call pauseWebView(). But as mActivityInPause is false, pauseWebView doesn't do anything. This cause inbalanced pause/resume and the WebCoreThread's timer is never put on hold even Browser is in the background. --- src/com/android/browser/BrowserActivity.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java index 93ba1b1..b58af66 100644 --- a/src/com/android/browser/BrowserActivity.java +++ b/src/com/android/browser/BrowserActivity.java @@ -2544,8 +2544,17 @@ public class BrowserActivity extends Activity return; } // call pauseWebView() now, we won't be able to call it in - // onPause() as the WebView won't be valid. + // onPause() as the WebView won't be valid. Temporarily + // change mActivityInPause to be true as pauseWebView() will + // do nothing if mActivityInPause is false. + boolean savedState = mActivityInPause; + if (savedState) { + Log.e(LOGTAG, "BrowserActivity is already paused " + + "while handing goBackOnePageOrQuit."); + } + mActivityInPause = true; pauseWebView(); + mActivityInPause = savedState; removeTabFromContentView(current); mTabControl.removeTab(current); } -- 2.11.0