Fix vibration and fix #745

Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2020-03-21 16:26:03 +01:00
parent 5a1e050928
commit 408da749fe
No known key found for this signature in database
GPG Key ID: CDE0BBD2738C4CC0
4 changed files with 6 additions and 7 deletions

View File

@ -19,5 +19,5 @@
*/ */
dependencies { dependencies {
implementation "com.google.firebase:firebase-messaging:20.1.0" implementation "com.google.firebase:firebase-messaging:20.1.2"
} }

View File

@ -214,7 +214,6 @@ class MagicFirebaseMessagingService : FirebaseMessagingService() {
.setContentIntent(fullScreenPendingIntent) .setContentIntent(fullScreenPendingIntent)
.setFullScreenIntent(fullScreenPendingIntent, true) .setFullScreenIntent(fullScreenPendingIntent, true)
.setSound(soundUri) .setSound(soundUri)
.setVibrate(NotificationUtils.getVibrationEffectForCalls())
.build() .build()
notification.flags = notification.flags or Notification.FLAG_INSISTENT notification.flags = notification.flags or Notification.FLAG_INSISTENT
isServiceInForeground = true isServiceInForeground = true

View File

@ -361,13 +361,13 @@ public class CallNotificationController extends BaseController {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
if (vibrator.hasAmplitudeControl()) { if (vibrator.hasAmplitudeControl()) {
vibrationEffect = VibrationEffect.createWaveform(vibratePattern, amplitudes, -1); vibrationEffect = VibrationEffect.createWaveform(vibratePattern, amplitudes, -1);
vibrator.vibrate(vibrationEffect); //vibrator.vibrate(vibrationEffect);
} else { } else {
vibrationEffect = VibrationEffect.createWaveform(vibratePattern, -1); vibrationEffect = VibrationEffect.createWaveform(vibratePattern, -1);
vibrator.vibrate(vibrationEffect); //vibrator.vibrate(vibrationEffect);
} }
} else { } else {
vibrator.vibrate(vibratePattern, -1); //vibrator.vibrate(vibratePattern, -1);
} }
} }

View File

@ -546,9 +546,9 @@ public class NotificationWorker extends Worker {
if (vibrator != null) { if (vibrator != null) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
vibrator.vibrate(VibrationEffect.createOneShot(500, VibrationEffect.DEFAULT_AMPLITUDE)); //vibrator.vibrate(VibrationEffect.createOneShot(500, VibrationEffect.DEFAULT_AMPLITUDE));
} else { } else {
vibrator.vibrate(500); //vibrator.vibrate(500);
} }
} }
} }