summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Beth Thibodeau <ethibodeau@google.com> 2020-05-22 18:23:32 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2020-05-22 18:23:32 +0000
commit8032fd3d0c48ae9414c1e2b60f97e95bbec28caa (patch)
tree71bacabc8a443eacd989b9a8268018095363e074
parentf31ae3b370681bac6919f0dc3ba1addf9d45159f (diff)
parentf75175ff9190ad597126bf1a6d39e2bacda61703 (diff)
Merge "Make sure actions have icons" into rvc-dev
-rw-r--r--packages/SystemUI/src/com/android/systemui/media/MediaDataManager.kt9
1 files changed, 7 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/media/MediaDataManager.kt b/packages/SystemUI/src/com/android/systemui/media/MediaDataManager.kt
index 8cbe3ecf5387..009f5494cefe 100644
--- a/packages/SystemUI/src/com/android/systemui/media/MediaDataManager.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/MediaDataManager.kt
@@ -199,12 +199,17 @@ class MediaDataManager @Inject constructor(
val actionIcons: MutableList<MediaAction> = ArrayList()
val actions = notif.actions
val actionsToShowCollapsed = notif.extras.getIntArray(
- Notification.EXTRA_COMPACT_ACTIONS)?.toList() ?: emptyList()
+ Notification.EXTRA_COMPACT_ACTIONS)?.toMutableList() ?: mutableListOf<Int>()
// TODO: b/153736623 look into creating actions when this isn't a media style notification
val packageContext: Context = sbn.getPackageContext(context)
if (actions != null) {
- for (action in actions) {
+ for ((index, action) in actions.withIndex()) {
+ if (action.getIcon() == null) {
+ Log.i(TAG, "No icon for action $index ${action.title}")
+ actionsToShowCollapsed.remove(index)
+ continue
+ }
val mediaAction = MediaAction(
action.getIcon().loadDrawable(packageContext),
action.actionIntent,