Merge "[Bugfix]create different pendingintent via appwidgetId" am: 71a5559a8b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2370509 Change-Id: Ifd3afe28f0071150a4f1cc05976ddc49531db27a Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -573,12 +573,6 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku
|
||||
}
|
||||
}
|
||||
|
||||
if (onClickIntent != null) {
|
||||
views.setOnClickPendingIntent(android.R.id.background,
|
||||
PendingIntent.getActivity(mContext, 0, onClickIntent,
|
||||
PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE));
|
||||
}
|
||||
|
||||
Icon icon = appInfo.icon != 0
|
||||
? Icon.createWithResource(appInfo.packageName, appInfo.icon)
|
||||
: Icon.createWithResource(mContext, android.R.drawable.sym_def_app_icon);
|
||||
@@ -590,6 +584,12 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku
|
||||
for (int j = 0; j < widgetCount; j++) {
|
||||
Widget widget = provider.widgets.get(j);
|
||||
if (targetWidget != null && targetWidget != widget) continue;
|
||||
if (onClickIntent != null) {
|
||||
views.setOnClickPendingIntent(android.R.id.background,
|
||||
PendingIntent.getActivity(mContext, widget.appWidgetId, onClickIntent,
|
||||
PendingIntent.FLAG_UPDATE_CURRENT
|
||||
| PendingIntent.FLAG_IMMUTABLE));
|
||||
}
|
||||
if (widget.replaceWithMaskedViewsLocked(views)) {
|
||||
scheduleNotifyUpdateAppWidgetLocked(widget, widget.getEffectiveViewsLocked());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user