Loading tests/testables/src/android/testing/TestableLooper.java +0 −18 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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); Loading Loading @@ -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); } } } /** Loading tests/utils/testutils/java/android/os/test/TestLooper.java +0 −12 Original line number Diff line number Diff line Loading @@ -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; } Loading Loading
tests/testables/src/android/testing/TestableLooper.java +0 −18 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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); Loading Loading @@ -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); } } } /** Loading
tests/utils/testutils/java/android/os/test/TestLooper.java +0 −12 Original line number Diff line number Diff line Loading @@ -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; } Loading