Merge "Add logging for Smart Space on Dream surface." into tm-dev
This commit is contained in:
@@ -93,6 +93,12 @@ public interface BcSmartspaceDataPlugin extends Plugin {
|
|||||||
*/
|
*/
|
||||||
void setPrimaryTextColor(int color);
|
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
|
* Range [0.0 - 1.0] when transitioning from Lockscreen to/from AOD
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -98,6 +98,7 @@ class DreamsSmartspaceController @Inject constructor(
|
|||||||
view.setPrimaryTextColor(Color.WHITE)
|
view.setPrimaryTextColor(Color.WHITE)
|
||||||
smartspaceViews.add(view)
|
smartspaceViews.add(view)
|
||||||
connectSession()
|
connectSession()
|
||||||
|
view.setDozeAmount(0f)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onViewDetachedFromWindow(v: View) {
|
override fun onViewDetachedFromWindow(v: View) {
|
||||||
@@ -127,6 +128,7 @@ class DreamsSmartspaceController @Inject constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
val view = buildView(parent)
|
val view = buildView(parent)
|
||||||
|
|
||||||
connectSession()
|
connectSession()
|
||||||
|
|
||||||
return view
|
return view
|
||||||
@@ -136,12 +138,13 @@ class DreamsSmartspaceController @Inject constructor(
|
|||||||
return if (plugin != null) {
|
return if (plugin != null) {
|
||||||
var view = smartspaceViewComponentFactory.create(parent, plugin, stateChangeListener)
|
var view = smartspaceViewComponentFactory.create(parent, plugin, stateChangeListener)
|
||||||
.getView()
|
.getView()
|
||||||
|
if (view !is View) {
|
||||||
if (view is View) {
|
return null
|
||||||
return view
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return null
|
view.setIsDreaming(true)
|
||||||
|
|
||||||
|
return view
|
||||||
} else {
|
} else {
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -136,6 +136,8 @@ class DreamSmartspaceControllerTest : SysuiTestCase() {
|
|||||||
|
|
||||||
override fun setPrimaryTextColor(color: Int) {}
|
override fun setPrimaryTextColor(color: Int) {}
|
||||||
|
|
||||||
|
override fun setIsDreaming(isDreaming: Boolean) {}
|
||||||
|
|
||||||
override fun setDozeAmount(amount: Float) {}
|
override fun setDozeAmount(amount: Float) {}
|
||||||
|
|
||||||
override fun setIntentStarter(intentStarter: BcSmartspaceDataPlugin.IntentStarter?) {}
|
override fun setIntentStarter(intentStarter: BcSmartspaceDataPlugin.IntentStarter?) {}
|
||||||
@@ -173,6 +175,7 @@ class DreamSmartspaceControllerTest : SysuiTestCase() {
|
|||||||
stateChangeListener.onViewAttachedToWindow(mockView)
|
stateChangeListener.onViewAttachedToWindow(mockView)
|
||||||
|
|
||||||
verify(smartspaceManager).createSmartspaceSession(any())
|
verify(smartspaceManager).createSmartspaceSession(any())
|
||||||
|
verify(mockView).setDozeAmount(0f)
|
||||||
|
|
||||||
stateChangeListener.onViewDetachedFromWindow(mockView)
|
stateChangeListener.onViewDetachedFromWindow(mockView)
|
||||||
|
|
||||||
|
|||||||
@@ -544,6 +544,9 @@ class LockscreenSmartspaceControllerTest : SysuiTestCase() {
|
|||||||
override fun setPrimaryTextColor(color: Int) {
|
override fun setPrimaryTextColor(color: Int) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun setIsDreaming(isDreaming: Boolean) {
|
||||||
|
}
|
||||||
|
|
||||||
override fun setDozeAmount(amount: Float) {
|
override fun setDozeAmount(amount: Float) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user