diff options
5 files changed, 62 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 8306620b3de6..a3a1fa58e88e 100644 --- a/packages/SystemUI/animation/src/com/android/systemui/animation/ActivityLaunchAnimator.kt +++ b/packages/SystemUI/animation/src/com/android/systemui/animation/ActivityLaunchAnimator.kt @@ -240,8 +240,15 @@ class ActivityLaunchAnimator( private fun Controller.callOnIntentStartedOnMainThread(willAnimate: Boolean) { if (Looper.myLooper() != Looper.getMainLooper()) { - this.launchContainer.context.mainExecutor.execute { this.onIntentStarted(willAnimate) } + this.launchContainer.context.mainExecutor.execute { + callOnIntentStartedOnMainThread(willAnimate) + } } else { + // TODO(b/288507023): Remove this log. + Log.d( + TAG, + "Calling controller.onIntentStarted(willAnimate=$willAnimate) [controller=$this]" + ) this.onIntentStarted(willAnimate) } } @@ -541,6 +548,9 @@ class ActivityLaunchAnimator( Log.i(TAG, "Aborting the animation as no window is opening") removeTimeout() iCallback?.invoke() + + // TODO(b/288507023): Remove this log. + Log.d(TAG, "Calling controller.onLaunchAnimationCancelled() [no window opening]") controller.onLaunchAnimationCancelled() return } @@ -758,6 +768,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]") controller.onLaunchAnimationCancelled() } @@ -772,6 +785,12 @@ class ActivityLaunchAnimator( removeTimeout() animation?.cancel() + + // TODO(b/288507023): Remove this log. + Log.d( + TAG, + "Calling controller.onLaunchAnimationCancelled() [remote animation cancelled]", + ) controller.onLaunchAnimationCancelled() } diff --git a/packages/SystemUI/ktfmt_includes.txt b/packages/SystemUI/ktfmt_includes.txt index 31df2baec08c..2d5796eedc78 100644 --- a/packages/SystemUI/ktfmt_includes.txt +++ b/packages/SystemUI/ktfmt_includes.txt @@ -303,7 +303,6 @@ -packages/SystemUI/src/com/android/systemui/statusbar/notification/LaunchAnimationParameters.kt -packages/SystemUI/src/com/android/systemui/statusbar/notification/NotifPipelineFlags.kt -packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationClickerLogger.kt --packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationLaunchAnimatorController.kt -packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationSectionsFeatureManager.kt -packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationUtils.kt -packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinator.kt diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java index 06557f2f2c79..3a916cf198f3 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java +++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java @@ -545,6 +545,8 @@ public class NotificationShadeWindowViewController { @VisibleForTesting void setExpandAnimationRunning(boolean running) { if (mExpandAnimationRunning != running) { + // TODO(b/288507023): Remove this log. + 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 91547a44c5f5..63f0694c759a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationLaunchAnimatorController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationLaunchAnimatorController.kt @@ -16,6 +16,7 @@ package com.android.systemui.statusbar.notification +import android.util.Log import android.view.ViewGroup import com.android.internal.jank.InteractionJankMonitor import com.android.systemui.animation.ActivityLaunchAnimator @@ -30,6 +31,8 @@ import javax.inject.Inject import kotlin.math.ceil import kotlin.math.max +private const val TAG = "NotificationLaunchAnimatorController" + /** A provider of [NotificationLaunchAnimatorController]. */ @CentralSurfacesComponent.CentralSurfacesScope class NotificationLaunchAnimatorControllerProvider @Inject constructor( @@ -89,28 +92,33 @@ class NotificationLaunchAnimatorController( val clipStartLocation = notificationListContainer.topClippingStartLocation val roundedTopClipping = (clipStartLocation - location[1]).coerceAtLeast(0) val windowTop = location[1] + roundedTopClipping - val topCornerRadius = if (roundedTopClipping > 0) { - // Because the rounded Rect clipping is complex, we start the top rounding at - // 0, which is pretty close to matching the real clipping. - // We'd have to clipOut the overlaid drawable too with the outer rounded rect in case - // if we'd like to have this perfect, but this is close enough. - 0f - } else { - notification.topCornerRadius - } - val params = LaunchAnimationParameters( - top = windowTop, - bottom = location[1] + height, - left = location[0], - right = location[0] + notification.width, - topCornerRadius = topCornerRadius, - bottomCornerRadius = notification.bottomCornerRadius - ) + val topCornerRadius = + if (roundedTopClipping > 0) { + // Because the rounded Rect clipping is complex, we start the top rounding at + // 0, which is pretty close to matching the real clipping. + // We'd have to clipOut the overlaid drawable too with the outer rounded rect in + // case + // if we'd like to have this perfect, but this is close enough. + 0f + } else { + notification.topCornerRadius + } + val params = + LaunchAnimationParameters( + top = windowTop, + bottom = location[1] + height, + left = location[0], + right = location[0] + notification.width, + topCornerRadius = topCornerRadius, + bottomCornerRadius = notification.bottomCornerRadius + ) params.startTranslationZ = notification.translationZ params.startNotificationTop = location[1] - params.notificationParentTop = notificationListContainer - .getViewParentForNotification(notificationEntry).locationOnScreen[1] + params.notificationParentTop = + notificationListContainer + .getViewParentForNotification(notificationEntry) + .locationOnScreen[1] params.startRoundedTopClipping = roundedTopClipping params.startClipTopAmount = notification.clipTopAmount if (notification.isChildInGroup) { @@ -135,6 +143,8 @@ class NotificationLaunchAnimatorController( } override fun onIntentStarted(willAnimate: Boolean) { + // TODO(b/288507023): Remove this log. + Log.d(TAG, "onIntentStarted(willAnimate=$willAnimate)") notificationExpansionRepository.setIsExpandAnimationRunning(willAnimate) notificationEntry.isExpandAnimationRunning = willAnimate @@ -165,6 +175,9 @@ class NotificationLaunchAnimatorController( } override fun onLaunchAnimationCancelled(newKeyguardOccludedState: Boolean?) { + // TODO(b/288507023): Remove this log. + Log.d(TAG, "onLaunchAnimationCancelled()") + // TODO(b/184121838): Should we call InteractionJankMonitor.cancel if the animation started // here? notificationExpansionRepository.setIsExpandAnimationRunning(false) @@ -177,11 +190,12 @@ class NotificationLaunchAnimatorController( notification.isExpandAnimationRunning = true notificationListContainer.setExpandingNotification(notification) - jankMonitor.begin(notification, - InteractionJankMonitor.CUJ_NOTIFICATION_APP_START) + jankMonitor.begin(notification, InteractionJankMonitor.CUJ_NOTIFICATION_APP_START) } override fun onLaunchAnimationEnd(isExpandingFullyAbove: Boolean) { + // TODO(b/288507023): Remove this log. + 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 f605bdffbfd9..8754c4a0d7c3 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 @@ -16,12 +16,15 @@ package com.android.systemui.statusbar.notification.data.repository +import android.util.Log import com.android.systemui.dagger.SysUISingleton import javax.inject.Inject import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.asStateFlow +private const val TAG = "NotificationExpansionRepository" + /** A repository tracking the status of notification expansion animations. */ @SysUISingleton class NotificationExpansionRepository @Inject constructor() { @@ -37,6 +40,8 @@ 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)") _isExpandAnimationRunning.value = running } } |