Do not use getPackageContext where Icon.createWithResource just extracts the packageName

Bug: 182662365
Test: build & run
Change-Id: I681e5627ba87f0c644e57f22f0abf8112ec076a0
This commit is contained in:
Jeff DeCew
2021-03-16 10:12:42 -04:00
parent 4f1ad7e423
commit 6e5ef5533a

View File

@@ -476,7 +476,6 @@ class MediaDataManager(
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 ((index, action) in actions.withIndex()) {
if (action.getIcon() == null) {
@@ -499,7 +498,7 @@ class MediaDataManager(
null
}
val mediaActionIcon = if (action.getIcon()?.getType() == Icon.TYPE_RESOURCE) {
Icon.createWithResource(packageContext, action.getIcon()!!.getResId())
Icon.createWithResource(sbn.packageName, action.getIcon()!!.getResId())
} else {
action.getIcon()
}.setTint(themeText)