diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java index 0124a68fad373..f2a3e441ce95e 100644 --- a/core/java/android/app/Notification.java +++ b/core/java/android/app/Notification.java @@ -3192,6 +3192,25 @@ public class Notification implements Parcelable return null; } + /** + * Returns the actions that are contextual (marked as SEMANTIC_ACTION_CONTEXTUAL_SUGGESTION) out + * of the actions in this notification. + * + * @hide + */ + public List getContextualActions() { + if (actions == null) return Collections.emptyList(); + + List contextualActions = new ArrayList<>(); + for (Notification.Action action : actions) { + if (action.getSemanticAction() + == Notification.Action.SEMANTIC_ACTION_CONTEXTUAL_SUGGESTION) { + contextualActions.add(action); + } + } + return contextualActions; + } + /** * Builder class for {@link Notification} objects. * diff --git a/packages/SystemUI/res/layout/smart_action_button.xml b/packages/SystemUI/res/layout/smart_action_button.xml new file mode 100644 index 0000000000000..271603479482b --- /dev/null +++ b/packages/SystemUI/res/layout/smart_action_button.xml @@ -0,0 +1,34 @@ + + + +