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

Commit a1744872 authored by Selim Cinek's avatar Selim Cinek
Browse files

Fixed a bug with autoredacted custom views.

Bug: 27616717
Change-Id: Ia6156d7cadca0c1f9aadd49f76f62ac92991eced
parent d607daf3
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -241,18 +241,22 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
    }

    private void updateLimits() {
        boolean customView = getPrivateLayout().getContractedChild().getId()
        updateLimitsForView(mPrivateLayout);
        updateLimitsForView(mPublicLayout);
    }

    private void updateLimitsForView(NotificationContentView layout) {
        boolean customView = layout.getContractedChild().getId()
                != com.android.internal.R.id.status_bar_latest_event_content;
        boolean beforeN = mEntry.targetSdk < Build.VERSION_CODES.N;
        int minHeight = customView && beforeN && !mIsSummaryWithChildren ?
                mNotificationMinHeightLegacy : mNotificationMinHeight;
        boolean headsUpCustom = getPrivateLayout().getHeadsUpChild() != null &&
                getPrivateLayout().getHeadsUpChild().getId()
        boolean headsUpCustom = layout.getHeadsUpChild() != null &&
                layout.getHeadsUpChild().getId()
                        != com.android.internal.R.id.status_bar_latest_event_content;
        int headsUpheight = headsUpCustom && beforeN ? mMaxHeadsUpHeightLegacy
                : mMaxHeadsUpHeight;
        mPrivateLayout.setHeights(minHeight, headsUpheight, mNotificationMaxHeight);
        mPublicLayout.setHeights(minHeight, headsUpheight, mNotificationMaxHeight);
        layout.setHeights(minHeight, headsUpheight, mNotificationMaxHeight);
    }

    public StatusBarNotification getStatusBarNotification() {