Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eda4be30 authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Correctly deliver AppWidgetProvider.onDeleted() events.

When the AppWidgetService sends APPWIDGET_DELETED
broadcasts, it only sends a single APPWIDGET_ID extra.  This
change fixes the Provider to handle this extra correctly.

Fixes http://b/issue?id=1800738
parent d48ca22b
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -64,11 +64,9 @@ public class AppWidgetProvider extends BroadcastReceiver {
        }
        else if (AppWidgetManager.ACTION_APPWIDGET_DELETED.equals(action)) {
            Bundle extras = intent.getExtras();
            if (extras != null) {
                int[] appWidgetIds = extras.getIntArray(AppWidgetManager.EXTRA_APPWIDGET_IDS);
                if (appWidgetIds != null && appWidgetIds.length > 0) {
                    this.onDeleted(context, appWidgetIds);
                }
            if (extras != null && extras.containsKey(AppWidgetManager.EXTRA_APPWIDGET_ID)) {
                final int appWidgetId = extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID);
                this.onDeleted(context, new int[] { appWidgetId });
            }
        }
        else if (AppWidgetManager.ACTION_APPWIDGET_ENABLED.equals(action)) {