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

Commit 5599d0f2 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Add falsing protection for all notification settings guts" into rvc-dev...

Merge "Add falsing protection for all notification settings guts" into rvc-dev am: 8c9e2496 am: 0d51d48a am: a18265e9 am: 3b5ef9dc

Change-Id: Ifb066cf6b440dd21059b30810283856ea1b609d2
parents 70936839 3b5ef9dc
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -188,6 +188,11 @@ public class AppOpsInfo extends LinearLayout implements NotificationGuts.GutsCon
        return false;
    }

    @Override
    public boolean needsFalsingProtection() {
        return false;
    }

    @Override
    public View getContentView() {
        return this;
+5 −0
Original line number Diff line number Diff line
@@ -403,6 +403,11 @@ public class NotificationConversationInfo extends LinearLayout implements
        // TODO: do we need to do anything here?
    }

    @Override
    public boolean needsFalsingProtection() {
        return true;
    }

    @Override
    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
        super.onInitializeAccessibilityEvent(event);
+6 −0
Original line number Diff line number Diff line
@@ -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 {
+18 −14
Original line number Diff line number Diff line
@@ -523,7 +523,10 @@ public class NotificationGutsManager implements Dumpable, NotificationLifetimeEx
            int x,
            int y,
            NotificationMenuRowPlugin.MenuItem menuItem) {
        if (menuItem.getGutsView() instanceof NotificationInfo) {
        if (menuItem.getGutsView() instanceof NotificationGuts.GutsContent) {
            NotificationGuts.GutsContent gutsView =
                    (NotificationGuts.GutsContent)  menuItem.getGutsView();
            if (gutsView.needsFalsingProtection()) {
                if (mStatusBarStateController instanceof StatusBarStateControllerImpl) {
                    ((StatusBarStateControllerImpl) mStatusBarStateController)
                            .setLeaveOpenOnKeyguardHide(true);
@@ -541,6 +544,7 @@ public class NotificationGutsManager implements Dumpable, NotificationLifetimeEx

                return true;
            }
        }
        return openGutsInternal(view, x, y, menuItem);
    }

+5 −0
Original line number Diff line number Diff line
@@ -489,6 +489,11 @@ public class NotificationInfo extends LinearLayout implements NotificationGuts.G
        mMetricsLogger.write(notificationControlsLogMaker().setType(MetricsEvent.TYPE_CLOSE));
    }

    @Override
    public boolean needsFalsingProtection() {
        return true;
    }

    @Override
    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
        super.onInitializeAccessibilityEvent(event);
Loading