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

Commit 14055bf

Browse files
review
1 parent 001d9b7 commit 14055bf

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

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

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import androidx.annotation.NonNull;
1010
import io.flutter.Log;
1111
import io.flutter.embedding.android.KeyboardManager.Responder.OnKeyEventHandledCallback;
12-
import io.flutter.embedding.engine.systemchannels.KeyEventChannel;
1312
import io.flutter.plugin.editing.TextInputPlugin;
1413
import java.util.HashSet;
1514

@@ -37,9 +36,9 @@
3736
* <p>When a new {@link KeyEvent} is received, {@link KeyboardManager} calls the {@link
3837
* Responder#handleEvent(KeyEvent, OnKeyEventHandledCallback)} method on its {@link
3938
* Responder}s. Each {@link Responder} must call the supplied {@link
40-
* OnKeyEventHandledCallback} exactly once, when it has decided wether to handle the key event
41-
* callback. More than one {@link Responder} is allowed to reply true and handle the same
42-
* {@link KeyEvent}.
39+
* OnKeyEventHandledCallback} exactly once, when it has decided whether to handle the key
40+
* event callback. More than one {@link Responder} is allowed to reply true and handle the
41+
* same {@link KeyEvent}.
4342
* <p>Typically a {@link KeyboardManager} uses a {@link KeyChannelResponder} as its only
4443
* {@link Responder}.
4544
* <li>{@link TextInputPlugin}: if every {@link Responder} has replied false to a {@link
@@ -83,14 +82,6 @@ public KeyboardManager(
8382
this.responders = responders;
8483
}
8584

86-
KeyboardManager(
87-
View view, @NonNull TextInputPlugin textInputPlugin, KeyEventChannel keyEventChannel) {
88-
this(
89-
view,
90-
textInputPlugin,
91-
new KeyboardManager.Responder[] {new KeyChannelResponder(keyEventChannel)});
92-
}
93-
9485
/**
9586
* The interface for responding to a {@link KeyEvent} asynchronously.
9687
*

shell/platform/android/test/io/flutter/embedding/android/KeyboardManagerTest.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,11 @@ public void setUp() {
8080
when(mockRootView.dispatchKeyEvent(any(KeyEvent.class)))
8181
.thenAnswer(
8282
invocation -> mockView.dispatchKeyEvent((KeyEvent) invocation.getArguments()[0]));
83-
keyboardManager = new KeyboardManager(mockView, mockTextInputPlugin, mockKeyEventChannel);
83+
keyboardManager =
84+
new KeyboardManager(
85+
mockView,
86+
mockTextInputPlugin,
87+
new Responder[] {new KeyChannelResponder(flutterEngine.getKeyEventChannel())});
8488
}
8589

8690
// Tests start

0 commit comments

Comments
 (0)