Loading core/java/android/os/CombinedMessageQueue/MessageQueue.java +1 −15 Original line number Diff line number Diff line Loading @@ -19,7 +19,6 @@ package android.os; import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.TestApi; import android.app.ActivityThread; import android.compat.annotation.UnsupportedAppUsage; import android.os.Process; import android.os.UserHandle; Loading Loading @@ -112,20 +111,7 @@ public final class MessageQueue { private native static void nativeSetFileDescriptorEvents(long ptr, int fd, int events); MessageQueue(boolean quitAllowed) { // Concurrent mode modifies behavior that is observable via reflection and is commonly used // by tests. // For now, we limit it to system processes to avoid breaking apps and their tests. mUseConcurrent = UserHandle.isCore(Process.myUid()); // Even then, we don't use it if instrumentation is loaded as it breaks some // platform tests. final ActivityThread activityThread = ActivityThread.currentActivityThread(); if (activityThread != null) { final Instrumentation instrumentation = activityThread.getInstrumentation(); mUseConcurrent &= instrumentation == null || !instrumentation.isInstrumenting(); } // We can lift this restriction in the future after we've made it possible for test authors // to test Looper and MessageQueue without resorting to reflection. mUseConcurrent = UserHandle.isCore(Process.myUid()) && !VMDebug.isDebuggingEnabled(); mQuitAllowed = quitAllowed; mPtr = nativeInit(); } Loading Loading
core/java/android/os/CombinedMessageQueue/MessageQueue.java +1 −15 Original line number Diff line number Diff line Loading @@ -19,7 +19,6 @@ package android.os; import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.TestApi; import android.app.ActivityThread; import android.compat.annotation.UnsupportedAppUsage; import android.os.Process; import android.os.UserHandle; Loading Loading @@ -112,20 +111,7 @@ public final class MessageQueue { private native static void nativeSetFileDescriptorEvents(long ptr, int fd, int events); MessageQueue(boolean quitAllowed) { // Concurrent mode modifies behavior that is observable via reflection and is commonly used // by tests. // For now, we limit it to system processes to avoid breaking apps and their tests. mUseConcurrent = UserHandle.isCore(Process.myUid()); // Even then, we don't use it if instrumentation is loaded as it breaks some // platform tests. final ActivityThread activityThread = ActivityThread.currentActivityThread(); if (activityThread != null) { final Instrumentation instrumentation = activityThread.getInstrumentation(); mUseConcurrent &= instrumentation == null || !instrumentation.isInstrumenting(); } // We can lift this restriction in the future after we've made it possible for test authors // to test Looper and MessageQueue without resorting to reflection. mUseConcurrent = UserHandle.isCore(Process.myUid()) && !VMDebug.isDebuggingEnabled(); mQuitAllowed = quitAllowed; mPtr = nativeInit(); } Loading