diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 41a9e137e..8abe048cd 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -20,6 +20,7 @@ + = Build.VERSION_CODES.S) { + val vibratorManager = context.getSystemService(VibratorManager::class.java) + vibratorManager.defaultVibrator + } else { + context.getSystemService(Vibrator::class.java) + } + + if (vibrator.hasVibrator()) { + val pattern = channel.vibrationPattern ?: defaultPattern + val effect = VibrationEffect.createWaveform(pattern, -1) + + vibrator.vibrate(effect) + } + } + } } \ No newline at end of file diff --git a/app/src/main/java/com/chiller3/bcr/RecorderInCallService.kt b/app/src/main/java/com/chiller3/bcr/RecorderInCallService.kt index 22c2cd8dd..a98038606 100644 --- a/app/src/main/java/com/chiller3/bcr/RecorderInCallService.kt +++ b/app/src/main/java/com/chiller3/bcr/RecorderInCallService.kt @@ -201,6 +201,7 @@ class RecorderInCallService : InCallService(), RecorderThread.OnRecordingComplet R.string.notification_recording_in_progress, R.drawable.ic_launcher_quick_settings, )) + notifications.vibrateIfEnabled(Notifications.CHANNEL_ID_PERSISTENT) } }