Fixed weird NPE in some oem adding widget (#3931)

This commit is contained in:
John Andrew Camu
2024-01-02 10:29:05 +08:00
committed by GitHub
parent abfc4e18b1
commit 59ecfea78d

View File

@@ -1537,6 +1537,9 @@ public class Launcher extends StatefulActivity<LauncherState>
hostView = mAppWidgetHolder.createView(this, appWidgetId, appWidgetInfo);
}
if (appWidgetInfo.provider == null) {
appWidgetInfo.provider = itemInfo.getTargetComponent();
}
LauncherAppWidgetInfo launcherInfo;
launcherInfo = new LauncherAppWidgetInfo(
appWidgetId, appWidgetInfo.provider, appWidgetInfo, hostView);