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

Commit 293b2d75 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fixed animation for legacy devices and when not always on"

parents 86535144 15af9769
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
@@ -2432,7 +2432,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
@@ -3622,10 +3622,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);