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

Commit 49cc2e73 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Directly check lockscreen redaction flag for redaction" into main

parents 633c98a9 c1388641
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -275,7 +275,8 @@ public class NotificationRowBinderImpl implements NotificationRowBinder {
            }
        }

        if (LockscreenOtpRedaction.isEnabled()) {
        if (LockscreenOtpRedaction.isSingleLineViewEnabled()) {

            if (inflaterParams.isChildInGroup() && needsRedaction) {
                params.requireContentViews(FLAG_CONTENT_VIEW_PUBLIC_SINGLE_LINE);
            } else {
+1 −1
Original line number Diff line number Diff line
@@ -1015,7 +1015,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
        }
        mNotificationParent = isChildInGroup ? parent : null;
        mPrivateLayout.setIsChildInGroup(isChildInGroup);
        if (LockscreenOtpRedaction.isEnabled()) {
        if (LockscreenOtpRedaction.isSingleLineViewEnabled()) {
            mPublicLayout.setIsChildInGroup(isChildInGroup);
        }

+5 −5
Original line number Diff line number Diff line
@@ -223,7 +223,7 @@ public class NotificationContentInflater implements NotificationRowContentBinder
                    );
        }

        if (LockscreenOtpRedaction.isEnabled()) {
        if (LockscreenOtpRedaction.isSingleLineViewEnabled()) {
            result.mPublicInflatedSingleLineViewModel =
                    SingleLineViewInflater.inflateRedactedSingleLineViewModel(row.getContext(),
                            isConversation);
@@ -309,7 +309,7 @@ public class NotificationContentInflater implements NotificationRowContentBinder
                });
                break;
            case FLAG_CONTENT_VIEW_PUBLIC_SINGLE_LINE:
                if (LockscreenOtpRedaction.isEnabled()) {
                if (LockscreenOtpRedaction.isSingleLineViewEnabled()) {
                    row.getPublicLayout()
                            .performWhenContentInactive(VISIBLE_TYPE_SINGLELINE, () -> {
                                row.getPublicLayout().setSingleLineView(null);
@@ -360,7 +360,7 @@ public class NotificationContentInflater implements NotificationRowContentBinder
        if ((contentViews & FLAG_CONTENT_VIEW_PUBLIC) != 0) {
            row.getPublicLayout().removeContentInactiveRunnable(VISIBLE_TYPE_CONTRACTED);
        }
        if (LockscreenOtpRedaction.isEnabled()
        if (LockscreenOtpRedaction.isSingleLineViewEnabled()
                && (contentViews & FLAG_CONTENT_VIEW_PUBLIC_SINGLE_LINE) != 0) {
            row.getPublicLayout().removeContentInactiveRunnable(VISIBLE_TYPE_SINGLELINE);
        }
@@ -974,7 +974,7 @@ public class NotificationContentInflater implements NotificationRowContentBinder
            }
        }

        if (LockscreenOtpRedaction.isEnabled()
        if (LockscreenOtpRedaction.isSingleLineViewEnabled()
                && (reInflateFlags & FLAG_CONTENT_VIEW_PUBLIC_SINGLE_LINE) != 0) {
            HybridNotificationView view = result.mPublicInflatedSingleLineView;
            SingleLineViewModel viewModel = result.mPublicInflatedSingleLineViewModel;
@@ -1254,7 +1254,7 @@ public class NotificationContentInflater implements NotificationRowContentBinder
                        );
            }

            if (LockscreenOtpRedaction.isEnabled()) {
            if (LockscreenOtpRedaction.isSingleLineViewEnabled()) {
                result.mPublicInflatedSingleLineViewModel =
                        SingleLineViewInflater.inflateRedactedSingleLineViewModel(mContext,
                                isConversation);
+5 −2
Original line number Diff line number Diff line
@@ -30,6 +30,9 @@ object LockscreenOtpRedaction {

    @JvmStatic
    inline val isEnabled
        get() =
            redactSensitiveContentNotificationsOnLockscreen() && AsyncHybridViewInflation.isEnabled
        get() = redactSensitiveContentNotificationsOnLockscreen()

    @JvmStatic
    inline val isSingleLineViewEnabled
        get() = isEnabled && AsyncHybridViewInflation.isEnabled
}