Deprecate `setIsDreaming` in favor of `setUiSurface`.
Bug: 266139726
Test: manual
Test: DreamSmartspaceControllerTest
Test: LockscreenSmartspaceControllerTest
Change-Id: I35e2b0a1d8b3f203371dfb23b9a3c0d7590ce4d5
diff --git a/packages/SystemUI/plugin/bcsmartspace/src/com/android/systemui/plugins/BcSmartspaceDataPlugin.java b/packages/SystemUI/plugin/bcsmartspace/src/com/android/systemui/plugins/BcSmartspaceDataPlugin.java
index e0cc8f4..e0d0184 100644
--- a/packages/SystemUI/plugin/bcsmartspace/src/com/android/systemui/plugins/BcSmartspaceDataPlugin.java
+++ b/packages/SystemUI/plugin/bcsmartspace/src/com/android/systemui/plugins/BcSmartspaceDataPlugin.java
@@ -118,12 +118,6 @@
void setPrimaryTextColor(int color);
/**
- * When the view is displayed on Dream, set the flag to true, immediately after the view is
- * created.
- */
- void setIsDreaming(boolean isDreaming);
-
- /**
* Set the UI surface for the cards. Should be called immediately after the view is created.
*/
void setUiSurface(String uiSurface);
diff --git a/packages/SystemUI/src/com/android/systemui/smartspace/dagger/SmartspaceViewComponent.kt b/packages/SystemUI/src/com/android/systemui/smartspace/dagger/SmartspaceViewComponent.kt
index 236ba1f..5736a5c 100644
--- a/packages/SystemUI/src/com/android/systemui/smartspace/dagger/SmartspaceViewComponent.kt
+++ b/packages/SystemUI/src/com/android/systemui/smartspace/dagger/SmartspaceViewComponent.kt
@@ -21,6 +21,7 @@
import android.view.ViewGroup
import com.android.systemui.plugins.ActivityStarter
import com.android.systemui.plugins.BcSmartspaceDataPlugin
+import com.android.systemui.plugins.BcSmartspaceDataPlugin.UI_SURFACE_DREAM
import com.android.systemui.plugins.FalsingManager
import com.android.systemui.smartspace.dagger.SmartspaceViewComponent.SmartspaceViewModule.PLUGIN
import dagger.BindsInstance
@@ -57,7 +58,7 @@
BcSmartspaceDataPlugin.SmartspaceView {
val ssView = plugin.getView(parent)
// Currently, this is only used to provide SmartspaceView on Dream surface.
- ssView.setIsDreaming(true)
+ ssView.setUiSurface(UI_SURFACE_DREAM)
ssView.registerDataProvider(plugin)
ssView.setIntentStarter(object : BcSmartspaceDataPlugin.IntentStarter {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/smartspace/DreamSmartspaceControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/smartspace/DreamSmartspaceControllerTest.kt
index c5432c5..a280510 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/smartspace/DreamSmartspaceControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/smartspace/DreamSmartspaceControllerTest.kt
@@ -99,8 +99,6 @@
override fun setPrimaryTextColor(color: Int) {}
- override fun setIsDreaming(isDreaming: Boolean) {}
-
override fun setUiSurface(uiSurface: String) {}
override fun setDozeAmount(amount: Float) {}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/lockscreen/LockscreenSmartspaceControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/lockscreen/LockscreenSmartspaceControllerTest.kt
index d6225c6..7fdcfb2 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/lockscreen/LockscreenSmartspaceControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/lockscreen/LockscreenSmartspaceControllerTest.kt
@@ -780,9 +780,6 @@
override fun setPrimaryTextColor(color: Int) {
}
- override fun setIsDreaming(isDreaming: Boolean) {
- }
-
override fun setUiSurface(uiSurface: String) {
}
@@ -811,9 +808,6 @@
override fun setPrimaryTextColor(color: Int) {
}
- override fun setIsDreaming(isDreaming: Boolean) {
- }
-
override fun setUiSurface(uiSurface: String) {
}
@@ -838,9 +832,6 @@
override fun setPrimaryTextColor(color: Int) {
}
- override fun setIsDreaming(isDreaming: Boolean) {
- }
-
override fun setUiSurface(uiSurface: String) {
}