widget: disable android 15 preview

Seemingly causing reboots on my device, don't wanna risk it.
This commit is contained in:
Alexander Capehart 2024-10-23 09:08:11 -06:00
parent 3753b5f0cc
commit 82ddd3a24e
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47

View file

@ -92,7 +92,6 @@ class WidgetProvider : AppWidgetProvider() {
// arbitrary, but they are actually the minimum dimensions required to fit all of // arbitrary, but they are actually the minimum dimensions required to fit all of
// the widget elements, plus some leeway for text sizing. // the widget elements, plus some leeway for text sizing.
val defaultLayout = newThinDockedLayout(context, uiSettings, state) val defaultLayout = newThinDockedLayout(context, uiSettings, state)
awm.setWidgetPreviewCompat(ComponentName(context, this::class.java), defaultLayout)
val views = val views =
mapOf( mapOf(
SizeF(180f, 48f) to newThinStickLayout(context, state), SizeF(180f, 48f) to newThinStickLayout(context, state),
@ -158,10 +157,7 @@ class WidgetProvider : AppWidgetProvider() {
fun reset(context: Context, uiSettings: UISettings) { fun reset(context: Context, uiSettings: UISettings) {
L.d("Using default layout") L.d("Using default layout")
val layout = newDefaultLayout(context, uiSettings) val layout = newDefaultLayout(context, uiSettings)
AppWidgetManager.getInstance(context).apply { AppWidgetManager.getInstance(context).updateAppWidget(ComponentName(context, this::class.java), layout)
setWidgetPreviewCompat(ComponentName(context, this::class.java), layout)
updateAppWidget(ComponentName(context, this::class.java), layout)
}
} }
// --- INTERNAL METHODS --- // --- INTERNAL METHODS ---