diff options
author | John Reck <jreck@google.com> | 2012-04-18 17:59:17 -0700 |
---|---|---|
committer | John Reck <jreck@google.com> | 2012-04-18 17:59:17 -0700 |
commit | fd6ad0444174f03c8df95f82a35322c4dd3c2352 (patch) | |
tree | f07e5dd3a1dcb9969302e8f9d5e507f4217011bb /core | |
parent | 3cdfcdc1c4802ecc2f0eb6beb6f7bdb714a85d2d (diff) | |
download | frameworks_base-fd6ad0444174f03c8df95f82a35322c4dd3c2352.zip frameworks_base-fd6ad0444174f03c8df95f82a35322c4dd3c2352.tar.gz frameworks_base-fd6ad0444174f03c8df95f82a35322c4dd3c2352.tar.bz2 |
Allow removing messages before EventHub created
Bug: 5421676
Change-Id: Id15b669947bd01d3cc3ba3e9b93175120fa518e8
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/webkit/WebViewCore.java | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/core/java/android/webkit/WebViewCore.java b/core/java/android/webkit/WebViewCore.java index aea23c0..f86262e 100644 --- a/core/java/android/webkit/WebViewCore.java +++ b/core/java/android/webkit/WebViewCore.java @@ -46,6 +46,8 @@ import junit.framework.Assert; import java.util.ArrayList; import java.util.Collection; +import java.util.Iterator; +import java.util.LinkedList; import java.util.Map; import java.util.Set; @@ -1182,7 +1184,7 @@ public final class WebViewCore { private Handler mHandler; // Message queue for containing messages before the WebCore thread is // ready. - private ArrayList<Message> mMessages = new ArrayList<Message>(); + private LinkedList<Message> mMessages = new LinkedList<Message>(); // Flag for blocking messages. This is used during DESTROY to avoid // posting more messages to the EventHub or to WebView's event handler. private boolean mBlockMessages; @@ -1822,10 +1824,13 @@ public final class WebViewCore { mDrawIsScheduled = false; } if (mMessages != null) { - Throwable throwable = new Throwable( - "EventHub.removeMessages(int what = " + what + ") is not supported " + - "before the WebViewCore is set up."); - Log.w(LOGTAG, Log.getStackTraceString(throwable)); + Iterator<Message> iter = mMessages.iterator(); + while (iter.hasNext()) { + Message m = iter.next(); + if (m.what == what) { + iter.remove(); + } + } } else { mHandler.removeMessages(what); } |