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

Commit 37404f7e authored by Shai Barack's avatar Shai Barack
Browse files

Remove references to MessageQueue.mUseConcurrent in test utilities

This is no longer needed to support tests passing when
CombinedMessageQueue is enabled.

Change-Id: I8e54618505b90209a12bfd36f7b67363f274983d
Flag: build.RELEASE_PACKAGE_MESSAGEQUEUE_IMPLEMENTATION
parent 4fd9e938
Loading
Loading
Loading
Loading
+0 −18
Original line number Diff line number Diff line
@@ -53,7 +53,6 @@ public class TestableLooper {
    private static final Field MESSAGE_QUEUE_MESSAGES_FIELD;
    private static final Field MESSAGE_NEXT_FIELD;
    private static final Field MESSAGE_WHEN_FIELD;
    private static Field MESSAGE_QUEUE_USE_CONCURRENT_FIELD = null;

    private Looper mLooper;
    private MessageQueue mQueue;
@@ -63,14 +62,6 @@ public class TestableLooper {
    private TestLooperManager mQueueWrapper;

    static {
        try {
            MESSAGE_QUEUE_USE_CONCURRENT_FIELD =
                    MessageQueue.class.getDeclaredField("mUseConcurrent");
            MESSAGE_QUEUE_USE_CONCURRENT_FIELD.setAccessible(true);
        } catch (NoSuchFieldException ignored) {
            // Ignore - maybe this is not CombinedMessageQueue?
        }

        try {
            MESSAGE_QUEUE_MESSAGES_FIELD = MessageQueue.class.getDeclaredField("mMessages");
            MESSAGE_QUEUE_MESSAGES_FIELD.setAccessible(true);
@@ -155,15 +146,6 @@ public class TestableLooper {
        mLooper = l;
        mQueue = mLooper.getQueue();
        mHandler = new Handler(mLooper);

        // If we are using CombinedMessageQueue, we need to disable concurrent mode for testing.
        if (MESSAGE_QUEUE_USE_CONCURRENT_FIELD != null) {
            try {
                MESSAGE_QUEUE_USE_CONCURRENT_FIELD.set(mQueue, false);
            } catch (IllegalAccessException e) {
                throw new RuntimeException(e);
            }
        }
    }

    /**
+0 −12
Original line number Diff line number Diff line
@@ -100,18 +100,6 @@ public class TestLooper {
            throw new RuntimeException("Reflection error constructing or accessing looper", e);
        }

        // If we are using CombinedMessageQueue, we need to disable concurrent mode for testing.
        try {
            Field messageQueueUseConcurrentField =
                    MessageQueue.class.getDeclaredField("mUseConcurrent");
            messageQueueUseConcurrentField.setAccessible(true);
            messageQueueUseConcurrentField.set(mLooper.getQueue(), false);
        } catch (NoSuchFieldException e) {
            // Ignore - maybe this is not CombinedMessageQueue?
        } catch (IllegalAccessException e) {
            throw new RuntimeException("Reflection error constructing or accessing looper", e);
        }

        mClock = clock;
    }