diff options
author | Dan Sandler <dsandler@android.com> | 2014-07-18 17:54:23 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-07-17 19:26:18 +0000 |
commit | 2083deb8f9ae0ac83ab2c9dc3de8e53a7b4ea2a5 (patch) | |
tree | e6a9d1bd10ed08d932b20d63483c9b0654e050f1 /packages/SystemUI/src/com/android | |
parent | 891f5b2638f30479eb8d78ecb28ba0b39808fca4 (diff) | |
parent | 1b71878e4ee94c958b7da68ff650b5712bcc7fce (diff) | |
download | frameworks_base-2083deb8f9ae0ac83ab2c9dc3de8e53a7b4ea2a5.zip frameworks_base-2083deb8f9ae0ac83ab2c9dc3de8e53a7b4ea2a5.tar.gz frameworks_base-2083deb8f9ae0ac83ab2c9dc3de8e53a7b4ea2a5.tar.bz2 |
Merge "Actually show secret notifications sometimes." into lmp-dev
Diffstat (limited to 'packages/SystemUI/src/com/android')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java | 44 |
1 files changed, 27 insertions, 17 deletions
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 72c12d6..e975045 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -1240,22 +1240,25 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, if (!notificationIsForCurrentProfiles(ent.notification)) continue; + final boolean hideSensitive = shouldHideSensitiveContents(ent.notification.getUserId()); final int vis = ent.notification.getNotification().visibility; - if (vis != Notification.VISIBILITY_SECRET) { - // when isLockscreenPublicMode() we show the public form of VISIBILITY_PRIVATE notifications - boolean showingPublic = isLockscreenPublicMode() - && vis == Notification.VISIBILITY_PRIVATE - && !userAllowsPrivateNotificationsInPublic(ent.notification.getUserId()); - ent.row.setShowingPublic(showingPublic); - if (ent.autoRedacted && ent.legacy) { - if (showingPublic) { - ent.row.setShowingLegacyBackground(false); - } else { - ent.row.setShowingLegacyBackground(true); - } + + // when isLockscreenPublicMode() we suppress VISIBILITY_SECRET notifications + if (vis == Notification.VISIBILITY_SECRET && hideSensitive) { + continue; + } + + // when isLockscreenPublicMode() we show the public form of VISIBILITY_PRIVATE notifications + boolean showingPublic = vis == Notification.VISIBILITY_PRIVATE && hideSensitive; + ent.row.setShowingPublic(showingPublic); + if (ent.autoRedacted && ent.legacy) { + if (showingPublic) { + ent.row.setShowingLegacyBackground(false); + } else { + ent.row.setShowingLegacyBackground(true); } - toShow.add(ent.row); } + toShow.add(ent.row); } ArrayList<View> toRemove = new ArrayList<View>(); @@ -1333,6 +1336,15 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, updateNotificationIcons(); } + /** + * Returns true if we're on a secure lockscreen and the user wants to hide "sensitive" + * notification data. If so, private notifications should show their (possibly + * auto-generated) publicVersion, and secret notifications should be totally invisible. + */ + private boolean shouldHideSensitiveContents(int userid) { + return isLockscreenPublicMode() && !userAllowsPrivateNotificationsInPublic(userid); + } + private void updateNotificationIcons() { final LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(mIconSize + 2*mIconHPadding, mNaturalBarHeight); @@ -1353,10 +1365,8 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, if (!((provisioned && ent.notification.getScore() >= HIDE_ICONS_BELOW_SCORE) || showNotificationEvenIfUnprovisioned(ent.notification))) continue; if (!notificationIsForCurrentProfiles(ent.notification)) continue; - if (isLockscreenPublicMode() - && ent.notification.getNotification().visibility - == Notification.VISIBILITY_SECRET - && !userAllowsPrivateNotificationsInPublic(ent.notification.getUserId())) { + if (ent.notification.getNotification().visibility == Notification.VISIBILITY_SECRET + && shouldHideSensitiveContents(ent.notification.getUserId())) { // in "public" mode (atop a secure keyguard), secret notifs are totally hidden continue; } |