fix: Ignore generatedPreviews flags on Vanilla Ice Cream and above

This is always enabled on correct AOSP implementations, crashes should be handled by OEM
This commit is contained in:
Pun Butrach
2025-12-05 22:51:06 +07:00
parent e58cf687a2
commit f831a3bf4e
3 changed files with 5 additions and 4 deletions

View File

@@ -55,7 +55,7 @@ public class WidgetItem extends ComponentKey {
spanX = Math.min(info.spanX, idp.numColumns);
spanY = Math.min(info.spanY, idp.numRows);
if (BuildCompat.isAtLeastV() && Flags.enableGeneratedPreviews()) {
if (BuildCompat.isAtLeastV()) {
generatedPreviews = new SparseArray<>(3);
for (int widgetCategory : new int[] {
WIDGET_CATEGORY_HOME_SCREEN,
@@ -120,7 +120,7 @@ public class WidgetItem extends ComponentKey {
* category.
*/
public boolean hasGeneratedPreview(int widgetCategory) {
if (!Flags.enableGeneratedPreviews() || generatedPreviews == null) {
if (!Utilities.ATLEAST_V || generatedPreviews == null) {
return false;
}
return generatedPreviews.contains(widgetCategory)