Skip to content

Commit 7a01d94

Browse files
author
Steve Block
committed
Update the error for WebView thread violations to make clear that it's not fatal
- Update the description - Use Throwable rather than RuntimeException - Log as a warning rather than an error Bug: 5313494 Change-Id: If13ce2088e7080122db14e5e0565f64e6d6f4320
1 parent b48ca1f commit 7a01d94

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

core/java/android/webkit/WebView.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9280,13 +9280,13 @@ protected void updateCachedTextfield(String updatedText) {
92809280

92819281
private static void checkThread() {
92829282
if (Looper.myLooper() != Looper.getMainLooper()) {
9283-
RuntimeException exception = new RuntimeException(
9284-
"A WebView method was called on thread '" +
9283+
Throwable throwable = new Throwable(
9284+
"Warning: A WebView method was called on thread '" +
92859285
Thread.currentThread().getName() + "'. " +
92869286
"All WebView methods must be called on the UI thread. " +
92879287
"Future versions of WebView may not support use on other threads.");
9288-
Log.e(LOGTAG, Log.getStackTraceString(exception));
9289-
StrictMode.onWebViewMethodCalledOnWrongThread(exception);
9288+
Log.w(LOGTAG, Log.getStackTraceString(throwable));
9289+
StrictMode.onWebViewMethodCalledOnWrongThread(throwable);
92909290
}
92919291
}
92929292

0 commit comments

Comments
 (0)