mirror of
https://github.com/nextcloud/talk-android
synced 2025-01-19 13:41:26 +00:00
Set ringtone as sound for one-to-one calls
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
67484b544f
commit
bf356ca1d8
@ -29,6 +29,7 @@ import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.media.RingtoneManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.util.Base64;
|
||||
import android.util.Log;
|
||||
@ -86,6 +87,7 @@ public class MagicFirebaseMessagingService extends FirebaseMessagingService {
|
||||
Bitmap largeIcon;
|
||||
String category = "";
|
||||
int priority = Notification.PRIORITY_DEFAULT;
|
||||
Uri soundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
|
||||
|
||||
Intent intent = new Intent(this, CallActivity.class);
|
||||
BundleBuilder bundleBuilder = new BundleBuilder(new Bundle());
|
||||
@ -101,6 +103,7 @@ public class MagicFirebaseMessagingService extends FirebaseMessagingService {
|
||||
smallIcon = R.drawable.ic_call_black_24dp;
|
||||
category = Notification.CATEGORY_CALL;
|
||||
priority = Notification.PRIORITY_HIGH;
|
||||
soundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE);
|
||||
break;
|
||||
case "room":
|
||||
smallIcon = R.drawable.ic_notifications_black_24dp;
|
||||
@ -127,14 +130,10 @@ public class MagicFirebaseMessagingService extends FirebaseMessagingService {
|
||||
.setShowWhen(true)
|
||||
.setSubText(signatureVerification.getUserEntity().getDisplayName())
|
||||
.setContentTitle(decryptedPushMessage.getSubject())
|
||||
.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION))
|
||||
.setSound(soundUri)
|
||||
.setAutoCancel(true);
|
||||
|
||||
if (!"call".equals(decryptedPushMessage.getType())) {
|
||||
notificationBuilder.setContentIntent(pendingIntent);
|
||||
} else {
|
||||
notificationBuilder.setFullScreenIntent(pendingIntent, true);
|
||||
}
|
||||
notificationBuilder.setContentIntent(pendingIntent);
|
||||
|
||||
NotificationManager notificationManager =
|
||||
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
|
@ -92,4 +92,7 @@
|
||||
permission in the system settings.</string>
|
||||
<string name="nc_permissions_settings">Open settings</string>
|
||||
|
||||
<!-- Call -->
|
||||
<string name="nc_incoming_call">Incoming call</string>
|
||||
|
||||
</resources>
|
||||
|
Loading…
Reference in New Issue
Block a user