Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinator.kt +11 −19 Original line number Diff line number Diff line Loading @@ -98,8 +98,6 @@ class NotificationWakeUpCoordinator @Inject constructor( } } private var animatingScreenOff = false private var collapsedEnoughToHide: Boolean = false var pulsing: Boolean = false Loading Loading @@ -236,11 +234,11 @@ class NotificationWakeUpCoordinator @Inject constructor( } override fun onDozeAmountChanged(linear: Float, eased: Float) { if (overrideDozeAmountIfBypass()) { if (overrideDozeAmountIfAnimatingScreenOff(linear)) { return } if (overrideDozeAmountIfAnimatingScreenOff(linear)) { if (overrideDozeAmountIfBypass()) { return } Loading @@ -267,7 +265,7 @@ class NotificationWakeUpCoordinator @Inject constructor( override fun onStateChanged(newState: Int) { if (unlockedScreenOffAnimationController.shouldPlayScreenOffAnimation()) { if (animatingScreenOff && if (unlockedScreenOffAnimationController.isScreenOffAnimationPlaying() && state == StatusBarState.KEYGUARD && newState == StatusBarState.SHADE) { // If we're animating the screen off and going from KEYGUARD back to SHADE, the Loading @@ -275,12 +273,16 @@ class NotificationWakeUpCoordinator @Inject constructor( // dozing) so that the notifications are no longer hidden. setDozeAmount(0f, 0f) } } animatingScreenOff = state == StatusBarState.SHADE && newState == StatusBarState.KEYGUARD if (overrideDozeAmountIfAnimatingScreenOff(mLinearDozeAmount)) { return } if (overrideDozeAmountIfBypass()) { return } overrideDozeAmountIfBypass() if (bypassController.bypassEnabled && newState == StatusBarState.KEYGUARD && state == StatusBarState.SHADE_LOCKED && (!statusBarStateController.isDozing || shouldAnimateVisibility())) { Loading Loading @@ -330,12 +332,7 @@ class NotificationWakeUpCoordinator @Inject constructor( * animation. If true, the original doze amount should be ignored. */ private fun overrideDozeAmountIfAnimatingScreenOff(linearDozeAmount: Float): Boolean { if (animatingScreenOff) { if (linearDozeAmount == 1f) { animatingScreenOff = false return false } if (unlockedScreenOffAnimationController.isScreenOffAnimationPlaying()) { setDozeAmount(1f, 1f) return true } Loading Loading @@ -395,11 +392,6 @@ class NotificationWakeUpCoordinator @Inject constructor( override fun onDozingChanged(isDozing: Boolean) { if (isDozing) { setNotificationsVisible(visible = false, animate = false, increaseSpeed = false) } else { // We only unset the flag once we fully went asleep. If the user interrupts the // animation in the middle, we have to abort the animation as well to make sure // the notifications are visible again. animatingScreenOff = false } } Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +7 −2 Original line number Diff line number Diff line Loading @@ -106,6 +106,7 @@ import com.android.systemui.statusbar.phone.HeadsUpAppearanceController; import com.android.systemui.statusbar.phone.HeadsUpTouchHelper; import com.android.systemui.statusbar.phone.ShadeController; import com.android.systemui.statusbar.phone.StatusBar; import com.android.systemui.statusbar.phone.UnlockedScreenOffAnimationController; import com.android.systemui.statusbar.policy.HeadsUpUtil; import com.android.systemui.statusbar.policy.ScrollAdapter; import com.android.systemui.util.Assert; Loading Loading @@ -456,6 +457,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable private long mNumHeadsUp; private NotificationStackScrollLayoutController.TouchHandler mTouchHandler; private final FeatureFlags mFeatureFlags; private final UnlockedScreenOffAnimationController mUnlockedScreenOffAnimationController; private boolean mShouldUseSplitNotificationShade; private final ExpandableView.OnHeightChangedListener mOnChildHeightChangedListener = Loading Loading @@ -497,11 +499,13 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable GroupMembershipManager groupMembershipManager, GroupExpansionManager groupExpansionManager, AmbientState ambientState, FeatureFlags featureFlags) { FeatureFlags featureFlags, UnlockedScreenOffAnimationController unlockedScreenOffAnimationController) { super(context, attrs, 0, 0); Resources res = getResources(); mSectionsManager = notificationSectionsManager; mFeatureFlags = featureFlags; mUnlockedScreenOffAnimationController = unlockedScreenOffAnimationController; mShouldUseSplitNotificationShade = shouldUseSplitNotificationShade(mFeatureFlags, res); mSectionsManager.initialize(this, LayoutInflater.from(context)); mSections = mSectionsManager.createSectionsForBuckets(); Loading Loading @@ -606,6 +610,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable RemoteInputController remoteInputController = mRemoteInputManager.getController(); boolean showFooterView = (showDismissView || mController.hasActiveNotifications()) && mStatusBarState != StatusBarState.KEYGUARD && !mUnlockedScreenOffAnimationController.isScreenOffAnimationPlaying() && (remoteInputController == null || !remoteInputController.isRemoteInputActive()); boolean showHistory = Settings.Secure.getIntForUser(mContext.getContentResolver(), Settings.Secure.NOTIFICATION_HISTORY_ENABLED, 0, UserHandle.USER_CURRENT) == 1; Loading Loading @@ -4617,7 +4622,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) @VisibleForTesting protected void setStatusBarState(int statusBarState) { public void setStatusBarState(int statusBarState) { mStatusBarState = statusBarState; mAmbientState.setStatusBarState(statusBarState); updateSpeedBumpIndex(); Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +2 −1 Original line number Diff line number Diff line Loading @@ -4283,7 +4283,8 @@ public class NotificationPanelViewController extends PanelViewController { /** * Reconfigures the shade to show the AOD UI (clock, smartspace, etc). This is called by the * screen off animation controller in order to animate in AOD without "actually" fully switching * to the KEYGUARD state. * to the KEYGUARD state, which is a heavy transition that causes jank as 10+ files react to the * change. */ public void showAodUi() { setDozing(true /* dozing */, false /* animate */, null); Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java +4 −1 Original line number Diff line number Diff line Loading @@ -65,6 +65,7 @@ import com.android.systemui.statusbar.notification.row.FooterView; import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout.KeyguardBypassEnabledProvider; import com.android.systemui.statusbar.phone.ShadeController; import com.android.systemui.statusbar.phone.StatusBar; import com.android.systemui.statusbar.phone.UnlockedScreenOffAnimationController; import org.junit.Assert; import org.junit.Before; Loading Loading @@ -105,6 +106,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Mock private NotificationSwipeHelper mNotificationSwipeHelper; @Mock private NotificationStackScrollLayoutController mStackScrollLayoutController; @Mock private FeatureFlags mFeatureFlags; @Mock private UnlockedScreenOffAnimationController mUnlockedScreenOffAnimationController; @Before @UiThreadTest Loading Loading @@ -143,7 +145,8 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { mGroupMembershipManger, mGroupExpansionManager, mAmbientState, mFeatureFlags); mFeatureFlags, mUnlockedScreenOffAnimationController); mStackScrollerInternal.initView(getContext(), mKeyguardBypassEnabledProvider, mNotificationSwipeHelper); mStackScroller = spy(mStackScrollerInternal); Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinator.kt +11 −19 Original line number Diff line number Diff line Loading @@ -98,8 +98,6 @@ class NotificationWakeUpCoordinator @Inject constructor( } } private var animatingScreenOff = false private var collapsedEnoughToHide: Boolean = false var pulsing: Boolean = false Loading Loading @@ -236,11 +234,11 @@ class NotificationWakeUpCoordinator @Inject constructor( } override fun onDozeAmountChanged(linear: Float, eased: Float) { if (overrideDozeAmountIfBypass()) { if (overrideDozeAmountIfAnimatingScreenOff(linear)) { return } if (overrideDozeAmountIfAnimatingScreenOff(linear)) { if (overrideDozeAmountIfBypass()) { return } Loading @@ -267,7 +265,7 @@ class NotificationWakeUpCoordinator @Inject constructor( override fun onStateChanged(newState: Int) { if (unlockedScreenOffAnimationController.shouldPlayScreenOffAnimation()) { if (animatingScreenOff && if (unlockedScreenOffAnimationController.isScreenOffAnimationPlaying() && state == StatusBarState.KEYGUARD && newState == StatusBarState.SHADE) { // If we're animating the screen off and going from KEYGUARD back to SHADE, the Loading @@ -275,12 +273,16 @@ class NotificationWakeUpCoordinator @Inject constructor( // dozing) so that the notifications are no longer hidden. setDozeAmount(0f, 0f) } } animatingScreenOff = state == StatusBarState.SHADE && newState == StatusBarState.KEYGUARD if (overrideDozeAmountIfAnimatingScreenOff(mLinearDozeAmount)) { return } if (overrideDozeAmountIfBypass()) { return } overrideDozeAmountIfBypass() if (bypassController.bypassEnabled && newState == StatusBarState.KEYGUARD && state == StatusBarState.SHADE_LOCKED && (!statusBarStateController.isDozing || shouldAnimateVisibility())) { Loading Loading @@ -330,12 +332,7 @@ class NotificationWakeUpCoordinator @Inject constructor( * animation. If true, the original doze amount should be ignored. */ private fun overrideDozeAmountIfAnimatingScreenOff(linearDozeAmount: Float): Boolean { if (animatingScreenOff) { if (linearDozeAmount == 1f) { animatingScreenOff = false return false } if (unlockedScreenOffAnimationController.isScreenOffAnimationPlaying()) { setDozeAmount(1f, 1f) return true } Loading Loading @@ -395,11 +392,6 @@ class NotificationWakeUpCoordinator @Inject constructor( override fun onDozingChanged(isDozing: Boolean) { if (isDozing) { setNotificationsVisible(visible = false, animate = false, increaseSpeed = false) } else { // We only unset the flag once we fully went asleep. If the user interrupts the // animation in the middle, we have to abort the animation as well to make sure // the notifications are visible again. animatingScreenOff = false } } Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +7 −2 Original line number Diff line number Diff line Loading @@ -106,6 +106,7 @@ import com.android.systemui.statusbar.phone.HeadsUpAppearanceController; import com.android.systemui.statusbar.phone.HeadsUpTouchHelper; import com.android.systemui.statusbar.phone.ShadeController; import com.android.systemui.statusbar.phone.StatusBar; import com.android.systemui.statusbar.phone.UnlockedScreenOffAnimationController; import com.android.systemui.statusbar.policy.HeadsUpUtil; import com.android.systemui.statusbar.policy.ScrollAdapter; import com.android.systemui.util.Assert; Loading Loading @@ -456,6 +457,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable private long mNumHeadsUp; private NotificationStackScrollLayoutController.TouchHandler mTouchHandler; private final FeatureFlags mFeatureFlags; private final UnlockedScreenOffAnimationController mUnlockedScreenOffAnimationController; private boolean mShouldUseSplitNotificationShade; private final ExpandableView.OnHeightChangedListener mOnChildHeightChangedListener = Loading Loading @@ -497,11 +499,13 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable GroupMembershipManager groupMembershipManager, GroupExpansionManager groupExpansionManager, AmbientState ambientState, FeatureFlags featureFlags) { FeatureFlags featureFlags, UnlockedScreenOffAnimationController unlockedScreenOffAnimationController) { super(context, attrs, 0, 0); Resources res = getResources(); mSectionsManager = notificationSectionsManager; mFeatureFlags = featureFlags; mUnlockedScreenOffAnimationController = unlockedScreenOffAnimationController; mShouldUseSplitNotificationShade = shouldUseSplitNotificationShade(mFeatureFlags, res); mSectionsManager.initialize(this, LayoutInflater.from(context)); mSections = mSectionsManager.createSectionsForBuckets(); Loading Loading @@ -606,6 +610,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable RemoteInputController remoteInputController = mRemoteInputManager.getController(); boolean showFooterView = (showDismissView || mController.hasActiveNotifications()) && mStatusBarState != StatusBarState.KEYGUARD && !mUnlockedScreenOffAnimationController.isScreenOffAnimationPlaying() && (remoteInputController == null || !remoteInputController.isRemoteInputActive()); boolean showHistory = Settings.Secure.getIntForUser(mContext.getContentResolver(), Settings.Secure.NOTIFICATION_HISTORY_ENABLED, 0, UserHandle.USER_CURRENT) == 1; Loading Loading @@ -4617,7 +4622,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) @VisibleForTesting protected void setStatusBarState(int statusBarState) { public void setStatusBarState(int statusBarState) { mStatusBarState = statusBarState; mAmbientState.setStatusBarState(statusBarState); updateSpeedBumpIndex(); Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +2 −1 Original line number Diff line number Diff line Loading @@ -4283,7 +4283,8 @@ public class NotificationPanelViewController extends PanelViewController { /** * Reconfigures the shade to show the AOD UI (clock, smartspace, etc). This is called by the * screen off animation controller in order to animate in AOD without "actually" fully switching * to the KEYGUARD state. * to the KEYGUARD state, which is a heavy transition that causes jank as 10+ files react to the * change. */ public void showAodUi() { setDozing(true /* dozing */, false /* animate */, null); Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java +4 −1 Original line number Diff line number Diff line Loading @@ -65,6 +65,7 @@ import com.android.systemui.statusbar.notification.row.FooterView; import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout.KeyguardBypassEnabledProvider; import com.android.systemui.statusbar.phone.ShadeController; import com.android.systemui.statusbar.phone.StatusBar; import com.android.systemui.statusbar.phone.UnlockedScreenOffAnimationController; import org.junit.Assert; import org.junit.Before; Loading Loading @@ -105,6 +106,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Mock private NotificationSwipeHelper mNotificationSwipeHelper; @Mock private NotificationStackScrollLayoutController mStackScrollLayoutController; @Mock private FeatureFlags mFeatureFlags; @Mock private UnlockedScreenOffAnimationController mUnlockedScreenOffAnimationController; @Before @UiThreadTest Loading Loading @@ -143,7 +145,8 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { mGroupMembershipManger, mGroupExpansionManager, mAmbientState, mFeatureFlags); mFeatureFlags, mUnlockedScreenOffAnimationController); mStackScrollerInternal.initView(getContext(), mKeyguardBypassEnabledProvider, mNotificationSwipeHelper); mStackScroller = spy(mStackScrollerInternal); Loading