summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorKenny Guy <kennyguy@google.com>2014-05-08 23:34:12 +0100
committerKenny Guy <kennyguy@google.com>2014-06-05 16:58:52 +0000
commit8a0101bade3f817d925bd931d0b83bc454dedea4 (patch)
tree889ca61584bc3ad73a64731e3a109be9f71038a5 /packages
parent3af4edf57294a72b55f57baed7e044dc2055678a (diff)
downloadframeworks_base-8a0101bade3f817d925bd931d0b83bc454dedea4.zip
frameworks_base-8a0101bade3f817d925bd931d0b83bc454dedea4.tar.gz
frameworks_base-8a0101bade3f817d925bd931d0b83bc454dedea4.tar.bz2
Badge notification from managed profiles.
Add a method to the UserManager to provide access to bitmap of badge for managed profile. Overlay the icon view in notification templates with the badge from the UserManager. Notifications with custom views won't be badged. Bug: 12641490 Change-Id: I1f2aae927e75fc8a955e4d5bbc3cc81127d87069 (cherry picked from commit 0f4ab980227e8c298bfcd34dd85aad0febad528c)
Diffstat (limited to 'packages')
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java19
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java1
2 files changed, 17 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
index 06cc476..d1484e1 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
@@ -992,7 +992,10 @@ public abstract class BaseStatusBar extends SystemUI implements
title.setText(entry.notification.getPackageName());
}
- final ImageView icon = (ImageView) publicViewLocal.findViewById(com.android.internal.R.id.icon);
+ final ImageView icon = (ImageView) publicViewLocal.findViewById(
+ com.android.internal.R.id.icon);
+ final ImageView profileIcon = (ImageView) publicViewLocal.findViewById(
+ com.android.internal.R.id.profile_icon);
final StatusBarIcon ic = new StatusBarIcon(entry.notification.getPackageName(),
entry.notification.getUser(),
@@ -1008,7 +1011,19 @@ public abstract class BaseStatusBar extends SystemUI implements
com.android.internal.R.drawable.notification_icon_legacy_bg_inset);
}
- final TextView text = (TextView) publicViewLocal.findViewById(com.android.internal.R.id.text);
+ if (profileIcon != null) {
+ Drawable profileDrawable
+ = mUserManager.getBadgeForUser(entry.notification.getUser());
+ if (profileDrawable != null) {
+ profileIcon.setImageDrawable(profileDrawable);
+ profileIcon.setVisibility(View.VISIBLE);
+ } else {
+ profileIcon.setVisibility(View.GONE);
+ }
+ }
+
+ final TextView text = (TextView) publicViewLocal.findViewById(
+ com.android.internal.R.id.text);
text.setText("Unlock your device to see this notification.");
// TODO: fill out "time" as well
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index e55de94..d9005d8 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -1185,7 +1185,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
Entry ent = mNotificationData.get(i);
if (!(provisioned || showNotificationEvenIfUnprovisioned(ent.notification))) continue;
- // TODO How do we want to badge notifcations from profiles.
if (!notificationIsForCurrentProfiles(ent.notification)) continue;
final int vis = ent.notification.getNotification().visibility;