mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-14 08:15:04 +01:00
Fix some notifications stuff
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
51d8483267
commit
8c984973c0
@ -24,6 +24,7 @@ import android.app.Notification
|
|||||||
import android.app.PendingIntent
|
import android.app.PendingIntent
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.media.AudioAttributes
|
import android.media.AudioAttributes
|
||||||
|
import android.media.AudioManager
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.util.Base64
|
import android.util.Base64
|
||||||
@ -152,13 +153,14 @@ class MagicFirebaseMessagingService : FirebaseMessagingService(), KoinComponent
|
|||||||
.setSmallIcon(R.drawable.ic_call_black_24dp)
|
.setSmallIcon(R.drawable.ic_call_black_24dp)
|
||||||
.setSubText(userBaseUrl)
|
.setSubText(userBaseUrl)
|
||||||
.setShowWhen(true)
|
.setShowWhen(true)
|
||||||
.setWhen(decryptedPushMessage.timestamp)
|
.setWhen(timestamp)
|
||||||
.setContentTitle(EmojiCompat.get().process(decryptedPushMessage.subject.toString()))
|
.setContentTitle(EmojiCompat.get().process(decryptedPushMessage.subject.toString()))
|
||||||
.setAutoCancel(true)
|
.setAutoCancel(true)
|
||||||
.setOngoing(true)
|
.setOngoing(true)
|
||||||
//.setTimeoutAfter(45000L)
|
//.setTimeoutAfter(45000L)
|
||||||
|
.setContentIntent(fullScreenPendingIntent)
|
||||||
.setFullScreenIntent(fullScreenPendingIntent, true)
|
.setFullScreenIntent(fullScreenPendingIntent, true)
|
||||||
.setSound(NotificationUtils.getCallSoundUri(applicationContext, appPreferences))
|
.setSound(NotificationUtils.getCallSoundUri(applicationContext, appPreferences), AudioManager.STREAM_RING)
|
||||||
|
|
||||||
if (vibrationEffect != null) {
|
if (vibrationEffect != null) {
|
||||||
notificationBuilder.setVibrate(vibrationEffect)
|
notificationBuilder.setVibrate(vibrationEffect)
|
||||||
@ -168,7 +170,7 @@ class MagicFirebaseMessagingService : FirebaseMessagingService(), KoinComponent
|
|||||||
notification.flags = notification.flags or Notification.FLAG_INSISTENT
|
notification.flags = notification.flags or Notification.FLAG_INSISTENT
|
||||||
isServiceInForeground = true
|
isServiceInForeground = true
|
||||||
checkIfCallIsActive(signatureVerification, decryptedPushMessage)
|
checkIfCallIsActive(signatureVerification, decryptedPushMessage)
|
||||||
startForeground(decryptedPushMessage.timestamp.toInt(), notification)
|
startForeground(timestamp.toInt(), notification)
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
val messageData = Data.Builder()
|
val messageData = Data.Builder()
|
||||||
|
@ -50,6 +50,7 @@
|
|||||||
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
|
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
|
||||||
<uses-permission android:name="android.permission.VIBRATE" />
|
<uses-permission android:name="android.permission.VIBRATE" />
|
||||||
<uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />
|
<uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />
|
||||||
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||||
|
|
||||||
<uses-permission
|
<uses-permission
|
||||||
android:name="android.permission.USE_CREDENTIALS"
|
android:name="android.permission.USE_CREDENTIALS"
|
||||||
|
@ -116,12 +116,8 @@ object NotificationUtils {
|
|||||||
channel.enableLights(enableLights)
|
channel.enableLights(enableLights)
|
||||||
channel.lightColor = R.color.colorPrimary
|
channel.lightColor = R.color.colorPrimary
|
||||||
channel.setSound(sound, audioAttributes)
|
channel.setSound(sound, audioAttributes)
|
||||||
if (vibrationPattern != null) {
|
|
||||||
channel.enableVibration(true)
|
|
||||||
channel.vibrationPattern = vibrationPattern
|
channel.vibrationPattern = vibrationPattern
|
||||||
} else {
|
|
||||||
channel.enableVibration(false)
|
|
||||||
}
|
|
||||||
channel.setBypassDnd(bypassDnd)
|
channel.setBypassDnd(bypassDnd)
|
||||||
if (lockScreenVisibility != null) {
|
if (lockScreenVisibility != null) {
|
||||||
channel.lockscreenVisibility = lockScreenVisibility
|
channel.lockscreenVisibility = lockScreenVisibility
|
||||||
|
Loading…
Reference in New Issue
Block a user