diff options
author | Dan Sandler <dsandler@android.com> | 2015-07-22 10:45:30 -0400 |
---|---|---|
committer | Dan Sandler <dsandler@android.com> | 2015-07-29 13:50:32 -0400 |
commit | 68079d54f3690885df9c5bbb691090633f3ef541 (patch) | |
tree | 4e38d02f0a1b2b9367e54e23bfd97db019e63986 /packages | |
parent | 8be305dd6582f154c5a5894034a35fc8ec225b71 (diff) | |
download | frameworks_base-68079d54f3690885df9c5bbb691090633f3ef541.zip frameworks_base-68079d54f3690885df9c5bbb691090633f3ef541.tar.gz frameworks_base-68079d54f3690885df9c5bbb691090633f3ef541.tar.bz2 |
Fix media notification action icons.
In addition to cleaning up some bare references to the icon
slot, we now apply updates to notification RemoteViews in
the context of the supplying app's package. This ensures we
can find the drawables inside any Icon objects that were
constructed without a proper package name, such as is the
case with Actions (because the builder and constructor are
Context-free and so don't know the package name).
This CL also makes clear what was previously only implied:
Non-resource action icons are not actually supported yet
since they can't be pushed to TextView compound drawables
using today's RemoteViews APIs. That will require an API
change.
Bug: 22600607
Change-Id: Ie6b88aed36e4db05be35f843ea3bc1898d4a5c96
Diffstat (limited to 'packages')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java index a2e6632..d5da179 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java @@ -1328,14 +1328,20 @@ public abstract class BaseStatusBar extends SystemUI implements View bigContentViewLocal = null; View headsUpContentViewLocal = null; try { - contentViewLocal = contentView.apply(mContext, contentContainer, + contentViewLocal = contentView.apply( + sbn.getPackageContext(mContext), + contentContainer, mOnClickHandler); if (bigContentView != null) { - bigContentViewLocal = bigContentView.apply(mContext, contentContainer, + bigContentViewLocal = bigContentView.apply( + sbn.getPackageContext(mContext), + contentContainer, mOnClickHandler); } if (headsUpContentView != null) { - headsUpContentViewLocal = headsUpContentView.apply(mContext, contentContainer, + headsUpContentViewLocal = headsUpContentView.apply( + sbn.getPackageContext(mContext), + contentContainer, mOnClickHandler); } } @@ -1362,7 +1368,8 @@ public abstract class BaseStatusBar extends SystemUI implements View publicViewLocal = null; if (publicNotification != null) { try { - publicViewLocal = publicNotification.contentView.apply(mContext, + publicViewLocal = publicNotification.contentView.apply( + sbn.getPackageContext(mContext), contentContainerPublic, mOnClickHandler); if (publicViewLocal != null) { @@ -1981,15 +1988,18 @@ public abstract class BaseStatusBar extends SystemUI implements // Reapply the RemoteViews contentView.reapply(mContext, entry.getContentView(), mOnClickHandler); if (bigContentView != null && entry.getExpandedContentView() != null) { - bigContentView.reapply(mContext, entry.getExpandedContentView(), + bigContentView.reapply(notification.getPackageContext(mContext), + entry.getExpandedContentView(), mOnClickHandler); } View headsUpChild = entry.getHeadsUpContentView(); if (headsUpContentView != null && headsUpChild != null) { - headsUpContentView.reapply(mContext, headsUpChild, mOnClickHandler); + headsUpContentView.reapply(notification.getPackageContext(mContext), + headsUpChild, mOnClickHandler); } if (publicContentView != null && entry.getPublicContentView() != null) { - publicContentView.reapply(mContext, entry.getPublicContentView(), mOnClickHandler); + publicContentView.reapply(notification.getPackageContext(mContext), + entry.getPublicContentView(), mOnClickHandler); } // update the contentIntent mNotificationClicker.register(entry.row, notification); |