OSDN Git Service

Fix http://b/issue?id=2052775. According to the comment, we try to call
authorGrace Kloba <klobag@google.com>
Thu, 13 Aug 2009 21:55:06 +0000 (14:55 -0700)
committerGrace Kloba <klobag@google.com>
Thu, 13 Aug 2009 21:55:06 +0000 (14:55 -0700)
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

index 93ba1b1..b58af66 100644 (file)
@@ -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);
                 }