mirror of
https://github.com/fankes/termux-app.git
synced 2025-09-04 17:55:36 +08:00
extra keys: avoid scheduled executor leak
Under certain cases scheduled executor may leak causing repeatable input to stuck. Issue: https://github.com/termux/termux-app/issues/2156
This commit is contained in:
@@ -302,6 +302,10 @@ public final class ExtraKeysView extends GridLayout {
|
||||
case MotionEvent.ACTION_DOWN:
|
||||
longPressCount = 0;
|
||||
v.setBackgroundColor(BUTTON_PRESSED_COLOR);
|
||||
if (scheduledExecutor != null) {
|
||||
scheduledExecutor.shutdownNow();
|
||||
scheduledExecutor = null;
|
||||
}
|
||||
if (Arrays.asList("UP", "DOWN", "LEFT", "RIGHT", "BKSP", "DEL").contains(buttonInfo.getKey())) {
|
||||
// autorepeat
|
||||
scheduledExecutor = Executors.newSingleThreadScheduledExecutor();
|
||||
|
Reference in New Issue
Block a user