Merge branch 'hotfix/1.3.7-oom' into main

This commit is contained in:
Benoit Marty 2021-11-05 15:35:25 +01:00
commit 8b98c8fe1d

View file

@ -41,6 +41,7 @@ class ShortcutsHandler @Inject constructor(
private val pinCodeStore: PinCodeStore
) : PinCodeStoreListener {
private val isRequestPinShortcutSupported = ShortcutManagerCompat.isRequestPinShortcutSupported(context)
private val maxShortcutCountPerActivity = ShortcutManagerCompat.getMaxShortcutCountPerActivity(context)
// Value will be set correctly if necessary
private var hasPinCode = true
@ -93,7 +94,9 @@ class ShortcutsHandler @Inject constructor(
// No shortcut in this case (privacy)
ShortcutManagerCompat.removeAllDynamicShortcuts(context)
} else {
val shortcuts = rooms.mapIndexed { index, room ->
val shortcuts = rooms
.take(maxShortcutCountPerActivity)
.mapIndexed { index, room ->
shortcutCreator.create(room, index)
}