diff options
| author | 2024-04-09 16:12:43 +0000 | |
|---|---|---|
| committer | 2024-04-10 15:03:45 +0000 | |
| commit | b288b33f8a01bea56812d599bb769127d032fee0 (patch) | |
| tree | 996b9795b9fd7872a612ea2acd67d8036da5bb63 | |
| parent | 1265dc5010c68b1b3823c75b85b7e4a8dace530f (diff) | |
[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
2 files changed, 3 insertions, 10 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java index eb6c7b520037..c3742139ae5a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java @@ -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()); } diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowTest.java index 06a4d0820386..0060bba13ca2 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowTest.java @@ -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(); |