Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 801f10a1 authored by Xiaowen Lei's avatar Xiaowen Lei Committed by Automerger Merge Worker
Browse files

Merge "Add logging for Smart Space on Dream surface." into tm-dev am: 840168a5

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17817085



Change-Id: I9c741ef0c9a9c9e47d097162dfdb53a4f8a3818e
Ignore-AOSP-First: this is an automerge
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 262e4f67 840168a5
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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
         */
+7 −4
Original line number Diff line number Diff line
@@ -98,6 +98,7 @@ class DreamsSmartspaceController @Inject constructor(
            view.setPrimaryTextColor(Color.WHITE)
            smartspaceViews.add(view)
            connectSession()
            view.setDozeAmount(0f)
        }

        override fun onViewDetachedFromWindow(v: View) {
@@ -127,6 +128,7 @@ class DreamsSmartspaceController @Inject constructor(
        }

        val view = buildView(parent)

        connectSession()

        return view
@@ -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
        }
+3 −0
Original line number Diff line number Diff line
@@ -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?) {}
@@ -173,6 +175,7 @@ class DreamSmartspaceControllerTest : SysuiTestCase() {
        stateChangeListener.onViewAttachedToWindow(mockView)

        verify(smartspaceManager).createSmartspaceSession(any())
        verify(mockView).setDozeAmount(0f)

        stateChangeListener.onViewDetachedFromWindow(mockView)

+3 −0
Original line number Diff line number Diff line
@@ -544,6 +544,9 @@ class LockscreenSmartspaceControllerTest : SysuiTestCase() {
            override fun setPrimaryTextColor(color: Int) {
            }

            override fun setIsDreaming(isDreaming: Boolean) {
            }

            override fun setDozeAmount(amount: Float) {
            }