diff options
7 files changed, 13 insertions, 85 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/flags/Flags.kt b/packages/SystemUI/src/com/android/systemui/flags/Flags.kt index e24a03116892..a199fea0253f 100644 --- a/packages/SystemUI/src/com/android/systemui/flags/Flags.kt +++ b/packages/SystemUI/src/com/android/systemui/flags/Flags.kt @@ -76,10 +76,6 @@ object Flags { val NOTIFICATION_MEMORY_LOGGING_ENABLED = releasedFlag("notification_memory_logging_enabled") - // TODO(b/268005230): Tracking Bug - @JvmField - val SENSITIVE_REVEAL_ANIM = releasedFlag("sensitive_reveal_anim") - // TODO(b/280783617): Tracking Bug @Keep @JvmField diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java index 615534809c97..5171a5c9144c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java @@ -39,8 +39,6 @@ import com.android.app.animation.Interpolators; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.policy.SystemBarUtils; import com.android.systemui.animation.ShadeInterpolation; -import com.android.systemui.flags.Flags; -import com.android.systemui.flags.RefactorFlag; import com.android.systemui.res.R; import com.android.systemui.shade.transition.LargeScreenShadeInterpolator; import com.android.systemui.statusbar.notification.ColorUpdateLogger; @@ -95,8 +93,6 @@ public class NotificationShelf extends ActivatableNotificationView { private float mCornerAnimationDistance; private float mActualWidth = -1; private int mMaxIconsOnLockscreen; - private final RefactorFlag mSensitiveRevealAnim = - RefactorFlag.forView(Flags.SENSITIVE_REVEAL_ANIM); private boolean mCanModifyColorOfNotifications; private boolean mCanInteract; private NotificationStackScrollLayout mHostLayout; @@ -266,7 +262,7 @@ public class NotificationShelf extends ActivatableNotificationView { } final float stackEnd = ambientState.getStackY() + ambientState.getStackHeight(); - if (mSensitiveRevealAnim.isEnabled() && viewState.hidden) { + if (viewState.hidden) { // if the shelf is hidden, position it at the end of the stack (plus the clip // padding), such that when it appears animated, it will smoothly move in from the // bottom, without jump cutting any notifications @@ -398,10 +394,6 @@ public class NotificationShelf extends ActivatableNotificationView { // find the first view that doesn't overlap with the shelf int notGoneIndex = 0; int colorOfViewBeforeLast = NO_COLOR; - boolean backgroundForceHidden = false; - if (mHideBackground && !((ShelfState) getViewState()).hasItemsInStableShelf) { - backgroundForceHidden = true; - } int colorTwoBefore = NO_COLOR; int previousColor = NO_COLOR; float transitionAmount = 0.0f; @@ -429,8 +421,7 @@ public class NotificationShelf extends ActivatableNotificationView { expandingAnimated, isLastChild, shelfClipStart); // TODO(b/172289889) scale mPaddingBetweenElements with expansion amount - if ((!mSensitiveRevealAnim.isEnabled() && ((isLastChild && !child.isInShelf()) - || backgroundForceHidden)) || aboveShelf) { + if (aboveShelf) { notificationClipEnd = shelfStart + getIntrinsicHeight(); } else { notificationClipEnd = shelfStart - mPaddingBetweenElements; @@ -440,8 +431,7 @@ public class NotificationShelf extends ActivatableNotificationView { // If the current row is an ExpandableNotificationRow, update its color, roundedness, // and icon state. - if (child instanceof ExpandableNotificationRow) { - ExpandableNotificationRow expandableRow = (ExpandableNotificationRow) child; + if (child instanceof ExpandableNotificationRow expandableRow) { numViewsInShelf += inShelfAmount; int ownColorUntinted = expandableRow.getBackgroundColorWithoutTint(); if (viewStart >= shelfStart && mNotGoneIndex == -1) { @@ -471,16 +461,8 @@ public class NotificationShelf extends ActivatableNotificationView { notGoneIndex++; } - if (child instanceof ActivatableNotificationView) { - ActivatableNotificationView anv = (ActivatableNotificationView) child; - // Because we show whole notifications on the lockscreen, the bottom notification is - // always "just about to enter the shelf" by normal scrolling rules. This is fine - // if the shelf is visible, but if the shelf is hidden, it causes incorrect curling. - // notificationClipEnd handles the discrepancy between a visible and hidden shelf, - // so we use that when on the keyguard (and while animating away) to reduce curling. - final float keyguardSafeShelfStart = !mSensitiveRevealAnim.isEnabled() - && mAmbientState.isOnKeyguard() ? notificationClipEnd : shelfStart; - updateCornerRoundnessOnScroll(anv, viewStart, keyguardSafeShelfStart); + if (child instanceof ActivatableNotificationView anv) { + updateCornerRoundnessOnScroll(anv, viewStart, shelfStart); } } @@ -519,11 +501,10 @@ public class NotificationShelf extends ActivatableNotificationView { mShelfIcons.applyIconStates(); for (int i = 0; i < getHostLayoutChildCount(); i++) { View child = getHostLayoutChildAt(i); - if (!(child instanceof ExpandableNotificationRow) + if (!(child instanceof ExpandableNotificationRow row) || child.getVisibility() == GONE) { continue; } - ExpandableNotificationRow row = (ExpandableNotificationRow) child; updateContinuousClipping(row); } boolean hideBackground = isHidden; @@ -613,8 +594,7 @@ public class NotificationShelf extends ActivatableNotificationView { private void clipTransientViews() { for (int i = 0; i < getHostLayoutTransientViewCount(); i++) { View transientView = getHostLayoutTransientView(i); - if (transientView instanceof ExpandableView) { - ExpandableView transientExpandableView = (ExpandableView) transientView; + if (transientView instanceof ExpandableView transientExpandableView) { updateNotificationClipHeight(transientExpandableView, getTranslationY(), -1); } } @@ -871,10 +851,9 @@ public class NotificationShelf extends ActivatableNotificationView { } private void setIconTransformationAmount(ExpandableView view, float transitionAmount) { - if (!(view instanceof ExpandableNotificationRow)) { + if (!(view instanceof ExpandableNotificationRow row)) { return; } - ExpandableNotificationRow row = (ExpandableNotificationRow) view; StatusBarIconView icon = row.getShelfIcon(); NotificationIconContainer.IconState iconState = getIconState(icon); if (iconState == null) { 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 a6aff5ab449c..589537ef713b 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 @@ -2878,8 +2878,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView mSensitiveHiddenInGeneral = hideSensitive; int intrinsicAfter = getIntrinsicHeight(); if (intrinsicBefore != intrinsicAfter) { - boolean needsAnimation = mFeatureFlags.isEnabled(Flags.SENSITIVE_REVEAL_ANIM); - notifyHeightChanged(needsAnimation); + notifyHeightChanged(true); } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java index 2b500ffe7a13..3c0fc5efd8bd 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java @@ -194,7 +194,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable */ private Set<Integer> mDebugTextUsedYPositions; private final boolean mDebugRemoveAnimation; - private final boolean mSensitiveRevealAnimEndabled; private int mContentHeight; private float mIntrinsicContentHeight; private int mPaddingBetweenElements; @@ -615,7 +614,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable Flags.LOCKSCREEN_ENABLE_LANDSCAPE); mDebugLines = mFeatureFlags.isEnabled(Flags.NSSL_DEBUG_LINES); mDebugRemoveAnimation = mFeatureFlags.isEnabled(Flags.NSSL_DEBUG_REMOVE_ANIMATION); - mSensitiveRevealAnimEndabled = mFeatureFlags.isEnabled(Flags.SENSITIVE_REVEAL_ANIM); mSectionsManager = Dependency.get(NotificationSectionsManager.class); mScreenOffAnimationController = Dependency.get(ScreenOffAnimationController.class); @@ -2549,7 +2547,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable return; } child.setOnHeightChangedListener(null); - if (child instanceof ExpandableNotificationRow && mSensitiveRevealAnimEndabled) { + if (child instanceof ExpandableNotificationRow) { NotificationEntry entry = ((ExpandableNotificationRow) child).getEntry(); entry.removeOnSensitivityChangedListener(mOnChildSensitivityChangedListener); } @@ -2845,7 +2843,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable private void onViewAddedInternal(ExpandableView child) { updateHideSensitiveForChild(child); child.setOnHeightChangedListener(mOnChildHeightChangedListener); - if (child instanceof ExpandableNotificationRow && mSensitiveRevealAnimEndabled) { + if (child instanceof ExpandableNotificationRow) { NotificationEntry entry = ((ExpandableNotificationRow) child).getEntry(); entry.addOnSensitivityChangedListener(mOnChildSensitivityChangedListener); } 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 42a6924b95e1..b114e13bb25c 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 @@ -60,7 +60,6 @@ import com.android.internal.widget.CachingIconView; import com.android.systemui.SysuiTestCase; import com.android.systemui.SysuiTestableContext; import com.android.systemui.flags.FakeFeatureFlags; -import com.android.systemui.flags.Flags; import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.statusbar.notification.AboveShelfChangedListener; @@ -104,7 +103,6 @@ public class ExpandableNotificationRowTest extends SysuiTestCase { TestableLooper.get(this), mFeatureFlags); mNotificationTestHelper.setDefaultInflationFlags(FLAG_CONTENT_VIEW_ALL); - mFeatureFlags.setDefault(Flags.SENSITIVE_REVEAL_ANIM); } @Test @@ -186,14 +184,6 @@ public class ExpandableNotificationRowTest extends SysuiTestCase { } @Test - public void testSetSensitiveOnNotifRowNotifiesOfHeightChange_withOtherFlagValue() - throws Exception { - FakeFeatureFlags flags = mFeatureFlags; - flags.set(Flags.SENSITIVE_REVEAL_ANIM, !flags.isEnabled(Flags.SENSITIVE_REVEAL_ANIM)); - testSetSensitiveOnNotifRowNotifiesOfHeightChange(); - } - - @Test public void testSetSensitiveOnNotifRowNotifiesOfHeightChange() throws Exception { // GIVEN a sensitive notification row that's currently redacted ExpandableNotificationRow row = mNotificationTestHelper.createRow(); @@ -210,19 +200,10 @@ public class ExpandableNotificationRowTest extends SysuiTestCase { // WHEN the row is set to no longer be sensitive row.setSensitive(false, true); - boolean expectAnimation = mFeatureFlags.isEnabled(Flags.SENSITIVE_REVEAL_ANIM); // VERIFY that the height change listener is invoked assertThat(row.getShowingLayout()).isSameInstanceAs(row.getPrivateLayout()); assertThat(row.getIntrinsicHeight()).isGreaterThan(0); - verify(listener).onHeightChanged(eq(row), eq(expectAnimation)); - } - - @Test - public void testSetSensitiveOnGroupRowNotifiesOfHeightChange_withOtherFlagValue() - throws Exception { - FakeFeatureFlags flags = mFeatureFlags; - flags.set(Flags.SENSITIVE_REVEAL_ANIM, !flags.isEnabled(Flags.SENSITIVE_REVEAL_ANIM)); - testSetSensitiveOnGroupRowNotifiesOfHeightChange(); + verify(listener).onHeightChanged(eq(row), eq(true)); } @Test @@ -242,19 +223,10 @@ public class ExpandableNotificationRowTest extends SysuiTestCase { // WHEN the row is set to no longer be sensitive group.setSensitive(false, true); - boolean expectAnimation = mFeatureFlags.isEnabled(Flags.SENSITIVE_REVEAL_ANIM); // VERIFY that the height change listener is invoked assertThat(group.getShowingLayout()).isSameInstanceAs(group.getPrivateLayout()); assertThat(group.getIntrinsicHeight()).isGreaterThan(0); - verify(listener).onHeightChanged(eq(group), eq(expectAnimation)); - } - - @Test - public void testSetSensitiveOnPublicRowDoesNotNotifyOfHeightChange_withOtherFlagValue() - throws Exception { - FakeFeatureFlags flags = mFeatureFlags; - flags.set(Flags.SENSITIVE_REVEAL_ANIM, !flags.isEnabled(Flags.SENSITIVE_REVEAL_ANIM)); - testSetSensitiveOnPublicRowDoesNotNotifyOfHeightChange(); + verify(listener).onHeightChanged(eq(group), eq(true)); } @Test diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationShelfTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationShelfTest.kt index b938029cc6b8..9a7b8ec2ec07 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationShelfTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationShelfTest.kt @@ -10,7 +10,6 @@ import com.android.systemui.SysuiTestCase import com.android.systemui.animation.ShadeInterpolation import com.android.systemui.flags.FakeFeatureFlags import com.android.systemui.flags.FeatureFlags -import com.android.systemui.flags.Flags import com.android.systemui.res.R import com.android.systemui.shade.transition.LargeScreenShadeInterpolator import com.android.systemui.statusbar.NotificationShelf @@ -23,7 +22,6 @@ import com.android.systemui.util.mockito.mock import junit.framework.Assert.assertEquals import junit.framework.Assert.assertFalse import junit.framework.Assert.assertTrue -import org.junit.Assume.assumeTrue import org.junit.Before import org.junit.Test import org.junit.runner.RunWith @@ -38,7 +36,6 @@ import org.mockito.Mockito.`when` as whenever @RunWithLooper open class NotificationShelfTest : SysuiTestCase() { - open val useSensitiveReveal: Boolean = false private val flags = FakeFeatureFlags() @Mock private lateinit var largeScreenShadeInterpolator: LargeScreenShadeInterpolator @@ -53,7 +50,6 @@ open class NotificationShelfTest : SysuiTestCase() { fun setUp() { MockitoAnnotations.initMocks(this) mDependency.injectTestDependency(FeatureFlags::class.java, flags) - flags.set(Flags.SENSITIVE_REVEAL_ANIM, useSensitiveReveal) val root = FrameLayout(context) shelf = LayoutInflater.from(root.context) @@ -335,7 +331,6 @@ open class NotificationShelfTest : SysuiTestCase() { @Test fun updateState_withNullLastVisibleBackgroundChild_hideShelf() { // GIVEN - assumeTrue(useSensitiveReveal) whenever(ambientState.stackY).thenReturn(100f) whenever(ambientState.stackHeight).thenReturn(100f) val paddingBetweenElements = @@ -362,7 +357,6 @@ open class NotificationShelfTest : SysuiTestCase() { @Test fun updateState_withNullFirstViewInShelf_hideShelf() { // GIVEN - assumeTrue(useSensitiveReveal) whenever(ambientState.stackY).thenReturn(100f) whenever(ambientState.stackHeight).thenReturn(100f) val paddingBetweenElements = @@ -389,7 +383,6 @@ open class NotificationShelfTest : SysuiTestCase() { @Test fun updateState_withCollapsedShade_hideShelf() { // GIVEN - assumeTrue(useSensitiveReveal) whenever(ambientState.stackY).thenReturn(100f) whenever(ambientState.stackHeight).thenReturn(100f) val paddingBetweenElements = @@ -416,7 +409,6 @@ open class NotificationShelfTest : SysuiTestCase() { @Test fun updateState_withHiddenSectionBeforeShelf_hideShelf() { // GIVEN - assumeTrue(useSensitiveReveal) whenever(ambientState.stackY).thenReturn(100f) whenever(ambientState.stackHeight).thenReturn(100f) val paddingBetweenElements = @@ -476,10 +468,3 @@ open class NotificationShelfTest : SysuiTestCase() { assertEquals(expectedAlpha, shelf.viewState.alpha) } } - -@SmallTest -@RunWith(AndroidTestingRunner::class) -@RunWithLooper -class NotificationShelfWithSensitiveRevealTest : NotificationShelfTest() { - override val useSensitiveReveal: Boolean = true -} diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java index a6650257184b..dd1caba0aaa8 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java @@ -168,7 +168,6 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { // TODO: Ideally we wouldn't need to set these unless a test actually reads them, // and then we would test both configurations, but currently they are all read // in the constructor. - mFeatureFlags.setDefault(Flags.SENSITIVE_REVEAL_ANIM); mSetFlagsRule.enableFlags(FLAG_NEW_AOD_TRANSITION); mFeatureFlags.setDefault(Flags.UNCLEARED_TRANSIENT_HUN_FIX); |