diff --git a/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java b/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java index e35e4b3e39dc8..af6b24e1c3326 100644 --- a/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java +++ b/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java @@ -1142,7 +1142,7 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku } else { // For any widget other then the first one, we just send update intent // as we normally would. - sendUpdateIntentLocked(provider, new int[]{appWidgetId}); + sendUpdateIntentLocked(provider, new int[]{appWidgetId}, true); } // Schedule the future updates. @@ -2379,7 +2379,7 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku if (!canSendCombinedBroadcast) { // If this function is called by mistake, send two separate broadcasts instead sendEnableIntentLocked(p); - sendUpdateIntentLocked(p, appWidgetIds); + sendUpdateIntentLocked(p, appWidgetIds, true); return; } @@ -2399,12 +2399,12 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku sendBroadcastAsUser(intent, p.id.getProfile(), true); } - private void sendUpdateIntentLocked(Provider provider, int[] appWidgetIds) { + private void sendUpdateIntentLocked(Provider provider, int[] appWidgetIds, + boolean interactive) { Intent intent = new Intent(AppWidgetManager.ACTION_APPWIDGET_UPDATE); intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, appWidgetIds); intent.setComponent(provider.id.componentName); - // Periodic background widget update heartbeats are not an interactive use case - sendBroadcastAsUser(intent, provider.id.getProfile(), false); + sendBroadcastAsUser(intent, provider.id.getProfile(), interactive); } private void sendDeletedIntentLocked(Widget widget) { @@ -3589,7 +3589,7 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku scheduleNotifyProviderChangedLocked(widget); } // Now that we've told the host, push out an update. - sendUpdateIntentLocked(provider, appWidgetIds); + sendUpdateIntentLocked(provider, appWidgetIds, false); } } providersUpdated = true;