summaryrefslogtreecommitdiff
path: root/rs/java/android/renderscript/ProgramFragmentFixedFunction.java
diff options
context:
space:
mode:
authorSiarhei Vishniakou <svv@google.com>2021-04-18 07:50:14 +0000
committerSiarhei Vishniakou <svv@google.com>2021-05-13 00:06:28 +0000
commit85d8f5c669699d28377547b3c4656c4001c32720 (patch)
tree45e27ef0f181e29a9d5ce6df6c26407b8d5bd73a /rs/java/android/renderscript/ProgramFragmentFixedFunction.java
parentbe6088d11ca9fcd1eeb76cf890fe7624bedad60d (diff)
Do not recreate ImeInputEventSender for the same channel
InputEventSender is used to send events to an InputChannel. On the other side, InputEventReceiver receives the events and processes them. There's no good way to synchronize InputEventSender and InputEventReceiver today. If the InputEventSender object changes in the middle of interaction with the InputEventReceiver, it will confuse the receiver. Recently added strict checking of state in InputEventReceiver causes the other side to crash. In the IME case, there are dup'ed InputChannel being compared to each other by object. Since the objects are different, the equality check fails, even though they represent the same connection. This causes the InputEventReceiver to receive a sequence of events like this: incoming event seq = 1 incoming event seq = 2 incoming event seq = 3 incoming event seq = 1 incoming event seq = 2 ... If the InputEventReceiver is slow, it might only send finished signal after it processed first event with seq = 2, but the sender has already changed, and has already sent a new event with seq = 2. This would cause the receiver to overwrite the state of the second event with the first event, thus later causing a crash when it tries to ack the second event. The events received by the InputEventReceiver should all have unique seq. The pattern of re-creating InputEventSender breaks this contract. To fix this issue, we check whether the provided InputChannel represents the same connection. If the connection is the same, we do not re-create the InputEventSender, and just keep using the same object. This ensures that InputEventReceiver is always communicating with only one InputEventSender and the state remains consistent. In this CL, only a minimal change is made, and it is not rootcaused why the 'setInputChannelLocked' call is being made for the same connection. Bug: 183434055 Test: adb shell monkey 10000; run this test several times until it crashes. No more crashes observed with "Abort message: 'Could not find consume time for seq=2'" Test: use soft keyboard on device Change-Id: If8317941dd1c6d5db77f1239b9a9f45d49997df9
Diffstat (limited to 'rs/java/android/renderscript/ProgramFragmentFixedFunction.java')
0 files changed, 0 insertions, 0 deletions