@@ -14,7 +14,6 @@ import android.app.PendingIntent
1414import android.content.Context
1515import android.content.Intent
1616import android.content.pm.PackageManager
17- import android.graphics.Bitmap
1817import android.os.Build
1918import android.os.Bundle
2019import android.os.Handler
@@ -30,8 +29,6 @@ import androidx.core.app.NotificationCompat
3029import androidx.core.app.NotificationManagerCompat
3130import androidx.core.app.Person
3231import androidx.core.app.RemoteInput
33- import androidx.core.content.ContextCompat
34- import androidx.core.graphics.drawable.toBitmap
3532import androidx.core.net.toUri
3633import androidx.emoji2.text.EmojiCompat
3734import androidx.work.Data
@@ -80,13 +77,13 @@ import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_MESSAGE_ID
8077import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_NOTIFICATION_ID
8178import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_NOTIFICATION_RESTRICT_DELETION
8279import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_NOTIFICATION_TIMESTAMP
80+ import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_OPENED_VIA_NOTIFICATION
8381import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_REMOTE_TALK_SHARE
8482import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_ROOM_ONE_TO_ONE
8583import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_ROOM_TOKEN
8684import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_SHARE_RECORDING_TO_CHAT_URL
8785import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_SYSTEM_NOTIFICATION_ID
8886import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_THREAD_ID
89- import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_OPENED_VIA_NOTIFICATION
9087import com.nextcloud.talk.utils.preferences.AppPreferences
9188import io.reactivex.Observable
9289import io.reactivex.Observer
@@ -549,7 +546,6 @@ class NotificationWorker(context: Context, workerParams: WorkerParameters) : Wor
549546 val notificationBuilder = NotificationCompat .Builder (context!! , " 1" )
550547 .setPriority(NotificationCompat .PRIORITY_HIGH )
551548 .setCategory(category)
552- .setLargeIcon(getLargeIcon())
553549 .setSmallIcon(R .drawable.ic_notification)
554550 .setContentTitle(contentTitle)
555551 .setContentText(contentText)
@@ -591,39 +587,6 @@ class NotificationWorker(context: Context, workerParams: WorkerParameters) : Wor
591587 return notificationBuilder
592588 }
593589
594- private fun getLargeIcon (): Bitmap {
595- val largeIcon: Bitmap
596- if (pushMessage.type == TYPE_RECORDING ) {
597- largeIcon = ContextCompat .getDrawable(context!! , R .drawable.ic_baseline_videocam_24)?.toBitmap()!!
598- } else {
599- when (conversationType) {
600- " one2one" -> {
601- pushMessage.subject = " "
602- largeIcon =
603- ContextCompat .getDrawable(context!! , R .drawable.ic_people_group_black_24px)?.toBitmap()!!
604- }
605-
606- " group" ->
607- largeIcon =
608- ContextCompat .getDrawable(context!! , R .drawable.ic_people_group_black_24px)?.toBitmap()!!
609-
610- " public" ->
611- largeIcon =
612- ContextCompat .getDrawable(context!! , R .drawable.ic_link_black_24px)?.toBitmap()!!
613-
614- else -> // assuming one2one
615- largeIcon = if (TYPE_CHAT == pushMessage.type || TYPE_ROOM == pushMessage.type) {
616- ContextCompat .getDrawable(context!! , R .drawable.ic_comment)?.toBitmap()!!
617- } else if (TYPE_REMINDER == pushMessage.type) {
618- ContextCompat .getDrawable(context!! , R .drawable.ic_timer_black_24dp)?.toBitmap()!!
619- } else {
620- ContextCompat .getDrawable(context!! , R .drawable.ic_call_black_24dp)?.toBitmap()!!
621- }
622- }
623- }
624- return largeIcon
625- }
626-
627590 private fun calculateCRC32 (s : String ): Long {
628591 val crc32 = CRC32 ()
629592 crc32.update(s.toByteArray())
0 commit comments