summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2011-07-08 14:10:37 -0700
committerJohn Reck <jreck@google.com>2011-07-08 14:21:28 -0700
commita169628f9424256e5bcf45807869c4c4eaa114c0 (patch)
tree509f340f67c5c045d67113df4688a576202d1743 /src
parent15bdd87d767fc105f53e74a83e71967a80b78f89 (diff)
downloadpackages_apps_Browser-a169628f9424256e5bcf45807869c4c4eaa114c0.zip
packages_apps_Browser-a169628f9424256e5bcf45807869c4c4eaa114c0.tar.gz
packages_apps_Browser-a169628f9424256e5bcf45807869c4c4eaa114c0.tar.bz2
Fix bing images crash
Bug: 4517571 Caused by receiving onPageFinished callbacks for in page navigation links (eg, url#something). Also, only post an UPDATE_BOOKMARK_THUMBNAIL message if one is not already pending for the tab. Change-Id: Ia45ae93206507b93ad6fc841ad291b97bc947675
Diffstat (limited to 'src')
-rw-r--r--src/com/android/browser/Controller.java13
-rw-r--r--src/com/android/browser/Tab.java5
2 files changed, 13 insertions, 5 deletions
diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java
index 09c7cd1..f4563bd 100644
--- a/src/com/android/browser/Controller.java
+++ b/src/com/android/browser/Controller.java
@@ -819,13 +819,16 @@ public class Controller
if (!tab.isPrivateBrowsingEnabled()
&& !TextUtils.isEmpty(tab.getUrl())
&& !tab.isSnapshot()) {
+ // Only update the bookmark screenshot if the user did not
+ // cancel the load early and there is not already
+ // a pending update for the tab.
if (tab.inForeground() && !didUserStopLoading()
|| !tab.inForeground()) {
- // Only update the bookmark screenshot if the user did not
- // cancel the load early.
- mHandler.sendMessageDelayed(mHandler.obtainMessage(
- UPDATE_BOOKMARK_THUMBNAIL, 0, 0, tab),
- 500);
+ if (!mHandler.hasMessages(UPDATE_BOOKMARK_THUMBNAIL, tab)) {
+ mHandler.sendMessageDelayed(mHandler.obtainMessage(
+ UPDATE_BOOKMARK_THUMBNAIL, 0, 0, tab),
+ 500);
+ }
}
}
// pause the WebView timer and release the wake lock if it is finished
diff --git a/src/com/android/browser/Tab.java b/src/com/android/browser/Tab.java
index d8a3af9..62b574d 100644
--- a/src/com/android/browser/Tab.java
+++ b/src/com/android/browser/Tab.java
@@ -555,6 +555,11 @@ class Tab {
@Override
public void onPageFinished(WebView view, String url) {
+ if (!mInPageLoad) {
+ // In page navigation links (www.something.com#footer) will
+ // trigger an onPageFinished which we don't care about.
+ return;
+ }
if (!isPrivateBrowsingEnabled()) {
LogTag.logPageFinishedLoading(
url, SystemClock.uptimeMillis() - mLoadStartTime);