fixed crash when opening app from widget

This commit is contained in:
Thibault Deckers 2024-07-11 18:59:02 +02:00
parent f4d2fa6089
commit dcc91cf5a3

View file

@ -41,16 +41,15 @@ class HomeWidgetProvider : AppWidgetProvider() {
for (widgetId in appWidgetIds) {
val widgetInfo = appWidgetManager.getAppWidgetOptions(widgetId)
goAsync().run {
defaultScope.launch {
val backgroundProps = getProps(context, widgetId, widgetInfo, drawEntryImage = false)
updateWidgetImage(context, appWidgetManager, widgetId, backgroundProps)
val pendingResult = goAsync()
defaultScope.launch() {
val backgroundProps = getProps(context, widgetId, widgetInfo, drawEntryImage = false)
updateWidgetImage(context, appWidgetManager, widgetId, backgroundProps)
val imageProps = getProps(context, widgetId, widgetInfo, drawEntryImage = true, reuseEntry = false)
updateWidgetImage(context, appWidgetManager, widgetId, imageProps)
val imageProps = getProps(context, widgetId, widgetInfo, drawEntryImage = true, reuseEntry = false)
updateWidgetImage(context, appWidgetManager, widgetId, imageProps)
finish()
}
pendingResult?.finish()
}
}
}