Use generated RemoteViews preview for widget picker if available
WidgetCell will use the generated RemoteViews preview to display
previews in the widget picker. It will fallback to current preview
methods if not available.
Introduces WidgetManagerHelper.loadGeneratedPreviews as a utility
function. WidgetManagerHelper is passed into the constructor of
WidgetItem to avoid calling
context.getSystemService(AppWidgetManager.class) for each widget.
Bug: 308041327
Test: atest Launcher3Tests:GeneratedPreviewTest
Flag: ACONFIG com.android.launcher3.enable_generated_previews DEVELOPMENT
Change-Id: I37429057cda83a5321884ace2537038e050b9a58
diff --git a/Android.bp b/Android.bp
index eca0778..7856f07 100644
--- a/Android.bp
+++ b/Android.bp
@@ -202,6 +202,7 @@
"animationlib",
"com_android_launcher3_flags_lib",
"com_android_wm_shell_flags_lib",
+ "android.appwidget.flags-aconfig-java",
],
sdk_version: "current",
min_sdk_version: min_launcher3_sdk_version,