Bug 889881 - Refactor and add a Gecko handler to ThreadUtils; r=blassey
This commit is contained in:
@@ -18,6 +18,7 @@ public final class ThreadUtils {
|
||||
private static Thread sBackgroundThread;
|
||||
|
||||
private static Handler sUiHandler;
|
||||
private static Handler sGeckoHandler;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public static class UiThreadBlockedException extends RuntimeException {
|
||||
@@ -55,8 +56,9 @@ public final class ThreadUtils {
|
||||
sUiHandler = handler;
|
||||
}
|
||||
|
||||
public static void setGeckoThread(Thread thread) {
|
||||
public static void setGeckoThread(Thread thread, Handler handler) {
|
||||
sGeckoThread = thread;
|
||||
sGeckoHandler = handler;
|
||||
}
|
||||
|
||||
public static void setBackgroundThread(Thread thread) {
|
||||
@@ -79,6 +81,10 @@ public final class ThreadUtils {
|
||||
return sGeckoThread;
|
||||
}
|
||||
|
||||
public static Handler getGeckoHandler() {
|
||||
return sGeckoHandler;
|
||||
}
|
||||
|
||||
public static Thread getBackgroundThread() {
|
||||
return sBackgroundThread;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user