Merge "[Bugfix]create different pendingintent via appwidgetId" into tm-qpr-dev
This commit is contained in:
@@ -579,12 +579,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 icon = appInfo.icon != 0
|
||||||
? Icon.createWithResource(appInfo.packageName, appInfo.icon)
|
? Icon.createWithResource(appInfo.packageName, appInfo.icon)
|
||||||
: Icon.createWithResource(mContext, android.R.drawable.sym_def_app_icon);
|
: Icon.createWithResource(mContext, android.R.drawable.sym_def_app_icon);
|
||||||
@@ -596,6 +590,12 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku
|
|||||||
for (int j = 0; j < widgetCount; j++) {
|
for (int j = 0; j < widgetCount; j++) {
|
||||||
Widget widget = provider.widgets.get(j);
|
Widget widget = provider.widgets.get(j);
|
||||||
if (targetWidget != null && targetWidget != widget) continue;
|
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)) {
|
if (widget.replaceWithMaskedViewsLocked(views)) {
|
||||||
scheduleNotifyUpdateAppWidgetLocked(widget, widget.getEffectiveViewsLocked());
|
scheduleNotifyUpdateAppWidgetLocked(widget, widget.getEffectiveViewsLocked());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user