Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5f3cab51 authored by Charles He's avatar Charles He Committed by Android (Google) Code Review
Browse files

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

parents 1a3bf132 0d9f7d7b
Loading
Loading
Loading
Loading
+8 −11
Original line number Diff line number Diff line
@@ -1826,23 +1826,20 @@ public class StatusBar extends SystemUI implements DemoMode,
                // temporarily become children if they were isolated before.
                continue;
            }
            int vis = ent.notification.getNotification().visibility;
            int userId = ent.notification.getUserId();

            // Display public version of the notification if we need to redact.
            boolean deviceSensitive = (isLockscreenPublicMode(mCurrentUserId)
                    && !userAllowsPrivateNotificationsInPublic(mCurrentUserId));
            boolean userSensitive = deviceSensitive || (isLockscreenPublicMode(userId)
                    && !userAllowsPrivateNotificationsInPublic(userId));
            boolean sensitiveNote = vis == Notification.VISIBILITY_PRIVATE;
            boolean sensitivePackage = packageHasVisibilityOverride(ent.notification.getKey());
            boolean sensitive = (sensitiveNote && userSensitive) || sensitivePackage;
            boolean showingPublic = sensitive && isLockscreenPublicMode(userId);
            if (showingPublic) {
            boolean devicePublic = isLockscreenPublicMode(mCurrentUserId);
            boolean userPublic = devicePublic || isLockscreenPublicMode(userId);
            boolean needsRedaction = needsRedaction(ent);
            boolean sensitive = userPublic && needsRedaction;
            boolean deviceSensitive = devicePublic
                    && !userAllowsPrivateNotificationsInPublic(mCurrentUserId);
            if (sensitive) {
                updatePublicContentView(ent, ent.notification);
            }
            ent.row.setSensitive(sensitive, deviceSensitive);
            ent.row.setNeedsRedaction(needsRedaction(ent));
            ent.row.setNeedsRedaction(needsRedaction);
            if (mGroupManager.isChildInGroupWithSummary(ent.row.getStatusBarNotification())) {
                ExpandableNotificationRow summary = mGroupManager.getGroupSummary(
                        ent.row.getStatusBarNotification());