Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5f4efd3b authored by Willie Koomson's avatar Willie Koomson
Browse files

Return null from getWidgetPreview instead of throwing error

If the provider is not found or the caller does not have permissions to
access the preview, return null from getWidgetPreview instead of
throwing IllegalArgumentException. This fixes certain launcher tests
that do not run with BIND_APPWIDGET permission.

Bug: 308041327
Test: Launcher3Tests:TaplOpenCloseAllAppsTest
Change-Id: Ie1617e2ef26ac3b4e7ec4a1dd0d3a3a71e50cd77
parent 0d5f65a7
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -4025,8 +4025,9 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku
                }
            }
        }
        throw new IllegalArgumentException(
                providerComponent + " is not a valid AppWidget provider");
        // Either the provider does not exist or the caller does not have permission to access its
        // previews.
        return null;
    }

    @Override