Merge "SystemUI: fix notification redaction logic." into oc-dev

This commit is contained in:
Charles He
2017-06-01 07:56:49 +00:00
committed by Android (Google) Code Review

View File

@@ -1826,23 +1826,20 @@ public class StatusBar extends SystemUI implements DemoMode,
// temporarily become children if they were isolated before. // temporarily become children if they were isolated before.
continue; continue;
} }
int vis = ent.notification.getNotification().visibility;
int userId = ent.notification.getUserId(); int userId = ent.notification.getUserId();
// Display public version of the notification if we need to redact. // Display public version of the notification if we need to redact.
boolean deviceSensitive = (isLockscreenPublicMode(mCurrentUserId) boolean devicePublic = isLockscreenPublicMode(mCurrentUserId);
&& !userAllowsPrivateNotificationsInPublic(mCurrentUserId)); boolean userPublic = devicePublic || isLockscreenPublicMode(userId);
boolean userSensitive = deviceSensitive || (isLockscreenPublicMode(userId) boolean needsRedaction = needsRedaction(ent);
&& !userAllowsPrivateNotificationsInPublic(userId)); boolean sensitive = userPublic && needsRedaction;
boolean sensitiveNote = vis == Notification.VISIBILITY_PRIVATE; boolean deviceSensitive = devicePublic
boolean sensitivePackage = packageHasVisibilityOverride(ent.notification.getKey()); && !userAllowsPrivateNotificationsInPublic(mCurrentUserId);
boolean sensitive = (sensitiveNote && userSensitive) || sensitivePackage; if (sensitive) {
boolean showingPublic = sensitive && isLockscreenPublicMode(userId);
if (showingPublic) {
updatePublicContentView(ent, ent.notification); updatePublicContentView(ent, ent.notification);
} }
ent.row.setSensitive(sensitive, deviceSensitive); ent.row.setSensitive(sensitive, deviceSensitive);
ent.row.setNeedsRedaction(needsRedaction(ent)); ent.row.setNeedsRedaction(needsRedaction);
if (mGroupManager.isChildInGroupWithSummary(ent.row.getStatusBarNotification())) { if (mGroupManager.isChildInGroupWithSummary(ent.row.getStatusBarNotification())) {
ExpandableNotificationRow summary = mGroupManager.getGroupSummary( ExpandableNotificationRow summary = mGroupManager.getGroupSummary(
ent.row.getStatusBarNotification()); ent.row.getStatusBarNotification());