Loading packages/SystemUI/src/com/android/systemui/dreams/smartspace/DreamSmartspaceController.kt +0 −3 Original line number Diff line number Diff line Loading @@ -145,9 +145,6 @@ class DreamSmartspaceController @Inject constructor( if (view !is View) { return null } view.setIsDreaming(true) return view } else { null Loading packages/SystemUI/src/com/android/systemui/smartspace/dagger/SmartspaceViewComponent.kt +3 −1 Original line number Diff line number Diff line Loading @@ -56,6 +56,8 @@ interface SmartspaceViewComponent { ): BcSmartspaceDataPlugin.SmartspaceView { val ssView = plugin.getView(parent) // Currently, this is only used to provide SmartspaceView on Dream surface. ssView.setIsDreaming(true) ssView.registerDataProvider(plugin) ssView.setIntentStarter(object : BcSmartspaceDataPlugin.IntentStarter { Loading packages/SystemUI/tests/src/com/android/systemui/smartspace/DreamSmartspaceControllerTest.kt +33 −45 Original line number Diff line number Diff line Loading @@ -36,17 +36,17 @@ import com.android.systemui.util.mockito.any import com.android.systemui.util.mockito.eq import com.android.systemui.util.mockito.withArgCaptor import com.google.common.truth.Truth.assertThat import java.util.Optional import java.util.concurrent.Executor import org.junit.Before import org.junit.Test import org.junit.runner.RunWith import org.mockito.Mock import org.mockito.Spy import org.mockito.Mockito import org.mockito.Mockito.`when` import org.mockito.Mockito.verify import org.mockito.Mockito.`when` import org.mockito.MockitoAnnotations import java.util.Optional import java.util.concurrent.Executor import org.mockito.Spy @SmallTest @RunWith(AndroidTestingRunner::class) Loading Loading @@ -87,6 +87,34 @@ class DreamSmartspaceControllerTest : SysuiTestCase() { private lateinit var controller: DreamSmartspaceController /** * A class which implements SmartspaceView and extends View. This is mocked to provide the right * object inheritance and interface implementation used in DreamSmartspaceController */ private class TestView(context: Context?) : View(context), SmartspaceView { override fun registerDataProvider(plugin: BcSmartspaceDataPlugin?) {} override fun setPrimaryTextColor(color: Int) {} override fun setIsDreaming(isDreaming: Boolean) {} override fun setDozeAmount(amount: Float) {} override fun setIntentStarter(intentStarter: BcSmartspaceDataPlugin.IntentStarter?) {} override fun setFalsingManager(falsingManager: FalsingManager?) {} override fun setDnd(image: Drawable?, description: String?) {} override fun setNextAlarm(image: Drawable?, description: String?) {} override fun setMediaTarget(target: SmartspaceTarget?) {} override fun getSelectedPage(): Int { return 0; } override fun getCurrentCardTopPadding(): Int { return 0; } } @Before fun setup() { MockitoAnnotations.initMocks(this) Loading Loading @@ -129,34 +157,6 @@ class DreamSmartspaceControllerTest : SysuiTestCase() { verify(session).close() } /** * A class which implements SmartspaceView and extends View. This is mocked to provide the right * object inheritance and interface implementation used in DreamSmartspaceController */ private class TestView(context: Context?) : View(context), SmartspaceView { override fun registerDataProvider(plugin: BcSmartspaceDataPlugin?) {} override fun setPrimaryTextColor(color: Int) {} override fun setIsDreaming(isDreaming: Boolean) {} override fun setDozeAmount(amount: Float) {} override fun setIntentStarter(intentStarter: BcSmartspaceDataPlugin.IntentStarter?) {} override fun setFalsingManager(falsingManager: FalsingManager?) {} override fun setDnd(image: Drawable?, description: String?) {} override fun setNextAlarm(image: Drawable?, description: String?) {} override fun setMediaTarget(target: SmartspaceTarget?) {} override fun getSelectedPage(): Int { return 0; } override fun getCurrentCardTopPadding(): Int { return 0; } } /** * Ensures session begins when a view is attached. */ Loading @@ -180,16 +180,4 @@ class DreamSmartspaceControllerTest : SysuiTestCase() { verify(session).close() } /** * Ensures setIsDreaming(true) is called when the view is built. */ @Test fun testSetIsDreamingTrueOnViewCreate() { `when`(precondition.conditionsMet()).thenReturn(true) controller.buildAndConnectView(Mockito.mock(ViewGroup::class.java)) verify(smartspaceView).setIsDreaming(true) } } Loading
packages/SystemUI/src/com/android/systemui/dreams/smartspace/DreamSmartspaceController.kt +0 −3 Original line number Diff line number Diff line Loading @@ -145,9 +145,6 @@ class DreamSmartspaceController @Inject constructor( if (view !is View) { return null } view.setIsDreaming(true) return view } else { null Loading
packages/SystemUI/src/com/android/systemui/smartspace/dagger/SmartspaceViewComponent.kt +3 −1 Original line number Diff line number Diff line Loading @@ -56,6 +56,8 @@ interface SmartspaceViewComponent { ): BcSmartspaceDataPlugin.SmartspaceView { val ssView = plugin.getView(parent) // Currently, this is only used to provide SmartspaceView on Dream surface. ssView.setIsDreaming(true) ssView.registerDataProvider(plugin) ssView.setIntentStarter(object : BcSmartspaceDataPlugin.IntentStarter { Loading
packages/SystemUI/tests/src/com/android/systemui/smartspace/DreamSmartspaceControllerTest.kt +33 −45 Original line number Diff line number Diff line Loading @@ -36,17 +36,17 @@ import com.android.systemui.util.mockito.any import com.android.systemui.util.mockito.eq import com.android.systemui.util.mockito.withArgCaptor import com.google.common.truth.Truth.assertThat import java.util.Optional import java.util.concurrent.Executor import org.junit.Before import org.junit.Test import org.junit.runner.RunWith import org.mockito.Mock import org.mockito.Spy import org.mockito.Mockito import org.mockito.Mockito.`when` import org.mockito.Mockito.verify import org.mockito.Mockito.`when` import org.mockito.MockitoAnnotations import java.util.Optional import java.util.concurrent.Executor import org.mockito.Spy @SmallTest @RunWith(AndroidTestingRunner::class) Loading Loading @@ -87,6 +87,34 @@ class DreamSmartspaceControllerTest : SysuiTestCase() { private lateinit var controller: DreamSmartspaceController /** * A class which implements SmartspaceView and extends View. This is mocked to provide the right * object inheritance and interface implementation used in DreamSmartspaceController */ private class TestView(context: Context?) : View(context), SmartspaceView { override fun registerDataProvider(plugin: BcSmartspaceDataPlugin?) {} override fun setPrimaryTextColor(color: Int) {} override fun setIsDreaming(isDreaming: Boolean) {} override fun setDozeAmount(amount: Float) {} override fun setIntentStarter(intentStarter: BcSmartspaceDataPlugin.IntentStarter?) {} override fun setFalsingManager(falsingManager: FalsingManager?) {} override fun setDnd(image: Drawable?, description: String?) {} override fun setNextAlarm(image: Drawable?, description: String?) {} override fun setMediaTarget(target: SmartspaceTarget?) {} override fun getSelectedPage(): Int { return 0; } override fun getCurrentCardTopPadding(): Int { return 0; } } @Before fun setup() { MockitoAnnotations.initMocks(this) Loading Loading @@ -129,34 +157,6 @@ class DreamSmartspaceControllerTest : SysuiTestCase() { verify(session).close() } /** * A class which implements SmartspaceView and extends View. This is mocked to provide the right * object inheritance and interface implementation used in DreamSmartspaceController */ private class TestView(context: Context?) : View(context), SmartspaceView { override fun registerDataProvider(plugin: BcSmartspaceDataPlugin?) {} override fun setPrimaryTextColor(color: Int) {} override fun setIsDreaming(isDreaming: Boolean) {} override fun setDozeAmount(amount: Float) {} override fun setIntentStarter(intentStarter: BcSmartspaceDataPlugin.IntentStarter?) {} override fun setFalsingManager(falsingManager: FalsingManager?) {} override fun setDnd(image: Drawable?, description: String?) {} override fun setNextAlarm(image: Drawable?, description: String?) {} override fun setMediaTarget(target: SmartspaceTarget?) {} override fun getSelectedPage(): Int { return 0; } override fun getCurrentCardTopPadding(): Int { return 0; } } /** * Ensures session begins when a view is attached. */ Loading @@ -180,16 +180,4 @@ class DreamSmartspaceControllerTest : SysuiTestCase() { verify(session).close() } /** * Ensures setIsDreaming(true) is called when the view is built. */ @Test fun testSetIsDreamingTrueOnViewCreate() { `when`(precondition.conditionsMet()).thenReturn(true) controller.buildAndConnectView(Mockito.mock(ViewGroup::class.java)) verify(smartspaceView).setIsDreaming(true) } }