diff options
4 files changed, 43 insertions, 23 deletions
diff --git a/packages/SystemUI/animation/src/com/android/systemui/animation/ActivityLaunchAnimator.kt b/packages/SystemUI/animation/src/com/android/systemui/animation/ActivityLaunchAnimator.kt index a3a1fa58e88e..0c076169eb57 100644 --- a/packages/SystemUI/animation/src/com/android/systemui/animation/ActivityLaunchAnimator.kt +++ b/packages/SystemUI/animation/src/com/android/systemui/animation/ActivityLaunchAnimator.kt @@ -24,6 +24,7 @@ import android.graphics.Matrix import android.graphics.Path import android.graphics.Rect import android.graphics.RectF +import android.os.Build import android.os.Looper import android.os.RemoteException import android.util.Log @@ -88,6 +89,9 @@ class ActivityLaunchAnimator( contentAfterFadeInInterpolator = PathInterpolator(0f, 0f, 0.6f, 1f) ) + // TODO(b/288507023): Remove this flag. + @JvmField val DEBUG_LAUNCH_ANIMATION = Build.IS_DEBUGGABLE + private val DEFAULT_LAUNCH_ANIMATOR = LaunchAnimator(TIMINGS, INTERPOLATORS) private val DEFAULT_DIALOG_TO_APP_ANIMATOR = LaunchAnimator(DIALOG_TIMINGS, INTERPOLATORS) @@ -244,11 +248,13 @@ class ActivityLaunchAnimator( callOnIntentStartedOnMainThread(willAnimate) } } else { - // TODO(b/288507023): Remove this log. - Log.d( - TAG, - "Calling controller.onIntentStarted(willAnimate=$willAnimate) [controller=$this]" - ) + if (DEBUG_LAUNCH_ANIMATION) { + Log.d( + TAG, + "Calling controller.onIntentStarted(willAnimate=$willAnimate) " + + "[controller=$this]" + ) + } this.onIntentStarted(willAnimate) } } @@ -549,8 +555,12 @@ class ActivityLaunchAnimator( removeTimeout() iCallback?.invoke() - // TODO(b/288507023): Remove this log. - Log.d(TAG, "Calling controller.onLaunchAnimationCancelled() [no window opening]") + if (DEBUG_LAUNCH_ANIMATION) { + Log.d( + TAG, + "Calling controller.onLaunchAnimationCancelled() [no window opening]" + ) + } controller.onLaunchAnimationCancelled() return } @@ -769,8 +779,9 @@ class ActivityLaunchAnimator( Log.i(TAG, "Remote animation timed out") timedOut = true - // TODO(b/288507023): Remove this log. - Log.d(TAG, "Calling controller.onLaunchAnimationCancelled() [animation timed out]") + if (DEBUG_LAUNCH_ANIMATION) { + Log.d(TAG, "Calling controller.onLaunchAnimationCancelled() [animation timed out]") + } controller.onLaunchAnimationCancelled() } @@ -786,11 +797,12 @@ class ActivityLaunchAnimator( animation?.cancel() - // TODO(b/288507023): Remove this log. - Log.d( - TAG, - "Calling controller.onLaunchAnimationCancelled() [remote animation cancelled]", - ) + if (DEBUG_LAUNCH_ANIMATION) { + Log.d( + TAG, + "Calling controller.onLaunchAnimationCancelled() [remote animation cancelled]", + ) + } controller.onLaunchAnimationCancelled() } diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java index 0f85c7616071..880ba92123c6 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java +++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java @@ -37,6 +37,7 @@ import com.android.keyguard.LockIconViewController; import com.android.keyguard.dagger.KeyguardBouncerComponent; import com.android.systemui.Dumpable; import com.android.systemui.R; +import com.android.systemui.animation.ActivityLaunchAnimator; import com.android.systemui.back.domain.interactor.BackActionInteractor; import com.android.systemui.bouncer.domain.interactor.BouncerMessageInteractor; import com.android.systemui.bouncer.ui.binder.KeyguardBouncerViewBinder; @@ -560,7 +561,9 @@ public class NotificationShadeWindowViewController implements Dumpable { void setExpandAnimationRunning(boolean running) { if (mExpandAnimationRunning != running) { // TODO(b/288507023): Remove this log. - Log.d(TAG, "Setting mExpandAnimationRunning=" + running); + if (ActivityLaunchAnimator.DEBUG_LAUNCH_ANIMATION) { + Log.d(TAG, "Setting mExpandAnimationRunning=" + running); + } if (running) { mLaunchAnimationTimeout = mClock.uptimeMillis() + 5000; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationLaunchAnimatorController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationLaunchAnimatorController.kt index 0aedbf36563a..c62546f67f8d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationLaunchAnimatorController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationLaunchAnimatorController.kt @@ -140,8 +140,9 @@ class NotificationLaunchAnimatorController( } override fun onIntentStarted(willAnimate: Boolean) { - // TODO(b/288507023): Remove this log. - Log.d(TAG, "onIntentStarted(willAnimate=$willAnimate)") + if (ActivityLaunchAnimator.DEBUG_LAUNCH_ANIMATION) { + Log.d(TAG, "onIntentStarted(willAnimate=$willAnimate)") + } notificationExpansionRepository.setIsExpandAnimationRunning(willAnimate) notificationEntry.isExpandAnimationRunning = willAnimate @@ -172,8 +173,9 @@ class NotificationLaunchAnimatorController( } override fun onLaunchAnimationCancelled(newKeyguardOccludedState: Boolean?) { - // TODO(b/288507023): Remove this log. - Log.d(TAG, "onLaunchAnimationCancelled()") + if (ActivityLaunchAnimator.DEBUG_LAUNCH_ANIMATION) { + Log.d(TAG, "onLaunchAnimationCancelled()") + } // TODO(b/184121838): Should we call InteractionJankMonitor.cancel if the animation started // here? @@ -191,8 +193,9 @@ class NotificationLaunchAnimatorController( } override fun onLaunchAnimationEnd(isExpandingFullyAbove: Boolean) { - // TODO(b/288507023): Remove this log. - Log.d(TAG, "onLaunchAnimationEnd()") + if (ActivityLaunchAnimator.DEBUG_LAUNCH_ANIMATION) { + Log.d(TAG, "onLaunchAnimationEnd()") + } jankMonitor.end(InteractionJankMonitor.CUJ_NOTIFICATION_APP_START) notification.isExpandAnimationRunning = false diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/data/repository/NotificationExpansionRepository.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/data/repository/NotificationExpansionRepository.kt index 8754c4a0d7c3..6f0a97adb311 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/data/repository/NotificationExpansionRepository.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/data/repository/NotificationExpansionRepository.kt @@ -17,6 +17,7 @@ package com.android.systemui.statusbar.notification.data.repository import android.util.Log +import com.android.systemui.animation.ActivityLaunchAnimator import com.android.systemui.dagger.SysUISingleton import javax.inject.Inject import kotlinx.coroutines.flow.Flow @@ -40,8 +41,9 @@ class NotificationExpansionRepository @Inject constructor() { /** Sets whether the notification expansion animation is currently running. */ fun setIsExpandAnimationRunning(running: Boolean) { - // TODO(b/288507023): Remove this log. - Log.d(TAG, "setIsExpandAnimationRunning(running=$running)") + if (ActivityLaunchAnimator.DEBUG_LAUNCH_ANIMATION) { + Log.d(TAG, "setIsExpandAnimationRunning(running=$running)") + } _isExpandAnimationRunning.value = running } } |