From 1eee03818d46a445d918624135642642748f5a35 Mon Sep 17 00:00:00 2001 From: rustdesk Date: Thu, 19 Jun 2025 12:28:16 +0900 Subject: [PATCH] fix https://github.com/rustdesk/rustdesk/discussions/11838 --- .../com/carriez/flutter_hbb/InputService.kt | 31 ++++++++++++++----- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/flutter/android/app/src/main/kotlin/com/carriez/flutter_hbb/InputService.kt b/flutter/android/app/src/main/kotlin/com/carriez/flutter_hbb/InputService.kt index b2a827e12..8ea67fe0b 100644 --- a/flutter/android/app/src/main/kotlin/com/carriez/flutter_hbb/InputService.kt +++ b/flutter/android/app/src/main/kotlin/com/carriez/flutter_hbb/InputService.kt @@ -294,14 +294,31 @@ class InputService : AccessibilityService() { } try { if (stroke == null) { - stroke = GestureDescription.StrokeDescription( - touchPath, - 0, - duration, - willContinue - ) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + stroke = GestureDescription.StrokeDescription( + touchPath, + 0, + duration, + willContinue + ) + } else { + stroke = GestureDescription.StrokeDescription( + touchPath, + 0, + duration + ) + } } else { - stroke = stroke?.continueStroke(touchPath, 0, duration, willContinue) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + stroke = stroke?.continueStroke(touchPath, 0, duration, willContinue) + } else { + stroke = null + stroke = GestureDescription.StrokeDescription( + touchPath, + 0, + duration + ) + } } stroke?.let { val builder = GestureDescription.Builder()