diff options
7 files changed, 49 insertions, 14 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/AppOpsInfo.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/AppOpsInfo.java index 10fc990e2c5b..9dcc187cb0ef 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/AppOpsInfo.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/AppOpsInfo.java @@ -189,6 +189,11 @@ public class AppOpsInfo extends LinearLayout implements NotificationGuts.GutsCon } @Override + public boolean needsFalsingProtection() { + return false; + } + + @Override public View getContentView() { return this; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationConversationInfo.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationConversationInfo.java index 9217756dca13..9befa313edd8 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationConversationInfo.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationConversationInfo.java @@ -404,6 +404,11 @@ public class NotificationConversationInfo extends LinearLayout implements } @Override + public boolean needsFalsingProtection() { + return true; + } + + @Override public void onInitializeAccessibilityEvent(AccessibilityEvent event) { super.onInitializeAccessibilityEvent(event); if (mGutsContainer != null && diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGuts.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGuts.java index 18d436ff7659..c762b73a1648 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGuts.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGuts.java @@ -104,6 +104,12 @@ public class NotificationGuts extends FrameLayout { * Called when the guts view has finished its close animation. */ default void onFinishedClosing() {} + + /** + * Returns whether falsing protection is needed before showing the contents of this + * view on the lockscreen + */ + boolean needsFalsingProtection(); } public interface OnGutsClosedListener { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGutsManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGutsManager.java index 1caf8f89c822..a64dcdffff1e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGutsManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGutsManager.java @@ -523,23 +523,27 @@ public class NotificationGutsManager implements Dumpable, NotificationLifetimeEx int x, int y, NotificationMenuRowPlugin.MenuItem menuItem) { - if (menuItem.getGutsView() instanceof NotificationInfo) { - if (mStatusBarStateController instanceof StatusBarStateControllerImpl) { - ((StatusBarStateControllerImpl) mStatusBarStateController) - .setLeaveOpenOnKeyguardHide(true); - } + if (menuItem.getGutsView() instanceof NotificationGuts.GutsContent) { + NotificationGuts.GutsContent gutsView = + (NotificationGuts.GutsContent) menuItem.getGutsView(); + if (gutsView.needsFalsingProtection()) { + if (mStatusBarStateController instanceof StatusBarStateControllerImpl) { + ((StatusBarStateControllerImpl) mStatusBarStateController) + .setLeaveOpenOnKeyguardHide(true); + } - Runnable r = () -> mMainHandler.post( - () -> openGutsInternal(view, x, y, menuItem)); + Runnable r = () -> mMainHandler.post( + () -> openGutsInternal(view, x, y, menuItem)); - mStatusBarLazy.get().executeRunnableDismissingKeyguard( - r, - null /* cancelAction */, - false /* dismissShade */, - true /* afterKeyguardGone */, - true /* deferred */); + mStatusBarLazy.get().executeRunnableDismissingKeyguard( + r, + null /* cancelAction */, + false /* dismissShade */, + true /* afterKeyguardGone */, + true /* deferred */); - return true; + return true; + } } return openGutsInternal(view, x, y, menuItem); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationInfo.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationInfo.java index 91c31cf58ea0..334599930b63 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationInfo.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationInfo.java @@ -490,6 +490,11 @@ public class NotificationInfo extends LinearLayout implements NotificationGuts.G } @Override + public boolean needsFalsingProtection() { + return true; + } + + @Override public void onInitializeAccessibilityEvent(AccessibilityEvent event) { super.onInitializeAccessibilityEvent(event); if (mGutsContainer != null && diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationSnooze.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationSnooze.java index e56771c62bb5..cde3dfd66aaf 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationSnooze.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationSnooze.java @@ -442,6 +442,11 @@ public class NotificationSnooze extends LinearLayout return true; } + @Override + public boolean needsFalsingProtection() { + return false; + } + public class NotificationSnoozeOption implements SnoozeOption { private SnoozeCriterion mCriterion; private int mMinutesToSnoozeFor; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/PartialConversationInfo.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/PartialConversationInfo.java index 1dc828bfb0b5..ea059cbcf3e1 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/PartialConversationInfo.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/PartialConversationInfo.java @@ -301,6 +301,11 @@ public class PartialConversationInfo extends LinearLayout implements } @Override + public boolean needsFalsingProtection() { + return true; + } + + @Override public void onInitializeAccessibilityEvent(AccessibilityEvent event) { super.onInitializeAccessibilityEvent(event); if (mGutsContainer != null && |