From fc14807d7a37fd9fd368649f0fb7fcc0ef288969 Mon Sep 17 00:00:00 2001 From: Pinyao Ting Date: Mon, 12 Sep 2022 16:46:16 -0700 Subject: [PATCH] Fix launcher crash related to widget updates LauncherAppWidgetHost fails to cleanup deferred widget when launcher started binding the widgets in workspace, which leads to a crash because widgets that was previously attached to the workspace get re-attached to the workspace. Bug: 245016152 Test: manual Change-Id: I4de261e08cfdcee74f210c39bcadf403b98887ab --- src/com/android/launcher3/widget/LauncherAppWidgetHost.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/com/android/launcher3/widget/LauncherAppWidgetHost.java b/src/com/android/launcher3/widget/LauncherAppWidgetHost.java index 5ce8fcf2e1..3e80699f59 100644 --- a/src/com/android/launcher3/widget/LauncherAppWidgetHost.java +++ b/src/com/android/launcher3/widget/LauncherAppWidgetHost.java @@ -323,6 +323,7 @@ public class LauncherAppWidgetHost extends AppWidgetHost { if (FeatureFlags.ENABLE_CACHED_WIDGET.get()) { // First, we clear any previously cached content from existing widgets mCachedRemoteViews.clear(); + mDeferredViews.clear(); // Then we proceed to cache the content from the widgets for (int i = 0; i < mViews.size(); i++) { final int appWidgetId = mViews.keyAt(i);