Loading core/java/android/os/CombinedMessageQueue/MessageQueue.java +15 −5 Original line number Diff line number Diff line Loading @@ -118,11 +118,8 @@ public final class MessageQueue { 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(); final Instrumentation instrumentation = 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. Loading @@ -135,6 +132,19 @@ public final class MessageQueue { mPtr = nativeInit(); } @android.ravenwood.annotation.RavenwoodReplace(blockedBy = ActivityThread.class) private static Instrumentation getInstrumentation() { final ActivityThread activityThread = ActivityThread.currentActivityThread(); if (activityThread != null) { return activityThread.getInstrumentation(); } return null; } private static Instrumentation getInstrumentation$ravenwood() { return null; // Instrumentation not supported on Ravenwood yet. } @Override protected void finalize() throws Throwable { try { Loading Loading
core/java/android/os/CombinedMessageQueue/MessageQueue.java +15 −5 Original line number Diff line number Diff line Loading @@ -118,11 +118,8 @@ public final class MessageQueue { 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(); final Instrumentation instrumentation = 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. Loading @@ -135,6 +132,19 @@ public final class MessageQueue { mPtr = nativeInit(); } @android.ravenwood.annotation.RavenwoodReplace(blockedBy = ActivityThread.class) private static Instrumentation getInstrumentation() { final ActivityThread activityThread = ActivityThread.currentActivityThread(); if (activityThread != null) { return activityThread.getInstrumentation(); } return null; } private static Instrumentation getInstrumentation$ravenwood() { return null; // Instrumentation not supported on Ravenwood yet. } @Override protected void finalize() throws Throwable { try { Loading