Rate limit calls to setWidgetPreview/removeWidgetPreview

Rate limit calls to widget preview APIs that trigger the
onProvidersChanged callback. The rate limit does not apply if the caller
is currently in the foreground.

Bug: 308041327
Test: AppWidgetTest#testGeneratedPreviewRateLimiting
Change-Id: I6baaf5a1a94ad63584135b4f297eda9dd2e9cddc
6 files changed