diff --git a/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedModule.java b/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedModule.java index 0f52b73c61625db2a3081c0950b6bdd2b06e3d40..b0fc3de4be0b3a26b638683613c63c783c2739bb 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedModule.java +++ b/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedModule.java @@ -38,7 +38,7 @@ import com.facebook.react.uimanager.common.ViewUtil; import java.util.ArrayList; import java.util.List; import java.util.Queue; -import java.util.concurrent.ConcurrentLinkedQueue; +import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.atomic.AtomicReference; /** @@ -151,7 +151,10 @@ public class NativeAnimatedModule extends NativeAnimatedModuleSpec } private class ConcurrentOperationQueue { - private final Queue mQueue = new ConcurrentLinkedQueue<>(); + // Patch: Use LinkedBlockingQueue instead of ConcurrentLinkedQueue. + // In some versions of Android, ConcurrentLinkedQueue is known to drop + // items, causing crashing. See https://github.com/laurent22/joplin/issues/8425 + private final Queue mQueue = new LinkedBlockingQueue<>(); @Nullable private UIThreadOperation mPeekedOperation = null; @AnyThread