Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 263748a8 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix CombinedMessageQueue for ravenwood" into main

parents 5bd64609 797ec254
Loading
Loading
Loading
Loading
+15 −5
Original line number Diff line number Diff line
@@ -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.

@@ -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 {