mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 21:15:48 +00:00
Apply server returned group patch instead of local only.
This commit is contained in:
committed by
Alex Hart
parent
2d7655a6bb
commit
69dc31681d
@@ -4,6 +4,7 @@ import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
|
||||
import org.signal.core.util.concurrent.TracingExecutor;
|
||||
import org.signal.core.util.concurrent.TracingExecutorService;
|
||||
@@ -19,6 +20,9 @@ public final class ThreadUtil {
|
||||
|
||||
private static volatile Handler handler;
|
||||
|
||||
@VisibleForTesting
|
||||
public static volatile boolean enforceAssertions = true;
|
||||
|
||||
private ThreadUtil() {}
|
||||
|
||||
private static Handler getHandler() {
|
||||
@@ -37,13 +41,13 @@ public final class ThreadUtil {
|
||||
}
|
||||
|
||||
public static void assertMainThread() {
|
||||
if (!isMainThread()) {
|
||||
if (!isMainThread() && enforceAssertions) {
|
||||
throw new AssertionError("Must run on main thread.");
|
||||
}
|
||||
}
|
||||
|
||||
public static void assertNotMainThread() {
|
||||
if (isMainThread()) {
|
||||
if (isMainThread() && enforceAssertions) {
|
||||
throw new AssertionError("Cannot run on main thread.");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user