summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Shai Barack <shayba@google.com> 2024-11-11 18:49:37 +0000
committer Shai Barack <shayba@google.com> 2024-11-11 18:49:37 +0000
commit64d38fd44887addaf210367f2917dcede3831034 (patch)
treec8040e5aa6ad1afdc187bf674de4dd5c3da51643
parent18eb83c20e3adb4fc3cf2a89e59780ade3b1e9ba (diff)
Don't use concurrent message queue when debugging is enabled
Debugging (and instrumentation) is known to make assumptions about MessageQueue implementation details that are broken by the modern concurrent implementation. Until an alternative to the above is developed and rolled out, opt out of the new implementation when exposed to this risk. Bug: 336880969 Change-Id: I59a43a21534f7166803a3927bde8b9ed0fe1696e Flag: build.RELEASE_PACKAGE_MESSAGEQUEUE_IMPLEMENTATION
-rw-r--r--core/java/android/os/CombinedMessageQueue/MessageQueue.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/java/android/os/CombinedMessageQueue/MessageQueue.java b/core/java/android/os/CombinedMessageQueue/MessageQueue.java
index 69bd6685bcac..7529ab9ab894 100644
--- a/core/java/android/os/CombinedMessageQueue/MessageQueue.java
+++ b/core/java/android/os/CombinedMessageQueue/MessageQueue.java
@@ -31,6 +31,7 @@ import android.util.SparseArray;
import android.util.proto.ProtoOutputStream;
import dalvik.annotation.optimization.NeverCompile;
+import dalvik.system.VMDebug;
import java.io.FileDescriptor;
import java.lang.annotation.Retention;
@@ -110,7 +111,7 @@ public final class MessageQueue {
private native static void nativeSetFileDescriptorEvents(long ptr, int fd, int events);
MessageQueue(boolean quitAllowed) {
- mUseConcurrent = UserHandle.isCore(Process.myUid());
+ mUseConcurrent = UserHandle.isCore(Process.myUid()) && !VMDebug.isDebuggingEnabled();
mQuitAllowed = quitAllowed;
mPtr = nativeInit();
}