Skip to content

Commit 3092de8

Browse files
committed
Only set SHORTCUT_CATEGORY_CONVERSATION above API 25
1 parent 2004d35 commit 3092de8

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

vector/src/main/java/im/vector/app/features/home/ShortcutCreator.kt

+7-5
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,19 @@ class ShortcutCreator @Inject constructor(
6565
} catch (failure: Throwable) {
6666
null
6767
}
68+
val categories = if (Build.VERSION.SDK_INT >= 25) {
69+
setOf(directShareCategory, ShortcutInfo.SHORTCUT_CATEGORY_CONVERSATION)
70+
} else {
71+
setOf(directShareCategory)
72+
}
73+
6874
return ShortcutInfoCompat.Builder(context, roomSummary.roomId)
6975
.setShortLabel(roomSummary.displayName)
7076
.setIcon(bitmap?.toProfileImageIcon())
7177
.setIntent(intent)
7278
.setLongLived(true)
7379
.setRank(rank)
74-
75-
// Make it show up in the direct share menu
76-
.setCategories(setOf(
77-
directShareCategory,
78-
ShortcutInfo.SHORTCUT_CATEGORY_CONVERSATION))
80+
.setCategories(categories)
7981

8082
.build()
8183
}

0 commit comments

Comments
 (0)