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

Commit c7e658f7 authored by Shai Barack's avatar Shai Barack
Browse files

Don't fall back to legacy MessageQueue when Instrumenting

Change-Id: I3d6e386eb6603245fb91f5bce566fd626f5fb589
Flag: android.os.message_queue_testability
Bug: 112000181
parent 80a59fdb
Loading
Loading
Loading
Loading
+1 −10
Original line number Diff line number Diff line
@@ -126,7 +126,7 @@ public final class MessageQueue {

    MessageQueue(boolean quitAllowed) {
        initIsProcessAllowedToUseConcurrent();
        mUseConcurrent = sIsProcessAllowedToUseConcurrent && !isInstrumenting();
        mUseConcurrent = sIsProcessAllowedToUseConcurrent;
        mQuitAllowed = quitAllowed;
        mPtr = nativeInit();
    }
@@ -201,15 +201,6 @@ public final class MessageQueue {
        return;
    }

    private static boolean isInstrumenting() {
        final ActivityThread activityThread = ActivityThread.currentActivityThread();
        if (activityThread == null) {
            return false;
        }
        final Instrumentation instrumentation = activityThread.getInstrumentation();
        return instrumentation != null && instrumentation.isInstrumenting();
    }

    @Override
    protected void finalize() throws Throwable {
        try {