Skip to content

Commit 2797e52

Browse files
committed
cancel vibration with 0
1 parent 69b00fe commit 2797e52

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

app/src/main/java/com/geode/launcher/utils/GeodeUtils.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,10 @@ object GeodeUtils {
476476
*/
477477
@JvmStatic
478478
fun vibrate(ms: Long) {
479+
if (ms == 0L) {
480+
getVibrator()?.cancel()
481+
}
482+
479483
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
480484
getVibrator()?.vibrate(VibrationEffect.createOneShot(ms, VibrationEffect.DEFAULT_AMPLITUDE))
481485
} else {

0 commit comments

Comments
 (0)