Fix non responding slice toggling

The issue happens when users are toggling slices. Sometimes the toggle
doesn't work as expected because the pending intent of the toggle action
seems to be canceled for some reasons.

Hence, we replace FLAG_CANCEL_CURRENT with FLAG_UPDATE_CURRENT to
prevent from getting PendingIntent.CancelExcpetion from SliceActionView
when toggling slices.

This change only applies on those auto converted Slices.

Bug: 142107748
Test: toggle slices in Settings Search and NGA
Change-Id: Iff724ce5f6a1e6a7d9ca85b8ce76539a72e72964
This commit is contained in:
Yi-Ling Chuang
2019-10-07 10:24:27 +08:00
parent 764115ca4e
commit ddf6cefcac

View File

@@ -159,7 +159,7 @@ public class SliceBuilderUtils {
.setClass(context, SliceBroadcastReceiver.class) .setClass(context, SliceBroadcastReceiver.class)
.putExtra(EXTRA_SLICE_KEY, data.getKey()); .putExtra(EXTRA_SLICE_KEY, data.getKey());
return PendingIntent.getBroadcast(context, 0 /* requestCode */, intent, return PendingIntent.getBroadcast(context, 0 /* requestCode */, intent,
PendingIntent.FLAG_CANCEL_CURRENT); PendingIntent.FLAG_UPDATE_CURRENT);
} }
/** /**