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

Commit 15af9769 authored by Selim Cinek's avatar Selim Cinek
Browse files

Fixed animation for legacy devices and when not always on

We were always animating the pulsing before, even if the
device didn't support this properly or if the device wasn't
always on. This also fixed the wake-up animation for these
devices.

Fixes: 129015862
Fixes: 128636045
Test: atest SystemUITests
Change-Id: Iadc562ed0195c69c69feff70e6a7ed9d0689cf4a
parent 7bc9be71
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.systemui.statusbar.notification

import android.animation.ObjectAnimator
import android.content.Context
import android.util.FloatProperty
import com.android.systemui.Interpolators
import com.android.systemui.plugins.statusbar.StatusBarStateController
@@ -25,12 +26,14 @@ import com.android.systemui.statusbar.SysuiStatusBarStateController
import com.android.systemui.statusbar.notification.collection.NotificationEntry
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout
import com.android.systemui.statusbar.notification.stack.StackStateAnimator
import com.android.systemui.statusbar.phone.DozeParameters

import javax.inject.Inject
import javax.inject.Singleton

@Singleton
class NotificationWakeUpCoordinator @Inject constructor(
        private val mContext: Context,
        private val mAmbientPulseManager: AmbientPulseManager,
        private val mStatusBarStateController: StatusBarStateController)
    : AmbientPulseManager.OnAmbientChangedListener, StatusBarStateController.StateListener {
@@ -59,10 +62,12 @@ class NotificationWakeUpCoordinator @Inject constructor(
    private var mLinearVisibilityAmount = 0.0f
    private var mWakingUp = false
    private val mEntrySetToClearWhenFinished = mutableSetOf<NotificationEntry>()
    private val mDozeParameters: DozeParameters;

    init {
        mAmbientPulseManager.addListener(this)
        mStatusBarStateController.addCallback(this)
        mDozeParameters = DozeParameters.getInstance(mContext)
    }

    fun setStackScroller(stackScroller: NotificationStackScrollLayout) {
@@ -194,7 +199,7 @@ class NotificationWakeUpCoordinator @Inject constructor(
    }

    override fun onAmbientStateChanged(entry: NotificationEntry, isPulsing: Boolean) {
        var animate = true
        var animate = mDozeParameters.getAlwaysOn() && !mDozeParameters.getDisplayNeedsBlanking()
        if (!isPulsing) {
            if (mLinearDozeAmount != 0.0f) {
                if (entry.isRowDismissed) {
+1 −1
Original line number Diff line number Diff line
@@ -2429,7 +2429,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
    protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
        int intrinsicBefore = getIntrinsicHeight();
        super.onLayout(changed, left, top, right, bottom);
        if (intrinsicBefore != getIntrinsicHeight()) {
        if (intrinsicBefore != getIntrinsicHeight() && intrinsicBefore != 0) {
            notifyHeightChanged(true  /* needsAnimation */);
        }
        if (mMenuRow.getMenuView() != null) {
+4 −1
Original line number Diff line number Diff line
@@ -3597,10 +3597,13 @@ public class StatusBar extends SystemUI implements DemoMode,
            mWakeUpCoordinator.setWakingUp(true);
            mAmbientPulseManager.releaseAllImmediately();
            mVisualStabilityManager.setScreenOn(true);
            updateNotificationPanelTouchState();
            updateVisibleToUser();
            updateIsKeyguard();
            mDozeServiceHost.stopDozing();
            // This is intentionally below the stopDozing call above, since it avoids that we're
            // unnecessarily animating the wakeUp transition. Animations should only be enabled
            // once we fully woke up.
            updateNotificationPanelTouchState();
            mPulseExpansionHandler.onStartedWakingUp();
        }

+1 −1
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ public class NotificationPanelViewTest extends SysuiTestCase {
        mDependency.injectMockDependency(ConfigurationController.class);
        mDependency.injectMockDependency(ZenModeController.class);
        NotificationWakeUpCoordinator coordinator =
                new NotificationWakeUpCoordinator(
                new NotificationWakeUpCoordinator(mContext,
                        new AmbientPulseManager(mContext),
                        new StatusBarStateControllerImpl());
        PulseExpansionHandler expansionHandler = new PulseExpansionHandler(mContext, coordinator);