Immutable pending intents

This commit is contained in:
M66B
2021-03-27 18:54:55 +01:00
parent 5b73fb8403
commit fbc8112104
10 changed files with 72 additions and 31 deletions

View File

@@ -40,7 +40,8 @@ public class WidgetSync extends AppWidgetProvider {
try {
Intent intent = new Intent(enabled ? ServiceExternal.ACTION_DISABLE : ServiceExternal.ACTION_ENABLE);
PendingIntent pi = PendingIntent.getService(context, ServiceExternal.PI_WIDGET_ENABLE, intent, PendingIntent.FLAG_UPDATE_CURRENT);
PendingIntent pi = PendingIntentCompat.getService(
context, ServiceExternal.PI_WIDGET_ENABLE, intent, PendingIntent.FLAG_UPDATE_CURRENT);
for (int appWidgetId : appWidgetIds) {
boolean semi = prefs.getBoolean("widget." + appWidgetId + ".semi", true);
int background = prefs.getInt("widget." + appWidgetId + ".background", Color.TRANSPARENT);