Block clicks on smart actions and replies just after creation/update.
To avoid accidental clicks on smart actions and replies we here block
clicks on those buttons just after they are created. We block clicks
on those buttons when a notification is updated - but only if the
buttons are new, or different from previous buttons shown in the
notification. I.e. if the notification is updated but the smart
suggestion buttons stay the same we don't block clicks on them.
Bug: 128683184
Test: manually ensure clicks are blocked within the initialization
delay (for new / changed buttons), and ensure the delay changes
when calling
adb shell device_config put systemui ssin_onclick_init_delay X
where X is the delay in ms.
Test: SmartReplyConstantsTest, SmartReplyViewTest
Change-Id: I9a44eb6ade6579a42e35b36cce4bd5863332c60e
diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml
index e02be38..99a75d2 100644
--- a/packages/SystemUI/res/values/config.xml
+++ b/packages/SystemUI/res/values/config.xml
@@ -469,6 +469,10 @@
-->
<integer name="config_smart_replies_in_notifications_max_num_actions">-1</integer>
+ <!-- Smart replies in notifications: Delay (ms) before smart suggestions are clickable, since
+ they were added. -->
+ <integer name="config_smart_replies_in_notifications_onclick_init_delay">200</integer>
+
<!-- Screenshot editing default activity. Must handle ACTION_EDIT image/png intents.
Blank sends the user to the Chooser first.
This name is in the ComponentName flattened format (package/class) -->