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

Commit 3c76d509 authored by Selim Cinek's avatar Selim Cinek
Browse files

Allow dismissal of sensitive notification

If the general setting is not to hide sensitive information
we allow the user to dismiss it.

Bug: 26328503
Change-Id: Ibea5d94e544291f00d8a2923b8cbf14170510bd8
parent e4c068d2
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -80,6 +80,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
    /** Are we showing the "public" version */
    private boolean mShowingPublic;
    private boolean mSensitive;
    private boolean mSensitiveHiddenInGeneral;
    private boolean mShowingPublicInitialized;
    private boolean mHideSensitiveForIntrinsicHeight;

@@ -1041,8 +1042,9 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
        getShowingLayout().requestSelectLayout(needsAnimation || isUserLocked());
    }

    public void setSensitive(boolean sensitive) {
    public void setSensitive(boolean sensitive, boolean hideSensitive) {
        mSensitive = sensitive;
        mSensitiveHiddenInGeneral = hideSensitive;
    }

    public void setHideSensitiveForIntrinsicHeight(boolean hideSensitive) {
@@ -1114,7 +1116,8 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {

    private void updateClearability() {
        // public versions cannot be dismissed
        mVetoButton.setVisibility(isClearable() && !mShowingPublic ? View.VISIBLE : View.GONE);
        mVetoButton.setVisibility(isClearable() && (!mShowingPublic
                || !mSensitiveHiddenInGeneral) ? View.VISIBLE : View.GONE);
    }

    public void setChildrenExpanded(boolean expanded, boolean animate) {
+1 −1
Original line number Diff line number Diff line
@@ -1416,7 +1416,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
            if (showingPublic) {
                updatePublicContentView(ent, ent.notification);
            }
            ent.row.setSensitive(sensitive);
            ent.row.setSensitive(sensitive, hideSensitive);
            if (ent.autoRedacted && ent.legacy) {
                // TODO: Also fade this? Or, maybe easier (and better), provide a dark redacted form
                // for legacy auto redacted notifications.