Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7a01d94c authored by Steve Block's avatar Steve Block
Browse files

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
parent b48ca1f1
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -9280,13 +9280,13 @@ public class WebView extends AbsoluteLayout

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