Browse Source

Fix vibration and fix #745

Signed-off-by: Mario Danic <mario@lovelyhq.com>
Mario Danic 5 years ago
parent
commit
408da749fe

+ 1 - 1
app/gplay.gradle

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

+ 0 - 1
app/src/gplay/java/com/nextcloud/talk/services/firebase/MagicFirebaseMessagingService.kt

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

+ 3 - 3
app/src/main/java/com/nextcloud/talk/controllers/CallNotificationController.java

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

+ 2 - 2
app/src/main/java/com/nextcloud/talk/jobs/NotificationWorker.java

@@ -546,9 +546,9 @@ public class NotificationWorker extends Worker {
 
                 if (vibrator != null) {
                     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 {
-                        vibrator.vibrate(500);
+                        //vibrator.vibrate(500);
                     }
                 }
             }