Loading core/java/android/view/InputEventReceiver.java +7 −4 Original line number Diff line number Diff line Loading @@ -45,7 +45,7 @@ public abstract class InputEventReceiver { // We keep references to the input channel and message queue objects here so that // they are not GC'd while the native peer of the receiver is using them. private InputChannel mInputChannel; private MessageQueue mMessageQueue; private Looper mLooper; // Map from InputEvent sequence numbers to dispatcher sequence numbers. private final SparseIntArray mSeqMap = new SparseIntArray(); Loading Loading @@ -76,9 +76,9 @@ public abstract class InputEventReceiver { } mInputChannel = inputChannel; mMessageQueue = looper.getQueue(); mLooper = looper; mReceiverPtr = nativeInit(new WeakReference<InputEventReceiver>(this), mInputChannel, mMessageQueue); mInputChannel, mLooper.getQueue()); mCloseGuard.open("InputEventReceiver.dispose"); } Loading Loading @@ -108,6 +108,9 @@ public abstract class InputEventReceiver { * Must be called on the same Looper thread to which the receiver is attached. */ public void dispose() { if (Thread.currentThread() != mLooper.getThread()) { throw new IllegalStateException("Must call dispose() on the Looper thread"); } dispose(false); } Loading @@ -128,7 +131,7 @@ public abstract class InputEventReceiver { mInputChannel.dispose(); mInputChannel = null; } mMessageQueue = null; mLooper = null; Reference.reachabilityFence(this); } Loading tests/Input/src/com/android/test/input/InputEventSenderAndReceiverTest.kt +0 −1 Original line number Diff line number Diff line Loading @@ -155,7 +155,6 @@ class InputEventSenderAndReceiverTest { sender.assertReceivedFinishedSignal(seq, handled = true) // Clean up crashingReceiver.dispose() sender.dispose() receiverThread.quitSafely() } Loading Loading
core/java/android/view/InputEventReceiver.java +7 −4 Original line number Diff line number Diff line Loading @@ -45,7 +45,7 @@ public abstract class InputEventReceiver { // We keep references to the input channel and message queue objects here so that // they are not GC'd while the native peer of the receiver is using them. private InputChannel mInputChannel; private MessageQueue mMessageQueue; private Looper mLooper; // Map from InputEvent sequence numbers to dispatcher sequence numbers. private final SparseIntArray mSeqMap = new SparseIntArray(); Loading Loading @@ -76,9 +76,9 @@ public abstract class InputEventReceiver { } mInputChannel = inputChannel; mMessageQueue = looper.getQueue(); mLooper = looper; mReceiverPtr = nativeInit(new WeakReference<InputEventReceiver>(this), mInputChannel, mMessageQueue); mInputChannel, mLooper.getQueue()); mCloseGuard.open("InputEventReceiver.dispose"); } Loading Loading @@ -108,6 +108,9 @@ public abstract class InputEventReceiver { * Must be called on the same Looper thread to which the receiver is attached. */ public void dispose() { if (Thread.currentThread() != mLooper.getThread()) { throw new IllegalStateException("Must call dispose() on the Looper thread"); } dispose(false); } Loading @@ -128,7 +131,7 @@ public abstract class InputEventReceiver { mInputChannel.dispose(); mInputChannel = null; } mMessageQueue = null; mLooper = null; Reference.reachabilityFence(this); } Loading
tests/Input/src/com/android/test/input/InputEventSenderAndReceiverTest.kt +0 −1 Original line number Diff line number Diff line Loading @@ -155,7 +155,6 @@ class InputEventSenderAndReceiverTest { sender.assertReceivedFinishedSignal(seq, handled = true) // Clean up crashingReceiver.dispose() sender.dispose() receiverThread.quitSafely() } Loading