Loading packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java +3 −3 Original line number Diff line number Diff line Loading @@ -65,7 +65,7 @@ import com.android.systemui.statusbar.NotificationInsetsController; import com.android.systemui.statusbar.NotificationShadeDepthController; import com.android.systemui.statusbar.NotificationShadeWindowController; import com.android.systemui.statusbar.SysuiStatusBarStateController; import com.android.systemui.statusbar.notification.data.repository.NotificationExpansionRepository; import com.android.systemui.statusbar.notification.domain.interactor.NotificationLaunchAnimationInteractor; import com.android.systemui.statusbar.notification.stack.AmbientState; import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout; import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController; Loading Loading @@ -182,7 +182,7 @@ public class NotificationShadeWindowViewController implements Dumpable { PrimaryBouncerToGoneTransitionViewModel primaryBouncerToGoneTransitionViewModel, CommunalViewModel communalViewModel, CommunalRepository communalRepository, NotificationExpansionRepository notificationExpansionRepository, NotificationLaunchAnimationInteractor notificationLaunchAnimationInteractor, FeatureFlagsClassic featureFlagsClassic, SystemClock clock, BouncerMessageInteractor bouncerMessageInteractor, Loading Loading @@ -239,7 +239,7 @@ public class NotificationShadeWindowViewController implements Dumpable { mLockscreenToDreamingTransition); collectFlow( mView, notificationExpansionRepository.isExpandAnimationRunning(), notificationLaunchAnimationInteractor.isLaunchAnimationRunning(), this::setExpandAnimationRunning); mClock = clock; Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationLaunchAnimatorController.kt +7 −7 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ import android.view.ViewGroup import com.android.internal.jank.InteractionJankMonitor import com.android.systemui.animation.ActivityLaunchAnimator import com.android.systemui.animation.LaunchAnimator import com.android.systemui.statusbar.notification.data.repository.NotificationExpansionRepository import com.android.systemui.statusbar.notification.domain.interactor.NotificationLaunchAnimationInteractor import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow import com.android.systemui.statusbar.notification.stack.NotificationListContainer import com.android.systemui.statusbar.policy.HeadsUpManager Loading @@ -33,7 +33,7 @@ private const val TAG = "NotificationLaunchAnimatorController" /** A provider of [NotificationLaunchAnimatorController]. */ class NotificationLaunchAnimatorControllerProvider( private val notificationExpansionRepository: NotificationExpansionRepository, private val notificationLaunchAnimationInteractor: NotificationLaunchAnimationInteractor, private val notificationListContainer: NotificationListContainer, private val headsUpManager: HeadsUpManager, private val jankMonitor: InteractionJankMonitor Loading @@ -44,7 +44,7 @@ class NotificationLaunchAnimatorControllerProvider( onFinishAnimationCallback: Runnable? = null ): NotificationLaunchAnimatorController { return NotificationLaunchAnimatorController( notificationExpansionRepository, notificationLaunchAnimationInteractor, notificationListContainer, headsUpManager, notification, Loading @@ -60,7 +60,7 @@ class NotificationLaunchAnimatorControllerProvider( * notification expanding into an opening window. */ class NotificationLaunchAnimatorController( private val notificationExpansionRepository: NotificationExpansionRepository, private val notificationLaunchAnimationInteractor: NotificationLaunchAnimationInteractor, private val notificationListContainer: NotificationListContainer, private val headsUpManager: HeadsUpManager, private val notification: ExpandableNotificationRow, Loading Loading @@ -143,7 +143,7 @@ class NotificationLaunchAnimatorController( if (ActivityLaunchAnimator.DEBUG_LAUNCH_ANIMATION) { Log.d(TAG, "onIntentStarted(willAnimate=$willAnimate)") } notificationExpansionRepository.setIsExpandAnimationRunning(willAnimate) notificationLaunchAnimationInteractor.setIsLaunchAnimationRunning(willAnimate) notificationEntry.isExpandAnimationRunning = willAnimate if (!willAnimate) { Loading Loading @@ -180,7 +180,7 @@ class NotificationLaunchAnimatorController( // TODO(b/184121838): Should we call InteractionJankMonitor.cancel if the animation started // here? notificationExpansionRepository.setIsExpandAnimationRunning(false) notificationLaunchAnimationInteractor.setIsLaunchAnimationRunning(false) notificationEntry.isExpandAnimationRunning = false removeHun(animate = true) onFinishAnimationCallback?.run() Loading @@ -200,7 +200,7 @@ class NotificationLaunchAnimatorController( jankMonitor.end(InteractionJankMonitor.CUJ_NOTIFICATION_APP_START) notification.isExpandAnimationRunning = false notificationExpansionRepository.setIsExpandAnimationRunning(false) notificationLaunchAnimationInteractor.setIsLaunchAnimationRunning(false) notificationEntry.isExpandAnimationRunning = false notificationListContainer.setExpandingNotification(null) applyParams(null) Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/dagger/NotificationsModule.java +3 −3 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ import com.android.systemui.statusbar.notification.collection.render.NotifGutsVi import com.android.systemui.statusbar.notification.collection.render.NotifShadeEventSource; import com.android.systemui.statusbar.notification.collection.render.NotificationVisibilityProvider; import com.android.systemui.statusbar.notification.data.NotificationDataLayerModule; import com.android.systemui.statusbar.notification.data.repository.NotificationExpansionRepository; import com.android.systemui.statusbar.notification.domain.interactor.NotificationLaunchAnimationInteractor; import com.android.systemui.statusbar.notification.icon.ConversationIconManager; import com.android.systemui.statusbar.notification.icon.IconManager; import com.android.systemui.statusbar.notification.init.NotificationsController; Loading Loading @@ -204,12 +204,12 @@ public interface NotificationsModule { @Provides @SysUISingleton static NotificationLaunchAnimatorControllerProvider provideNotifLaunchAnimControllerProvider( NotificationExpansionRepository notificationExpansionRepository, NotificationLaunchAnimationInteractor notificationLaunchAnimationInteractor, NotificationListContainer notificationListContainer, HeadsUpManager headsUpManager, InteractionJankMonitor jankMonitor) { return new NotificationLaunchAnimatorControllerProvider( notificationExpansionRepository, notificationLaunchAnimationInteractor, notificationListContainer, headsUpManager, jankMonitor); Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/data/repository/NotificationLaunchAnimationRepository.kt 0 → 100644 +27 −0 Original line number Diff line number Diff line /* * Copyright (C) 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.systemui.statusbar.notification.data.repository import com.android.systemui.dagger.SysUISingleton import javax.inject.Inject import kotlinx.coroutines.flow.MutableStateFlow /** A repository tracking the status of notification launch animations. */ @SysUISingleton class NotificationLaunchAnimationRepository @Inject constructor() { val isLaunchAnimationRunning = MutableStateFlow(false) } packages/SystemUI/src/com/android/systemui/statusbar/notification/data/repository/NotificationExpansionRepository.kt→packages/SystemUI/src/com/android/systemui/statusbar/notification/domain/interactor/NotificationLaunchAnimationInteractor.kt +16 −13 Original line number Diff line number Diff line Loading @@ -14,22 +14,20 @@ * limitations under the License. */ package com.android.systemui.statusbar.notification.data.repository package com.android.systemui.statusbar.notification.domain.interactor import android.util.Log import com.android.systemui.animation.ActivityLaunchAnimator import com.android.systemui.dagger.SysUISingleton import com.android.systemui.statusbar.notification.data.repository.NotificationLaunchAnimationRepository import javax.inject.Inject import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.asStateFlow private const val TAG = "NotificationExpansionRepository" import kotlinx.coroutines.flow.StateFlow /** A repository tracking the status of notification expansion animations. */ @SysUISingleton class NotificationExpansionRepository @Inject constructor() { private val _isExpandAnimationRunning = MutableStateFlow(false) class NotificationLaunchAnimationInteractor @Inject constructor(private val repository: NotificationLaunchAnimationRepository) { /** * Emits true if an animation that expands a notification object into an opening window is Loading @@ -37,13 +35,18 @@ class NotificationExpansionRepository @Inject constructor() { * * See [com.android.systemui.statusbar.notification.NotificationLaunchAnimatorController]. */ val isExpandAnimationRunning: Flow<Boolean> = _isExpandAnimationRunning.asStateFlow() val isLaunchAnimationRunning: StateFlow<Boolean> get() = repository.isLaunchAnimationRunning /** Sets whether the notification expansion animation is currently running. */ fun setIsExpandAnimationRunning(running: Boolean) { /** Sets whether the notification expansion launch animation is currently running. */ fun setIsLaunchAnimationRunning(running: Boolean) { if (ActivityLaunchAnimator.DEBUG_LAUNCH_ANIMATION) { Log.d(TAG, "setIsExpandAnimationRunning(running=$running)") Log.d(TAG, "setIsLaunchAnimationRunning(running=$running)") } repository.isLaunchAnimationRunning.value = running } _isExpandAnimationRunning.value = running companion object { private const val TAG = "NotificationLaunchAnimationInteractor" } } Loading
packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java +3 −3 Original line number Diff line number Diff line Loading @@ -65,7 +65,7 @@ import com.android.systemui.statusbar.NotificationInsetsController; import com.android.systemui.statusbar.NotificationShadeDepthController; import com.android.systemui.statusbar.NotificationShadeWindowController; import com.android.systemui.statusbar.SysuiStatusBarStateController; import com.android.systemui.statusbar.notification.data.repository.NotificationExpansionRepository; import com.android.systemui.statusbar.notification.domain.interactor.NotificationLaunchAnimationInteractor; import com.android.systemui.statusbar.notification.stack.AmbientState; import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout; import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController; Loading Loading @@ -182,7 +182,7 @@ public class NotificationShadeWindowViewController implements Dumpable { PrimaryBouncerToGoneTransitionViewModel primaryBouncerToGoneTransitionViewModel, CommunalViewModel communalViewModel, CommunalRepository communalRepository, NotificationExpansionRepository notificationExpansionRepository, NotificationLaunchAnimationInteractor notificationLaunchAnimationInteractor, FeatureFlagsClassic featureFlagsClassic, SystemClock clock, BouncerMessageInteractor bouncerMessageInteractor, Loading Loading @@ -239,7 +239,7 @@ public class NotificationShadeWindowViewController implements Dumpable { mLockscreenToDreamingTransition); collectFlow( mView, notificationExpansionRepository.isExpandAnimationRunning(), notificationLaunchAnimationInteractor.isLaunchAnimationRunning(), this::setExpandAnimationRunning); mClock = clock; Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationLaunchAnimatorController.kt +7 −7 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ import android.view.ViewGroup import com.android.internal.jank.InteractionJankMonitor import com.android.systemui.animation.ActivityLaunchAnimator import com.android.systemui.animation.LaunchAnimator import com.android.systemui.statusbar.notification.data.repository.NotificationExpansionRepository import com.android.systemui.statusbar.notification.domain.interactor.NotificationLaunchAnimationInteractor import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow import com.android.systemui.statusbar.notification.stack.NotificationListContainer import com.android.systemui.statusbar.policy.HeadsUpManager Loading @@ -33,7 +33,7 @@ private const val TAG = "NotificationLaunchAnimatorController" /** A provider of [NotificationLaunchAnimatorController]. */ class NotificationLaunchAnimatorControllerProvider( private val notificationExpansionRepository: NotificationExpansionRepository, private val notificationLaunchAnimationInteractor: NotificationLaunchAnimationInteractor, private val notificationListContainer: NotificationListContainer, private val headsUpManager: HeadsUpManager, private val jankMonitor: InteractionJankMonitor Loading @@ -44,7 +44,7 @@ class NotificationLaunchAnimatorControllerProvider( onFinishAnimationCallback: Runnable? = null ): NotificationLaunchAnimatorController { return NotificationLaunchAnimatorController( notificationExpansionRepository, notificationLaunchAnimationInteractor, notificationListContainer, headsUpManager, notification, Loading @@ -60,7 +60,7 @@ class NotificationLaunchAnimatorControllerProvider( * notification expanding into an opening window. */ class NotificationLaunchAnimatorController( private val notificationExpansionRepository: NotificationExpansionRepository, private val notificationLaunchAnimationInteractor: NotificationLaunchAnimationInteractor, private val notificationListContainer: NotificationListContainer, private val headsUpManager: HeadsUpManager, private val notification: ExpandableNotificationRow, Loading Loading @@ -143,7 +143,7 @@ class NotificationLaunchAnimatorController( if (ActivityLaunchAnimator.DEBUG_LAUNCH_ANIMATION) { Log.d(TAG, "onIntentStarted(willAnimate=$willAnimate)") } notificationExpansionRepository.setIsExpandAnimationRunning(willAnimate) notificationLaunchAnimationInteractor.setIsLaunchAnimationRunning(willAnimate) notificationEntry.isExpandAnimationRunning = willAnimate if (!willAnimate) { Loading Loading @@ -180,7 +180,7 @@ class NotificationLaunchAnimatorController( // TODO(b/184121838): Should we call InteractionJankMonitor.cancel if the animation started // here? notificationExpansionRepository.setIsExpandAnimationRunning(false) notificationLaunchAnimationInteractor.setIsLaunchAnimationRunning(false) notificationEntry.isExpandAnimationRunning = false removeHun(animate = true) onFinishAnimationCallback?.run() Loading @@ -200,7 +200,7 @@ class NotificationLaunchAnimatorController( jankMonitor.end(InteractionJankMonitor.CUJ_NOTIFICATION_APP_START) notification.isExpandAnimationRunning = false notificationExpansionRepository.setIsExpandAnimationRunning(false) notificationLaunchAnimationInteractor.setIsLaunchAnimationRunning(false) notificationEntry.isExpandAnimationRunning = false notificationListContainer.setExpandingNotification(null) applyParams(null) Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/dagger/NotificationsModule.java +3 −3 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ import com.android.systemui.statusbar.notification.collection.render.NotifGutsVi import com.android.systemui.statusbar.notification.collection.render.NotifShadeEventSource; import com.android.systemui.statusbar.notification.collection.render.NotificationVisibilityProvider; import com.android.systemui.statusbar.notification.data.NotificationDataLayerModule; import com.android.systemui.statusbar.notification.data.repository.NotificationExpansionRepository; import com.android.systemui.statusbar.notification.domain.interactor.NotificationLaunchAnimationInteractor; import com.android.systemui.statusbar.notification.icon.ConversationIconManager; import com.android.systemui.statusbar.notification.icon.IconManager; import com.android.systemui.statusbar.notification.init.NotificationsController; Loading Loading @@ -204,12 +204,12 @@ public interface NotificationsModule { @Provides @SysUISingleton static NotificationLaunchAnimatorControllerProvider provideNotifLaunchAnimControllerProvider( NotificationExpansionRepository notificationExpansionRepository, NotificationLaunchAnimationInteractor notificationLaunchAnimationInteractor, NotificationListContainer notificationListContainer, HeadsUpManager headsUpManager, InteractionJankMonitor jankMonitor) { return new NotificationLaunchAnimatorControllerProvider( notificationExpansionRepository, notificationLaunchAnimationInteractor, notificationListContainer, headsUpManager, jankMonitor); Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/data/repository/NotificationLaunchAnimationRepository.kt 0 → 100644 +27 −0 Original line number Diff line number Diff line /* * Copyright (C) 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.systemui.statusbar.notification.data.repository import com.android.systemui.dagger.SysUISingleton import javax.inject.Inject import kotlinx.coroutines.flow.MutableStateFlow /** A repository tracking the status of notification launch animations. */ @SysUISingleton class NotificationLaunchAnimationRepository @Inject constructor() { val isLaunchAnimationRunning = MutableStateFlow(false) }
packages/SystemUI/src/com/android/systemui/statusbar/notification/data/repository/NotificationExpansionRepository.kt→packages/SystemUI/src/com/android/systemui/statusbar/notification/domain/interactor/NotificationLaunchAnimationInteractor.kt +16 −13 Original line number Diff line number Diff line Loading @@ -14,22 +14,20 @@ * limitations under the License. */ package com.android.systemui.statusbar.notification.data.repository package com.android.systemui.statusbar.notification.domain.interactor import android.util.Log import com.android.systemui.animation.ActivityLaunchAnimator import com.android.systemui.dagger.SysUISingleton import com.android.systemui.statusbar.notification.data.repository.NotificationLaunchAnimationRepository import javax.inject.Inject import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.asStateFlow private const val TAG = "NotificationExpansionRepository" import kotlinx.coroutines.flow.StateFlow /** A repository tracking the status of notification expansion animations. */ @SysUISingleton class NotificationExpansionRepository @Inject constructor() { private val _isExpandAnimationRunning = MutableStateFlow(false) class NotificationLaunchAnimationInteractor @Inject constructor(private val repository: NotificationLaunchAnimationRepository) { /** * Emits true if an animation that expands a notification object into an opening window is Loading @@ -37,13 +35,18 @@ class NotificationExpansionRepository @Inject constructor() { * * See [com.android.systemui.statusbar.notification.NotificationLaunchAnimatorController]. */ val isExpandAnimationRunning: Flow<Boolean> = _isExpandAnimationRunning.asStateFlow() val isLaunchAnimationRunning: StateFlow<Boolean> get() = repository.isLaunchAnimationRunning /** Sets whether the notification expansion animation is currently running. */ fun setIsExpandAnimationRunning(running: Boolean) { /** Sets whether the notification expansion launch animation is currently running. */ fun setIsLaunchAnimationRunning(running: Boolean) { if (ActivityLaunchAnimator.DEBUG_LAUNCH_ANIMATION) { Log.d(TAG, "setIsExpandAnimationRunning(running=$running)") Log.d(TAG, "setIsLaunchAnimationRunning(running=$running)") } repository.isLaunchAnimationRunning.value = running } _isExpandAnimationRunning.value = running companion object { private const val TAG = "NotificationLaunchAnimationInteractor" } }