diff --git a/vector/src/main/java/im/vector/app/features/notifications/NotificationFactory.kt b/vector/src/main/java/im/vector/app/features/notifications/NotificationFactory.kt index adc4e44bcc..b95bbe1bf5 100644 --- a/vector/src/main/java/im/vector/app/features/notifications/NotificationFactory.kt +++ b/vector/src/main/java/im/vector/app/features/notifications/NotificationFactory.kt @@ -17,7 +17,6 @@ package im.vector.app.features.notifications import android.app.Notification -import androidx.core.content.pm.ShortcutInfoCompat import javax.inject.Inject private typealias ProcessedMessageEvents = List> @@ -104,7 +103,7 @@ class NotificationFactory @Inject constructor( sealed interface RoomNotification { data class Removed(val roomId: String) : RoomNotification - data class Message(val notification: Notification, val shortcutInfo: ShortcutInfoCompat?, val meta: Meta) : RoomNotification { + data class Message(val notification: Notification, val meta: Meta) : RoomNotification { data class Meta( val summaryLine: CharSequence, val messageCount: Int, diff --git a/vector/src/main/java/im/vector/app/features/notifications/NotificationRenderer.kt b/vector/src/main/java/im/vector/app/features/notifications/NotificationRenderer.kt index 5afff89402..4078bb0b5c 100644 --- a/vector/src/main/java/im/vector/app/features/notifications/NotificationRenderer.kt +++ b/vector/src/main/java/im/vector/app/features/notifications/NotificationRenderer.kt @@ -17,7 +17,6 @@ package im.vector.app.features.notifications import android.content.Context import androidx.annotation.WorkerThread -import androidx.core.content.pm.ShortcutManagerCompat import im.vector.app.features.notifications.NotificationDrawerManager.Companion.ROOM_EVENT_NOTIFICATION_ID import im.vector.app.features.notifications.NotificationDrawerManager.Companion.ROOM_INVITATION_NOTIFICATION_ID import im.vector.app.features.notifications.NotificationDrawerManager.Companion.ROOM_MESSAGES_NOTIFICATION_ID @@ -63,9 +62,6 @@ class NotificationRenderer @Inject constructor(private val notificationDisplayer } is RoomNotification.Message -> if (useCompleteNotificationFormat) { Timber.d("Updating room messages notification ${wrapper.meta.roomId}") - wrapper.shortcutInfo?.let { - ShortcutManagerCompat.pushDynamicShortcut(appContext, it) - } notificationDisplayer.showNotificationMessage(wrapper.meta.roomId, ROOM_MESSAGES_NOTIFICATION_ID, wrapper.notification) } } diff --git a/vector/src/main/java/im/vector/app/features/notifications/RoomGroupMessageCreator.kt b/vector/src/main/java/im/vector/app/features/notifications/RoomGroupMessageCreator.kt index bdd7d026f9..d50ccded64 100644 --- a/vector/src/main/java/im/vector/app/features/notifications/RoomGroupMessageCreator.kt +++ b/vector/src/main/java/im/vector/app/features/notifications/RoomGroupMessageCreator.kt @@ -18,14 +18,10 @@ package im.vector.app.features.notifications import android.content.Context import android.graphics.Bitmap -import android.os.Build import androidx.core.app.NotificationCompat import androidx.core.app.Person -import androidx.core.content.pm.ShortcutInfoCompat -import androidx.core.graphics.drawable.IconCompat import im.vector.app.R import im.vector.app.core.resources.StringProvider -import im.vector.app.features.home.room.detail.RoomDetailActivity import me.gujun.android.span.Span import me.gujun.android.span.span import timber.log.Timber @@ -61,17 +57,6 @@ class RoomGroupMessageCreator @Inject constructor( } val largeBitmap = getRoomBitmap(events) - val shortcutInfo = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { - val openRoomIntent = RoomDetailActivity.shortcutIntent(appContext, roomId) - ShortcutInfoCompat.Builder(appContext, roomId) - .setLongLived(true) - .setIntent(openRoomIntent) - .setShortLabel(roomName) - .setIcon(largeBitmap?.let { IconCompat.createWithAdaptiveBitmap(it) } ?: iconLoader.getUserIcon(events.last().senderAvatarPath)) - .build() - } else { - null - } val lastMessageTimestamp = events.last().timestamp val smartReplyErrors = events.filter { it.isSmartReplyError() } @@ -96,7 +81,6 @@ class RoomGroupMessageCreator @Inject constructor( userDisplayName, tickerText ), - shortcutInfo, meta ) }