mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 03:59:35 +01: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.Bitmap;
|
||||||
import android.graphics.BitmapFactory;
|
import android.graphics.BitmapFactory;
|
||||||
import android.media.RingtoneManager;
|
import android.media.RingtoneManager;
|
||||||
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.Base64;
|
import android.util.Base64;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
@ -86,6 +87,7 @@ public class MagicFirebaseMessagingService extends FirebaseMessagingService {
|
|||||||
Bitmap largeIcon;
|
Bitmap largeIcon;
|
||||||
String category = "";
|
String category = "";
|
||||||
int priority = Notification.PRIORITY_DEFAULT;
|
int priority = Notification.PRIORITY_DEFAULT;
|
||||||
|
Uri soundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
|
||||||
|
|
||||||
Intent intent = new Intent(this, CallActivity.class);
|
Intent intent = new Intent(this, CallActivity.class);
|
||||||
BundleBuilder bundleBuilder = new BundleBuilder(new Bundle());
|
BundleBuilder bundleBuilder = new BundleBuilder(new Bundle());
|
||||||
@ -101,6 +103,7 @@ public class MagicFirebaseMessagingService extends FirebaseMessagingService {
|
|||||||
smallIcon = R.drawable.ic_call_black_24dp;
|
smallIcon = R.drawable.ic_call_black_24dp;
|
||||||
category = Notification.CATEGORY_CALL;
|
category = Notification.CATEGORY_CALL;
|
||||||
priority = Notification.PRIORITY_HIGH;
|
priority = Notification.PRIORITY_HIGH;
|
||||||
|
soundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE);
|
||||||
break;
|
break;
|
||||||
case "room":
|
case "room":
|
||||||
smallIcon = R.drawable.ic_notifications_black_24dp;
|
smallIcon = R.drawable.ic_notifications_black_24dp;
|
||||||
@ -127,14 +130,10 @@ public class MagicFirebaseMessagingService extends FirebaseMessagingService {
|
|||||||
.setShowWhen(true)
|
.setShowWhen(true)
|
||||||
.setSubText(signatureVerification.getUserEntity().getDisplayName())
|
.setSubText(signatureVerification.getUserEntity().getDisplayName())
|
||||||
.setContentTitle(decryptedPushMessage.getSubject())
|
.setContentTitle(decryptedPushMessage.getSubject())
|
||||||
.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION))
|
.setSound(soundUri)
|
||||||
.setAutoCancel(true);
|
.setAutoCancel(true);
|
||||||
|
|
||||||
if (!"call".equals(decryptedPushMessage.getType())) {
|
notificationBuilder.setContentIntent(pendingIntent);
|
||||||
notificationBuilder.setContentIntent(pendingIntent);
|
|
||||||
} else {
|
|
||||||
notificationBuilder.setFullScreenIntent(pendingIntent, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
NotificationManager notificationManager =
|
NotificationManager notificationManager =
|
||||||
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
||||||
|
@ -92,4 +92,7 @@
|
|||||||
permission in the system settings.</string>
|
permission in the system settings.</string>
|
||||||
<string name="nc_permissions_settings">Open settings</string>
|
<string name="nc_permissions_settings">Open settings</string>
|
||||||
|
|
||||||
|
<!-- Call -->
|
||||||
|
<string name="nc_incoming_call">Incoming call</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
Loading…
Reference in New Issue
Block a user