From 15217d98ac7bf9a333aa7a26e0dd9d95870e33d2 Mon Sep 17 00:00:00 2001 From: David Teresi Date: Fri, 27 Aug 2021 16:19:25 -0400 Subject: [PATCH] Only set SHORTCUT_CATEGORY_CONVERSATION above API 25 --- .../im/vector/app/features/home/ShortcutCreator.kt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/home/ShortcutCreator.kt b/vector/src/main/java/im/vector/app/features/home/ShortcutCreator.kt index 9b0ba64491..fc204a0c56 100644 --- a/vector/src/main/java/im/vector/app/features/home/ShortcutCreator.kt +++ b/vector/src/main/java/im/vector/app/features/home/ShortcutCreator.kt @@ -65,17 +65,19 @@ class ShortcutCreator @Inject constructor( } catch (failure: Throwable) { null } + val categories = if (Build.VERSION.SDK_INT >= 25) { + setOf(directShareCategory, ShortcutInfo.SHORTCUT_CATEGORY_CONVERSATION) + } else { + setOf(directShareCategory) + } + return ShortcutInfoCompat.Builder(context, roomSummary.roomId) .setShortLabel(roomSummary.displayName) .setIcon(bitmap?.toProfileImageIcon()) .setIntent(intent) .setLongLived(true) .setRank(rank) - - // Make it show up in the direct share menu - .setCategories(setOf( - directShareCategory, - ShortcutInfo.SHORTCUT_CATEGORY_CONVERSATION)) + .setCategories(categories) .build() }