| Index: base/android/java/src/org/chromium/base/ThreadUtils.java
|
| diff --git a/base/android/java/src/org/chromium/base/ThreadUtils.java b/base/android/java/src/org/chromium/base/ThreadUtils.java
|
| index ef2887acd0c97e5c8ca97beb489c1dbe50302d98..9c557e806b4403135a08ec3f41817f3f9161cf94 100644
|
| --- a/base/android/java/src/org/chromium/base/ThreadUtils.java
|
| +++ b/base/android/java/src/org/chromium/base/ThreadUtils.java
|
| @@ -35,9 +35,9 @@ public class ThreadUtils {
|
| public static void setUiThread(Looper looper) {
|
| synchronized (sLock) {
|
| if (sUiThreadHandler != null && sUiThreadHandler.getLooper() != looper) {
|
| - throw new RuntimeException("UI thread looper is already set to "
|
| - + sUiThreadHandler.getLooper() + " (Main thread looper is "
|
| - + Looper.getMainLooper() + "), cannot set to new looper " + looper);
|
| + Check.notReached("UI thread looper is already set to %1$s (Main thread looper is "
|
| + + "%2$s), cannot set to new looper %3$s",
|
| + sUiThreadHandler.getLooper(), Looper.getMainLooper(), looper);
|
| } else {
|
| sUiThreadHandler = new Handler(looper);
|
| }
|
| @@ -47,9 +47,7 @@ public class ThreadUtils {
|
| private static Handler getUiThreadHandler() {
|
| synchronized (sLock) {
|
| if (sUiThreadHandler == null) {
|
| - if (sWillOverride) {
|
| - throw new RuntimeException("Did not yet override the UI thread");
|
| - }
|
| + Check.isFalse(sWillOverride, "Did not yet override the UI thread");
|
| sUiThreadHandler = new Handler(Looper.getMainLooper());
|
| }
|
| return sUiThreadHandler;
|
|
|