mirror of
https://github.com/fankes/termux-app.git
synced 2025-09-07 11:09:49 +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:
|
case MotionEvent.ACTION_DOWN:
|
||||||
longPressCount = 0;
|
longPressCount = 0;
|
||||||
v.setBackgroundColor(BUTTON_PRESSED_COLOR);
|
v.setBackgroundColor(BUTTON_PRESSED_COLOR);
|
||||||
|
if (scheduledExecutor != null) {
|
||||||
|
scheduledExecutor.shutdownNow();
|
||||||
|
scheduledExecutor = null;
|
||||||
|
}
|
||||||
if (Arrays.asList("UP", "DOWN", "LEFT", "RIGHT", "BKSP", "DEL").contains(buttonInfo.getKey())) {
|
if (Arrays.asList("UP", "DOWN", "LEFT", "RIGHT", "BKSP", "DEL").contains(buttonInfo.getKey())) {
|
||||||
// autorepeat
|
// autorepeat
|
||||||
scheduledExecutor = Executors.newSingleThreadScheduledExecutor();
|
scheduledExecutor = Executors.newSingleThreadScheduledExecutor();
|
||||||
|
Reference in New Issue
Block a user