Merge "Remove AOD clock combine call to improve perf" into main
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardClockViewBinder.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardClockViewBinder.kt
index c846cbe..f2821a0 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardClockViewBinder.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardClockViewBinder.kt
@@ -37,7 +37,6 @@
 import com.android.systemui.lifecycle.repeatWhenAttached
 import com.android.systemui.plugins.clocks.AodClockBurnInModel
 import com.android.systemui.plugins.clocks.ClockController
-import kotlinx.coroutines.flow.combine
 import kotlinx.coroutines.launch
 
 object KeyguardClockViewBinder {
@@ -113,24 +112,17 @@
 
                 launch {
                     if (!MigrateClocksToBlueprint.isEnabled) return@launch
-                    combine(
-                            rootViewModel.translationX,
-                            rootViewModel.translationY,
-                            rootViewModel.scale,
-                            ::Triple
-                        )
-                        .collect { (translationX, translationY, scale) ->
-                            viewModel.currentClock.value
-                                ?.largeClock
-                                ?.layout
-                                ?.applyAodBurnIn(
-                                    AodClockBurnInModel(
-                                        translationX = translationX.value!!,
-                                        translationY = translationY,
-                                        scale = scale.scale
-                                    )
+                    rootViewModel.burnInModel.collect { burnInModel ->
+                        viewModel.currentClock.value?.let {
+                            it.largeClock.layout.applyAodBurnIn(
+                                AodClockBurnInModel(
+                                    translationX = burnInModel.translationX.toFloat(),
+                                    translationY = burnInModel.translationY.toFloat(),
+                                    scale = burnInModel.scale
                                 )
+                            )
                         }
+                    }
                 }
             }
         }
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardRootViewModel.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardRootViewModel.kt
index f405b9d..f8a9310 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardRootViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardRootViewModel.kt
@@ -58,6 +58,7 @@
 import kotlinx.coroutines.Job
 import kotlinx.coroutines.flow.Flow
 import kotlinx.coroutines.flow.MutableStateFlow
+import kotlinx.coroutines.flow.asStateFlow
 import kotlinx.coroutines.flow.combine
 import kotlinx.coroutines.flow.combineTransform
 import kotlinx.coroutines.flow.distinctUntilChanged
@@ -117,7 +118,8 @@
     private val shadeInteractor: ShadeInteractor,
 ) {
     private var burnInJob: Job? = null
-    internal val burnInModel = MutableStateFlow(BurnInModel())
+    private val _burnInModel = MutableStateFlow(BurnInModel())
+    val burnInModel = _burnInModel.asStateFlow()
 
     val burnInLayerVisibility: Flow<Int> =
         keyguardTransitionInteractor.startedKeyguardState
@@ -279,7 +281,7 @@
 
         burnInJob =
             scope.launch("$TAG#aodBurnInViewModel") {
-                aodBurnInViewModel.movement(params).collect { burnInModel.value = it }
+                aodBurnInViewModel.movement(params).collect { _burnInModel.value = it }
             }
     }