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

Commit b288b33f authored by Ibrahim Yilmaz's avatar Ibrahim Yilmaz
Browse files

[ExpandableNotificationRow] use shouldShowPublic in isExpanded

mShowingPublic is only updated from SSA after setting its height.
This could make its value stale during height calculation and cause squishness.
This CL uses its version that is updated before shade invalidations.

Bug: 324537506
Fixes: 332307645
Flag: NONE
Test: manual, steps are in 332307645 and 275457408.
Change-Id: I88bb6da926417a4d8e2bd4d31b70b87296cac07f
parent 1265dc50
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -2804,12 +2804,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
    }

    public boolean isExpanded(boolean allowOnKeyguard) {
        if (DEBUG) {
            if (!mShowingPublicInitialized && !allowOnKeyguard) {
                Log.d(TAG, "mShowingPublic is not initialized.");
            }
        }
        return !mShowingPublic && (!mOnKeyguard || allowOnKeyguard)
        return (!shouldShowPublic()) && (!mOnKeyguard || allowOnKeyguard)
                && (!hasUserChangedExpansion() && (isSystemExpanded() || isSystemChildExpanded())
                || isUserExpanded());
    }
+2 −4
Original line number Diff line number Diff line
@@ -772,8 +772,7 @@ public class ExpandableNotificationRowTest extends SysuiTestCase {
        row.setUserExpanded(true);
        row.setOnKeyguard(false);
        row.setSensitive(/* sensitive= */true, /* hideSensitive= */false);
        row.setHideSensitive(/* hideSensitive= */true, /* animated= */false,
                /* delay= */0L, /* duration= */0L);
        row.setHideSensitiveForIntrinsicHeight(/* hideSensitive= */true);

        // THEN
        assertThat(row.isExpanded()).isFalse();
@@ -787,8 +786,7 @@ public class ExpandableNotificationRowTest extends SysuiTestCase {
        row.setUserExpanded(true);
        row.setOnKeyguard(false);
        row.setSensitive(/* sensitive= */true, /* hideSensitive= */false);
        row.setHideSensitive(/* hideSensitive= */false, /* animated= */false,
                /* delay= */0L, /* duration= */0L);
        row.setHideSensitiveForIntrinsicHeight(/* hideSensitive= */false);

        // THEN
        assertThat(row.isExpanded()).isTrue();