Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 7846f29

Browse files
committed
Review changes
1 parent 63be4d3 commit 7846f29

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

shell/platform/android/io/flutter/embedding/android/AndroidKeyProcessor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ public void onKeyEventHandled(long id) {
258258
*/
259259
@Override
260260
public void onKeyEventNotHandled(long id) {
261-
dispatchKeyEvent(findPendingEvent(id), id);
261+
redispatchKeyEvent(findPendingEvent(id), id);
262262
}
263263

264264
/** Adds an Android key event with an id to the event responder to wait for a response. */
@@ -279,7 +279,7 @@ public void addEvent(long id, @NonNull KeyEvent event) {
279279
*
280280
* @param event the event to be dispatched to the activity.
281281
*/
282-
public void dispatchKeyEvent(KeyEvent event, long id) {
282+
private void redispatchKeyEvent(KeyEvent event, long id) {
283283
// If the textInputPlugin is still valid and accepting text, then we'll try
284284
// and send the key event to it, assuming that if the event can be sent,
285285
// that it has been handled.

shell/platform/android/io/flutter/embedding/engine/systemchannels/KeyEventChannel.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,7 @@ public static class FlutterKeyEvent {
237237
* framework.
238238
*/
239239
public static long computeEventId(@NonNull KeyEvent event) {
240-
return (event.getEventTime() & 0xffffffff)
241-
| ((long) (event.getAction() == KeyEvent.ACTION_DOWN ? 0x1 : 0x0)) << 32
242-
| ((long) (event.getScanCode() & 0xffff)) << 33;
240+
return event.hashCode();
243241
}
244242

245243
public FlutterKeyEvent(@NonNull KeyEvent androidKeyEvent) {

0 commit comments

Comments
 (0)