Merge "Allow dismissal of sensitive notification" into nyc-dev

This commit is contained in:
Selim Cinek
2016-02-23 00:55:58 +00:00
committed by Android (Google) Code Review
2 changed files with 6 additions and 3 deletions

View File

@@ -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) {

View File

@@ -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.