mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-12-21 16:44:37 +03:00
Merge branch 'hotfix/1.3.7-oom' into main
This commit is contained in:
commit
8b98c8fe1d
1 changed files with 6 additions and 3 deletions
|
@ -41,6 +41,7 @@ class ShortcutsHandler @Inject constructor(
|
||||||
private val pinCodeStore: PinCodeStore
|
private val pinCodeStore: PinCodeStore
|
||||||
) : PinCodeStoreListener {
|
) : PinCodeStoreListener {
|
||||||
private val isRequestPinShortcutSupported = ShortcutManagerCompat.isRequestPinShortcutSupported(context)
|
private val isRequestPinShortcutSupported = ShortcutManagerCompat.isRequestPinShortcutSupported(context)
|
||||||
|
private val maxShortcutCountPerActivity = ShortcutManagerCompat.getMaxShortcutCountPerActivity(context)
|
||||||
|
|
||||||
// Value will be set correctly if necessary
|
// Value will be set correctly if necessary
|
||||||
private var hasPinCode = true
|
private var hasPinCode = true
|
||||||
|
@ -93,9 +94,11 @@ class ShortcutsHandler @Inject constructor(
|
||||||
// No shortcut in this case (privacy)
|
// No shortcut in this case (privacy)
|
||||||
ShortcutManagerCompat.removeAllDynamicShortcuts(context)
|
ShortcutManagerCompat.removeAllDynamicShortcuts(context)
|
||||||
} else {
|
} else {
|
||||||
val shortcuts = rooms.mapIndexed { index, room ->
|
val shortcuts = rooms
|
||||||
shortcutCreator.create(room, index)
|
.take(maxShortcutCountPerActivity)
|
||||||
}
|
.mapIndexed { index, room ->
|
||||||
|
shortcutCreator.create(room, index)
|
||||||
|
}
|
||||||
|
|
||||||
shortcuts.forEach { shortcut ->
|
shortcuts.forEach { shortcut ->
|
||||||
ShortcutManagerCompat.pushDynamicShortcut(context, shortcut)
|
ShortcutManagerCompat.pushDynamicShortcut(context, shortcut)
|
||||||
|
|
Loading…
Reference in a new issue