Show and hide smartspace (2/3)

Remove sending messages to SysUI to hide smartspace.

Instead of setting from WPPG, we organically listen to the
onCurrentClockChanged() to update the smartspace visibility.

Test: tested that the smartspace shows correctly for the preview
Bug: 274927017
Change-Id: I70c324500c6fb65440a1ee3f6676db89d7a298f4
diff --git a/src/com/android/customization/picker/clock/ui/binder/ClockCarouselViewBinder.kt b/src/com/android/customization/picker/clock/ui/binder/ClockCarouselViewBinder.kt
index 98c84f2..e703517 100644
--- a/src/com/android/customization/picker/clock/ui/binder/ClockCarouselViewBinder.kt
+++ b/src/com/android/customization/picker/clock/ui/binder/ClockCarouselViewBinder.kt
@@ -39,7 +39,6 @@
         viewModel: ClockCarouselViewModel,
         clockViewFactory: ClockViewFactory,
         lifecycleOwner: LifecycleOwner,
-        hideSmartspace: (Boolean) -> Unit,
     ) {
         carouselView.setClockViewFactory(clockViewFactory)
         val singleClockHostView =
@@ -54,16 +53,7 @@
                         carouselView.setUpClockCarouselView(
                             clockSize = size,
                             clockIds = allClockIds,
-                            onClockSelected = { clockId ->
-                                viewModel.setSelectedClock(clockId)
-                                val hasCustomWeatherDataDisplay =
-                                    clockViewFactory
-                                        .getController(clockId)
-                                        .largeClock
-                                        .config
-                                        .hasCustomWeatherDataDisplay
-                                hideSmartspace(hasCustomWeatherDataDisplay)
-                            },
+                            onClockSelected = { clockId -> viewModel.setSelectedClock(clockId) },
                         )
                     }
                 }
diff --git a/src/com/android/customization/picker/preview/ui/section/PreviewWithClockCarouselSectionController.kt b/src/com/android/customization/picker/preview/ui/section/PreviewWithClockCarouselSectionController.kt
index 5ad01a8..ac06594 100644
--- a/src/com/android/customization/picker/preview/ui/section/PreviewWithClockCarouselSectionController.kt
+++ b/src/com/android/customization/picker/preview/ui/section/PreviewWithClockCarouselSectionController.kt
@@ -20,7 +20,6 @@
 import android.app.WallpaperManager
 import android.content.Context
 import android.graphics.Rect
-import android.os.Bundle
 import android.view.TouchDelegate
 import android.view.View
 import android.view.View.OnAttachStateChangeListener
@@ -39,7 +38,6 @@
 import com.android.customization.picker.clock.ui.view.ClockCarouselView
 import com.android.customization.picker.clock.ui.view.ClockViewFactory
 import com.android.customization.picker.clock.ui.viewmodel.ClockCarouselViewModel
-import com.android.systemui.shared.quickaffordance.shared.model.KeyguardPreviewConstants
 import com.android.wallpaper.R
 import com.android.wallpaper.model.CustomizationSectionController.CustomizationSectionNavigationController
 import com.android.wallpaper.model.WallpaperColorsViewModel
@@ -163,7 +161,6 @@
                                     viewModel = viewModel,
                                     clockViewFactory = clockViewFactory,
                                     lifecycleOwner = lifecycleOwner,
-                                    hideSmartspace = ::hideSmartspace,
                                 )
                                 if (onAttachStateChangeListener != null) {
                                     carouselView.carousel.removeOnAttachStateChangeListener(
@@ -182,16 +179,4 @@
 
         return view
     }
-
-    private fun hideSmartspace(hide: Boolean) {
-        previewViewBinding.sendMessage(
-            KeyguardPreviewConstants.MESSAGE_ID_HIDE_SMART_SPACE,
-            Bundle().apply {
-                putBoolean(
-                    KeyguardPreviewConstants.KEY_HIDE_SMART_SPACE,
-                    hide,
-                )
-            }
-        )
-    }
 }