From e786ce000ea094196eac98098a098e71d19f3bf6 Mon Sep 17 00:00:00 2001 From: Yi-Ling Chuang Date: Mon, 7 Oct 2019 10:24:27 +0800 Subject: [PATCH] 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: 140719905 Test: toggle slices in Settings Search and NGA Change-Id: Iff724ce5f6a1e6a7d9ca85b8ce76539a72e72964 Merged-In: Iff724ce5f6a1e6a7d9ca85b8ce76539a72e72964 (cherry picked from commit ddf6cefcaccf669150bb4d61e37c1d78ccbe91b0) --- src/com/android/settings/slices/SliceBuilderUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/settings/slices/SliceBuilderUtils.java b/src/com/android/settings/slices/SliceBuilderUtils.java index 0e510325f8b..5585be3a132 100644 --- a/src/com/android/settings/slices/SliceBuilderUtils.java +++ b/src/com/android/settings/slices/SliceBuilderUtils.java @@ -173,7 +173,7 @@ public class SliceBuilderUtils { .putExtra(EXTRA_SLICE_KEY, data.getKey()) .putExtra(EXTRA_SLICE_PLATFORM_DEFINED, data.isPlatformDefined()); return PendingIntent.getBroadcast(context, 0 /* requestCode */, intent, - PendingIntent.FLAG_CANCEL_CURRENT); + PendingIntent.FLAG_UPDATE_CURRENT); } /**