From 750ec58fecfce6cb7bc4d349086b4e3f7a8202b3 Mon Sep 17 00:00:00 2001 From: Beth Thibodeau Date: Wed, 18 Sep 2019 15:14:09 -0400 Subject: Output switch button in media notification header Adds a chip-like button to the header of media notifications which will open the media output slice. This was previously implemented as an action button behind the feature flag and can be enabled by toggling settings_seamless_transfer Test: manual Change-Id: I447b0add9d9de378fa09b5cf087518a81ec941e5 --- core/java/android/app/Notification.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'core/java/android/app/Notification.java') diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java index bb4e99873f26..2f03ed484e96 100644 --- a/core/java/android/app/Notification.java +++ b/core/java/android/app/Notification.java @@ -8150,7 +8150,9 @@ public class Notification implements Parcelable Action action, StandardTemplateParams p) { final boolean tombstone = (action.actionIntent == null); container.setViewVisibility(buttonId, View.VISIBLE); - container.setImageViewIcon(buttonId, action.getIcon()); + if (buttonId != R.id.media_seamless) { + container.setImageViewIcon(buttonId, action.getIcon()); + } // If the action buttons should not be tinted, then just use the default // notification color. Otherwise, just use the passed-in color. @@ -8204,6 +8206,10 @@ public class Notification implements Parcelable view.setViewVisibility(MEDIA_BUTTON_IDS[i], View.GONE); } } + bindMediaActionButton(view, R.id.media_seamless, new Action( + R.drawable.ic_media_seamless, mBuilder.mContext.getString( + com.android.internal.R.string.ext_media_seamless_action), null), p); + view.setViewVisibility(R.id.media_seamless, View.GONE); handleImage(view); // handle the content margin int endMargin = R.dimen.notification_content_margin_end; -- cgit v1.2.3