OSDN Git Service

Improve a warning message in WebViewCore's EventHub
authorSteve Block <steveblock@google.com>
Tue, 30 Aug 2011 12:52:51 +0000 (13:52 +0100)
committerSteve Block <steveblock@google.com>
Thu, 6 Oct 2011 13:54:31 +0000 (14:54 +0100)
These warnings appear occasionally and this will help track them down.

Also removes an unused method.

Bug: 5421676
Change-Id: I5ba3f146449623e3457aafc91fd2e7edc367a9d9

core/java/android/webkit/WebViewCore.java

index 440ee79..ea29ad1 100644 (file)
@@ -1662,24 +1662,15 @@ public final class WebViewCore {
                 mDrawIsScheduled = false;
             }
             if (mMessages != null) {
-                Log.w(LOGTAG, "Not supported in this case.");
+                Throwable throwable = new Throwable(
+                        "EventHub.removeMessages(int what = " + what + ") is not supported " +
+                        "before the WebViewCore is set up.");
+                Log.w(LOGTAG, Log.getStackTraceString(throwable));
             } else {
                 mHandler.removeMessages(what);
             }
         }
 
-        private synchronized boolean hasMessages(int what) {
-            if (mBlockMessages) {
-                return false;
-            }
-            if (mMessages != null) {
-                Log.w(LOGTAG, "hasMessages() is not supported in this case.");
-                return false;
-            } else {
-                return mHandler.hasMessages(what);
-            }
-        }
-
         private synchronized void sendMessageDelayed(Message msg, long delay) {
             if (mBlockMessages) {
                 return;