Stop the loading after WAKELOCK_TIMEOUT (5min) when
the Browser is in the background. So we won't continue to
burn the battery if there is some mis-behaved JavaScript
running.
Fix http://b/issue?id=2147840
diff --git a/src/com/android/browser/TabControl.java b/src/com/android/browser/TabControl.java
index 2f15a9c..40f6c31 100644
--- a/src/com/android/browser/TabControl.java
+++ b/src/com/android/browser/TabControl.java
@@ -938,6 +938,16 @@
return null;
}
+ void stopAllLoading() {
+ final int size = getTabCount();
+ for (int i = 0; i < size; i++) {
+ final WebView webview = getTab(i).getTopWindow();
+ if (webview != null) {
+ webview.stopLoading();
+ }
+ }
+ }
+
// This method checks if a non-app tab (one created within the browser)
// matches the given url.
private boolean tabMatchesUrl(Tab t, String url) {