Loading packages/SystemUI/aconfig/systemui.aconfig +10 −0 Original line number Diff line number Diff line Loading @@ -802,6 +802,16 @@ flag { } } flag { name: "shade_collapse_activity_launch_fix" namespace: "systemui" description: "Avoid collapsing the shade on activity launch if it is already collapsed, as this causes a flicker." bug: "331591373" metadata { purpose: PURPOSE_BUGFIX } } flag { name: "slice_broadcast_relay_in_background" namespace: "systemui" Loading packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +6 −1 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import static com.android.app.animation.Interpolators.EMPHASIZED_DECELERATE; import static com.android.keyguard.KeyguardClockSwitch.LARGE; import static com.android.keyguard.KeyguardClockSwitch.SMALL; import static com.android.systemui.Flags.predictiveBackAnimateShade; import static com.android.systemui.Flags.shadeCollapseActivityLaunchFix; import static com.android.systemui.Flags.smartspaceRelocateToBottom; import static com.android.systemui.classifier.Classifier.BOUNCER_UNLOCK; import static com.android.systemui.classifier.Classifier.GENERIC; Loading Loading @@ -4102,7 +4103,11 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump @Override public boolean canBeCollapsed() { return !isFullyCollapsed() && !isTracking() && !isClosing(); return !isFullyCollapsed() && !isTracking() && !isClosing() // Don't try to collapse if on keyguard, as the expansion fraction is 1 in this // case. && !(shadeCollapseActivityLaunchFix() && mExpandedFraction == 1f && mBarState == KEYGUARD); } public void instantCollapse() { Loading packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java +28 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.systemui.shade; import static com.android.keyguard.KeyguardClockSwitch.LARGE; import static com.android.keyguard.KeyguardClockSwitch.SMALL; import static com.android.systemui.Flags.FLAG_SHADE_COLLAPSE_ACTIVITY_LAUNCH_FIX; import static com.android.systemui.shade.ShadeExpansionStateManagerKt.STATE_CLOSED; import static com.android.systemui.shade.ShadeExpansionStateManagerKt.STATE_OPEN; import static com.android.systemui.shade.ShadeExpansionStateManagerKt.STATE_OPENING; Loading Loading @@ -47,6 +48,7 @@ import android.animation.ValueAnimator; import android.graphics.Point; import android.os.PowerManager; import android.platform.test.annotations.DisableFlags; import android.platform.test.annotations.EnableFlags; import android.testing.AndroidTestingRunner; import android.testing.TestableLooper; import android.view.MotionEvent; Loading Loading @@ -674,6 +676,32 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo assertThat(mNotificationPanelViewController.canCollapsePanelOnTouch()).isFalse(); } @Test @EnableFlags(FLAG_SHADE_COLLAPSE_ACTIVITY_LAUNCH_FIX) public void testCanBeCollapsed_expandedInKeyguard() { mStatusBarStateController.setState(KEYGUARD); mNotificationPanelViewController.setExpandedFraction(1f); assertThat(mNotificationPanelViewController.canBeCollapsed()).isFalse(); } @Test @EnableFlags(FLAG_SHADE_COLLAPSE_ACTIVITY_LAUNCH_FIX) public void testCanBeCollapsed_expandedInShade() { mStatusBarStateController.setState(SHADE); mNotificationPanelViewController.setExpandedFraction(1f); assertThat(mNotificationPanelViewController.canBeCollapsed()).isTrue(); } @Test @DisableFlags(FLAG_SHADE_COLLAPSE_ACTIVITY_LAUNCH_FIX) public void testCanBeCollapsed_expandedInKeyguard_flagDisabled() { mStatusBarStateController.setState(KEYGUARD); mNotificationPanelViewController.setExpandedFraction(1f); assertThat(mNotificationPanelViewController.canBeCollapsed()).isTrue(); } @Test public void testSwipeWhileLocked_notifiesKeyguardState() { mStatusBarStateController.setState(KEYGUARD); Loading Loading
packages/SystemUI/aconfig/systemui.aconfig +10 −0 Original line number Diff line number Diff line Loading @@ -802,6 +802,16 @@ flag { } } flag { name: "shade_collapse_activity_launch_fix" namespace: "systemui" description: "Avoid collapsing the shade on activity launch if it is already collapsed, as this causes a flicker." bug: "331591373" metadata { purpose: PURPOSE_BUGFIX } } flag { name: "slice_broadcast_relay_in_background" namespace: "systemui" Loading
packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +6 −1 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import static com.android.app.animation.Interpolators.EMPHASIZED_DECELERATE; import static com.android.keyguard.KeyguardClockSwitch.LARGE; import static com.android.keyguard.KeyguardClockSwitch.SMALL; import static com.android.systemui.Flags.predictiveBackAnimateShade; import static com.android.systemui.Flags.shadeCollapseActivityLaunchFix; import static com.android.systemui.Flags.smartspaceRelocateToBottom; import static com.android.systemui.classifier.Classifier.BOUNCER_UNLOCK; import static com.android.systemui.classifier.Classifier.GENERIC; Loading Loading @@ -4102,7 +4103,11 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump @Override public boolean canBeCollapsed() { return !isFullyCollapsed() && !isTracking() && !isClosing(); return !isFullyCollapsed() && !isTracking() && !isClosing() // Don't try to collapse if on keyguard, as the expansion fraction is 1 in this // case. && !(shadeCollapseActivityLaunchFix() && mExpandedFraction == 1f && mBarState == KEYGUARD); } public void instantCollapse() { Loading
packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java +28 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.systemui.shade; import static com.android.keyguard.KeyguardClockSwitch.LARGE; import static com.android.keyguard.KeyguardClockSwitch.SMALL; import static com.android.systemui.Flags.FLAG_SHADE_COLLAPSE_ACTIVITY_LAUNCH_FIX; import static com.android.systemui.shade.ShadeExpansionStateManagerKt.STATE_CLOSED; import static com.android.systemui.shade.ShadeExpansionStateManagerKt.STATE_OPEN; import static com.android.systemui.shade.ShadeExpansionStateManagerKt.STATE_OPENING; Loading Loading @@ -47,6 +48,7 @@ import android.animation.ValueAnimator; import android.graphics.Point; import android.os.PowerManager; import android.platform.test.annotations.DisableFlags; import android.platform.test.annotations.EnableFlags; import android.testing.AndroidTestingRunner; import android.testing.TestableLooper; import android.view.MotionEvent; Loading Loading @@ -674,6 +676,32 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo assertThat(mNotificationPanelViewController.canCollapsePanelOnTouch()).isFalse(); } @Test @EnableFlags(FLAG_SHADE_COLLAPSE_ACTIVITY_LAUNCH_FIX) public void testCanBeCollapsed_expandedInKeyguard() { mStatusBarStateController.setState(KEYGUARD); mNotificationPanelViewController.setExpandedFraction(1f); assertThat(mNotificationPanelViewController.canBeCollapsed()).isFalse(); } @Test @EnableFlags(FLAG_SHADE_COLLAPSE_ACTIVITY_LAUNCH_FIX) public void testCanBeCollapsed_expandedInShade() { mStatusBarStateController.setState(SHADE); mNotificationPanelViewController.setExpandedFraction(1f); assertThat(mNotificationPanelViewController.canBeCollapsed()).isTrue(); } @Test @DisableFlags(FLAG_SHADE_COLLAPSE_ACTIVITY_LAUNCH_FIX) public void testCanBeCollapsed_expandedInKeyguard_flagDisabled() { mStatusBarStateController.setState(KEYGUARD); mNotificationPanelViewController.setExpandedFraction(1f); assertThat(mNotificationPanelViewController.canBeCollapsed()).isTrue(); } @Test public void testSwipeWhileLocked_notifiesKeyguardState() { mStatusBarStateController.setState(KEYGUARD); Loading