Loading core/java/android/os/StrictMode.java +7 −0 Original line number Diff line number Diff line Loading @@ -1481,6 +1481,13 @@ public final class StrictMode { onVmPolicyViolation(message, originStack); } /** * @hide */ public static void onWebViewMethodCalledOnWrongThread(Throwable originStack) { onVmPolicyViolation(null, originStack); } // Map from VM violation fingerprint to uptime millis. private static final HashMap<Integer, Long> sLastVmViolationTime = new HashMap<Integer, Long>(); Loading core/java/android/webkit/WebView.java +10 −9 Original line number Diff line number Diff line Loading @@ -54,7 +54,9 @@ import android.net.http.SslCertificate; import android.os.AsyncTask; import android.os.Bundle; import android.os.Handler; import android.os.Looper; import android.os.Message; import android.os.StrictMode; import android.provider.Settings; import android.speech.tts.TextToSpeech; import android.text.Selection; Loading Loading @@ -8933,15 +8935,14 @@ public class WebView extends AbsoluteLayout } private static void checkThread() { if (!"main".equals(Thread.currentThread().getName())) { try { throw new RuntimeException("A WebView method was called on thread '" + if (Looper.myLooper() != Looper.getMainLooper()) { RuntimeException exception = new RuntimeException( "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."); } catch (RuntimeException e) { Log.e(LOGTAG, Log.getStackTraceString(e)); } Log.e(LOGTAG, Log.getStackTraceString(exception)); StrictMode.onWebViewMethodCalledOnWrongThread(exception); } } Loading Loading
core/java/android/os/StrictMode.java +7 −0 Original line number Diff line number Diff line Loading @@ -1481,6 +1481,13 @@ public final class StrictMode { onVmPolicyViolation(message, originStack); } /** * @hide */ public static void onWebViewMethodCalledOnWrongThread(Throwable originStack) { onVmPolicyViolation(null, originStack); } // Map from VM violation fingerprint to uptime millis. private static final HashMap<Integer, Long> sLastVmViolationTime = new HashMap<Integer, Long>(); Loading
core/java/android/webkit/WebView.java +10 −9 Original line number Diff line number Diff line Loading @@ -54,7 +54,9 @@ import android.net.http.SslCertificate; import android.os.AsyncTask; import android.os.Bundle; import android.os.Handler; import android.os.Looper; import android.os.Message; import android.os.StrictMode; import android.provider.Settings; import android.speech.tts.TextToSpeech; import android.text.Selection; Loading Loading @@ -8933,15 +8935,14 @@ public class WebView extends AbsoluteLayout } private static void checkThread() { if (!"main".equals(Thread.currentThread().getName())) { try { throw new RuntimeException("A WebView method was called on thread '" + if (Looper.myLooper() != Looper.getMainLooper()) { RuntimeException exception = new RuntimeException( "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."); } catch (RuntimeException e) { Log.e(LOGTAG, Log.getStackTraceString(e)); } Log.e(LOGTAG, Log.getStackTraceString(exception)); StrictMode.onWebViewMethodCalledOnWrongThread(exception); } } Loading