Loading packages/SystemUI/plugin/bcsmartspace/src/com/android/systemui/plugins/BcSmartspaceDataPlugin.java +6 −0 Original line number Diff line number Diff line Loading @@ -93,6 +93,12 @@ public interface BcSmartspaceDataPlugin extends Plugin { */ 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); /** * Range [0.0 - 1.0] when transitioning from Lockscreen to/from AOD */ Loading packages/SystemUI/src/com/android/systemui/dreams/smartspace/DreamsSmartspaceController.kt +7 −4 Original line number Diff line number Diff line Loading @@ -98,6 +98,7 @@ class DreamsSmartspaceController @Inject constructor( view.setPrimaryTextColor(Color.WHITE) smartspaceViews.add(view) connectSession() view.setDozeAmount(0f) } override fun onViewDetachedFromWindow(v: View) { Loading Loading @@ -127,6 +128,7 @@ class DreamsSmartspaceController @Inject constructor( } val view = buildView(parent) connectSession() return view Loading @@ -136,12 +138,13 @@ class DreamsSmartspaceController @Inject constructor( return if (plugin != null) { var view = smartspaceViewComponentFactory.create(parent, plugin, stateChangeListener) .getView() if (view is View) { return view if (view !is View) { return null } return null view.setIsDreaming(true) return view } else { null } Loading packages/SystemUI/tests/src/com/android/systemui/smartspace/DreamSmartspaceControllerTest.kt +3 −0 Original line number Diff line number Diff line Loading @@ -136,6 +136,8 @@ class DreamSmartspaceControllerTest : SysuiTestCase() { override fun setPrimaryTextColor(color: Int) {} override fun setIsDreaming(isDreaming: Boolean) {} override fun setDozeAmount(amount: Float) {} override fun setIntentStarter(intentStarter: BcSmartspaceDataPlugin.IntentStarter?) {} Loading Loading @@ -173,6 +175,7 @@ class DreamSmartspaceControllerTest : SysuiTestCase() { stateChangeListener.onViewAttachedToWindow(mockView) verify(smartspaceManager).createSmartspaceSession(any()) verify(mockView).setDozeAmount(0f) stateChangeListener.onViewDetachedFromWindow(mockView) Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/lockscreen/LockscreenSmartspaceControllerTest.kt +3 −0 Original line number Diff line number Diff line Loading @@ -544,6 +544,9 @@ class LockscreenSmartspaceControllerTest : SysuiTestCase() { override fun setPrimaryTextColor(color: Int) { } override fun setIsDreaming(isDreaming: Boolean) { } override fun setDozeAmount(amount: Float) { } Loading Loading
packages/SystemUI/plugin/bcsmartspace/src/com/android/systemui/plugins/BcSmartspaceDataPlugin.java +6 −0 Original line number Diff line number Diff line Loading @@ -93,6 +93,12 @@ public interface BcSmartspaceDataPlugin extends Plugin { */ 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); /** * Range [0.0 - 1.0] when transitioning from Lockscreen to/from AOD */ Loading
packages/SystemUI/src/com/android/systemui/dreams/smartspace/DreamsSmartspaceController.kt +7 −4 Original line number Diff line number Diff line Loading @@ -98,6 +98,7 @@ class DreamsSmartspaceController @Inject constructor( view.setPrimaryTextColor(Color.WHITE) smartspaceViews.add(view) connectSession() view.setDozeAmount(0f) } override fun onViewDetachedFromWindow(v: View) { Loading Loading @@ -127,6 +128,7 @@ class DreamsSmartspaceController @Inject constructor( } val view = buildView(parent) connectSession() return view Loading @@ -136,12 +138,13 @@ class DreamsSmartspaceController @Inject constructor( return if (plugin != null) { var view = smartspaceViewComponentFactory.create(parent, plugin, stateChangeListener) .getView() if (view is View) { return view if (view !is View) { return null } return null view.setIsDreaming(true) return view } else { null } Loading
packages/SystemUI/tests/src/com/android/systemui/smartspace/DreamSmartspaceControllerTest.kt +3 −0 Original line number Diff line number Diff line Loading @@ -136,6 +136,8 @@ class DreamSmartspaceControllerTest : SysuiTestCase() { override fun setPrimaryTextColor(color: Int) {} override fun setIsDreaming(isDreaming: Boolean) {} override fun setDozeAmount(amount: Float) {} override fun setIntentStarter(intentStarter: BcSmartspaceDataPlugin.IntentStarter?) {} Loading Loading @@ -173,6 +175,7 @@ class DreamSmartspaceControllerTest : SysuiTestCase() { stateChangeListener.onViewAttachedToWindow(mockView) verify(smartspaceManager).createSmartspaceSession(any()) verify(mockView).setDozeAmount(0f) stateChangeListener.onViewDetachedFromWindow(mockView) Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/lockscreen/LockscreenSmartspaceControllerTest.kt +3 −0 Original line number Diff line number Diff line Loading @@ -544,6 +544,9 @@ class LockscreenSmartspaceControllerTest : SysuiTestCase() { override fun setPrimaryTextColor(color: Int) { } override fun setIsDreaming(isDreaming: Boolean) { } override fun setDozeAmount(amount: Float) { } Loading