File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
app/src/main/java/org/fcitx/fcitx5/android/data Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ package org.fcitx.fcitx5.android.data
6
6
7
7
import android.media.AudioManager
8
8
import android.os.Build
9
- import android.os.Build.VERSION
10
9
import android.os.VibrationEffect
11
10
import android.provider.Settings
12
11
import android.view.HapticFeedbackConstants
@@ -71,13 +70,13 @@ object InputFeedbacks {
71
70
} else {
72
71
duration = buttonPressVibrationMilliseconds.toLong()
73
72
amplitude = buttonPressVibrationAmplitude
74
- hfc = if (VERSION .SDK_INT >= Build .VERSION_CODES .O_MR1 && keyUp) {
73
+ hfc = if (Build . VERSION .SDK_INT >= Build .VERSION_CODES .O_MR1 && keyUp) {
75
74
HapticFeedbackConstants .KEYBOARD_RELEASE
76
75
} else {
77
76
HapticFeedbackConstants .KEYBOARD_TAP
78
77
}
79
78
}
80
- val useVibrator = duration != 0L
79
+ val useVibrator = duration != 0L || amplitude != 0
81
80
82
81
if (useVibrator) {
83
82
// on Android 13, if system haptic feedback was disabled, `vibrator.vibrate()` won't work
You can’t perform that action at this time.
0 commit comments