mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-01-31 03:17:13 +01:00
remove also LongLivedShortcuts
This commit is contained in:
parent
214deaa474
commit
95247f8b10
@ -75,7 +75,11 @@ class ShortcutsHandler @Inject constructor(
|
||||
return
|
||||
}
|
||||
|
||||
ShortcutManagerCompat.removeAllDynamicShortcuts(context)
|
||||
// according to https://developer.android.com/reference/androidx/core/content/pm/ShortcutManagerCompat#removeLongLivedShortcuts(android.content.Context,%20java.util.List%3Cjava.lang.String%3E)
|
||||
// removeLongLivedShortcuts for API 29 and lower should behave like removeDynamicShortcuts(Context, List)
|
||||
// getDynamicShortcuts: returns all dynamic shortcuts from the app.
|
||||
val shortcuts = ShortcutManagerCompat.getDynamicShortcuts(context).map { it.id }
|
||||
ShortcutManagerCompat.removeLongLivedShortcuts(context, shortcuts)
|
||||
|
||||
// We can only disabled pinned shortcuts with the API, but at least it will prevent the crash
|
||||
if (ShortcutManagerCompat.isRequestPinShortcutSupported(context)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user