From e191f901d9af36f5eeda99758a8319829a9a5b88 Mon Sep 17 00:00:00 2001 From: Bryan Mawhinney Date: Tue, 22 Jul 2014 12:50:09 +0100 Subject: [PATCH] Store actions passed to MediaStyle.setShowActionsInCompactView in extras So that they can be bridged appropriately by Android Wear Change-Id: I3a21a74991c8067ece1a04fbd0b92dd21438e0fd --- api/current.txt | 1 + core/java/android/app/Notification.java | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/api/current.txt b/api/current.txt index 4a96399692aa6..9408c70571312 100644 --- a/api/current.txt +++ b/api/current.txt @@ -4588,6 +4588,7 @@ package android.app { field public static final int DEFAULT_SOUND = 1; // 0x1 field public static final int DEFAULT_VIBRATE = 2; // 0x2 field public static final java.lang.String EXTRA_BACKGROUND_IMAGE_URI = "android.backgroundImageUri"; + field public static final java.lang.String EXTRA_COMPACT_ACTIONS = "android.compactActions"; field public static final java.lang.String EXTRA_INFO_TEXT = "android.infoText"; field public static final java.lang.String EXTRA_LARGE_ICON = "android.largeIcon"; field public static final java.lang.String EXTRA_LARGE_ICON_BIG = "android.largeIcon.big"; diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java index da59a0338deb9..5782edc3e498b 100644 --- a/core/java/android/app/Notification.java +++ b/core/java/android/app/Notification.java @@ -798,6 +798,12 @@ public class Notification implements Parcelable */ public static final String EXTRA_MEDIA_SESSION = "android.mediaSession"; + /** + * {@link #extras} key: the indices of actions to be shown in the compact view, + * as supplied to (e.g.) {@link MediaStyle#setShowActionsInCompactView(int...)}. + */ + public static final String EXTRA_COMPACT_ACTIONS = "android.compactActions"; + /** * Value for {@link #EXTRA_AS_HEADS_UP} that indicates this notification should not be * displayed in the heads up space. @@ -3362,6 +3368,9 @@ public class Notification implements Parcelable if (mToken != null) { extras.putParcelable(EXTRA_MEDIA_SESSION, mToken); } + if (mActionsToShowInCompact != null) { + extras.putIntArray(EXTRA_COMPACT_ACTIONS, mActionsToShowInCompact); + } } private RemoteViews generateMediaActionButton(Action action) {