Loading packages/SystemUI/plugin/bcsmartspace/src/com/android/systemui/plugins/BcSmartspaceDataPlugin.java +10 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,11 @@ import java.util.List; */ @ProvidesInterface(action = BcSmartspaceDataPlugin.ACTION, version = BcSmartspaceDataPlugin.VERSION) public interface BcSmartspaceDataPlugin extends Plugin { String UI_SURFACE_LOCK_SCREEN_AOD = "lockscreen"; String UI_SURFACE_HOME_SCREEN = "home"; String UI_SURFACE_MEDIA = "media_data_manager"; String UI_SURFACE_DREAM = "dream"; String ACTION = "com.android.systemui.action.PLUGIN_BC_SMARTSPACE_DATA"; int VERSION = 1; String TAG = "BcSmartspaceDataPlugin"; Loading Loading @@ -99,6 +104,11 @@ public interface BcSmartspaceDataPlugin extends Plugin { */ void setIsDreaming(boolean isDreaming); /** * Set the UI surface for the cards. Should be called immediately after the view is created. */ void setUiSurface(String uiSurface); /** * Range [0.0 - 1.0] when transitioning from Lockscreen to/from AOD */ Loading packages/SystemUI/src/com/android/systemui/statusbar/lockscreen/LockscreenSmartspaceController.kt +5 −2 Original line number Diff line number Diff line Loading @@ -238,6 +238,7 @@ class LockscreenSmartspaceController @Inject constructor( } val ssView = plugin.getView(parent) ssView.setUiSurface(BcSmartspaceDataPlugin.UI_SURFACE_LOCK_SCREEN_AOD) ssView.registerDataProvider(plugin) ssView.setIntentStarter(object : BcSmartspaceDataPlugin.IntentStarter { Loading Loading @@ -281,8 +282,10 @@ class LockscreenSmartspaceController @Inject constructor( } val newSession = smartspaceManager.createSmartspaceSession( SmartspaceConfig.Builder(context, "lockscreen").build()) Log.d(TAG, "Starting smartspace session for lockscreen") SmartspaceConfig.Builder( context, BcSmartspaceDataPlugin.UI_SURFACE_LOCK_SCREEN_AOD).build()) Log.d(TAG, "Starting smartspace session for " + BcSmartspaceDataPlugin.UI_SURFACE_LOCK_SCREEN_AOD) newSession.addOnTargetsAvailableListener(uiExecutor, sessionListener) this.session = newSession Loading packages/SystemUI/tests/src/com/android/systemui/smartspace/DreamSmartspaceControllerTest.kt +2 −0 Original line number Diff line number Diff line Loading @@ -98,6 +98,8 @@ class DreamSmartspaceControllerTest : SysuiTestCase() { override fun setIsDreaming(isDreaming: Boolean) {} override fun setUiSurface(uiSurface: String) {} override fun setDozeAmount(amount: Float) {} override fun setIntentStarter(intentStarter: BcSmartspaceDataPlugin.IntentStarter?) {} Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/lockscreen/LockscreenSmartspaceControllerTest.kt +8 −3 Original line number Diff line number Diff line Loading @@ -55,21 +55,21 @@ import com.android.systemui.util.mockito.capture import com.android.systemui.util.mockito.eq import com.android.systemui.util.settings.SecureSettings import com.android.systemui.util.time.FakeSystemClock import java.util.Optional import java.util.concurrent.Executor import org.junit.Before import org.junit.Test import org.mockito.ArgumentCaptor import org.mockito.Captor import org.mockito.Mock import org.mockito.Mockito.`when` import org.mockito.Mockito.anyInt import org.mockito.Mockito.clearInvocations import org.mockito.Mockito.mock import org.mockito.Mockito.never import org.mockito.Mockito.spy import org.mockito.Mockito.verify import org.mockito.Mockito.`when` import org.mockito.MockitoAnnotations import java.util.Optional import java.util.concurrent.Executor @SmallTest class LockscreenSmartspaceControllerTest : SysuiTestCase() { Loading Loading @@ -518,6 +518,7 @@ class LockscreenSmartspaceControllerTest : SysuiTestCase() { // THEN the existing session is reused and views are registered verify(smartspaceManager, never()).createSmartspaceSession(any()) verify(smartspaceView2).setUiSurface(BcSmartspaceDataPlugin.UI_SURFACE_LOCK_SCREEN_AOD) verify(smartspaceView2).registerDataProvider(plugin) } Loading Loading @@ -554,6 +555,7 @@ class LockscreenSmartspaceControllerTest : SysuiTestCase() { controller.stateChangeListener.onViewAttachedToWindow(view) verify(smartspaceView).setUiSurface(BcSmartspaceDataPlugin.UI_SURFACE_LOCK_SCREEN_AOD) verify(smartspaceView).registerDataProvider(plugin) verify(smartspaceSession) .addOnTargetsAvailableListener(any(), capture(sessionListenerCaptor)) Loading Loading @@ -642,6 +644,9 @@ class LockscreenSmartspaceControllerTest : SysuiTestCase() { override fun setIsDreaming(isDreaming: Boolean) { } override fun setUiSurface(uiSurface: String) { } override fun setDozeAmount(amount: Float) { } Loading Loading
packages/SystemUI/plugin/bcsmartspace/src/com/android/systemui/plugins/BcSmartspaceDataPlugin.java +10 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,11 @@ import java.util.List; */ @ProvidesInterface(action = BcSmartspaceDataPlugin.ACTION, version = BcSmartspaceDataPlugin.VERSION) public interface BcSmartspaceDataPlugin extends Plugin { String UI_SURFACE_LOCK_SCREEN_AOD = "lockscreen"; String UI_SURFACE_HOME_SCREEN = "home"; String UI_SURFACE_MEDIA = "media_data_manager"; String UI_SURFACE_DREAM = "dream"; String ACTION = "com.android.systemui.action.PLUGIN_BC_SMARTSPACE_DATA"; int VERSION = 1; String TAG = "BcSmartspaceDataPlugin"; Loading Loading @@ -99,6 +104,11 @@ public interface BcSmartspaceDataPlugin extends Plugin { */ void setIsDreaming(boolean isDreaming); /** * Set the UI surface for the cards. Should be called immediately after the view is created. */ void setUiSurface(String uiSurface); /** * Range [0.0 - 1.0] when transitioning from Lockscreen to/from AOD */ Loading
packages/SystemUI/src/com/android/systemui/statusbar/lockscreen/LockscreenSmartspaceController.kt +5 −2 Original line number Diff line number Diff line Loading @@ -238,6 +238,7 @@ class LockscreenSmartspaceController @Inject constructor( } val ssView = plugin.getView(parent) ssView.setUiSurface(BcSmartspaceDataPlugin.UI_SURFACE_LOCK_SCREEN_AOD) ssView.registerDataProvider(plugin) ssView.setIntentStarter(object : BcSmartspaceDataPlugin.IntentStarter { Loading Loading @@ -281,8 +282,10 @@ class LockscreenSmartspaceController @Inject constructor( } val newSession = smartspaceManager.createSmartspaceSession( SmartspaceConfig.Builder(context, "lockscreen").build()) Log.d(TAG, "Starting smartspace session for lockscreen") SmartspaceConfig.Builder( context, BcSmartspaceDataPlugin.UI_SURFACE_LOCK_SCREEN_AOD).build()) Log.d(TAG, "Starting smartspace session for " + BcSmartspaceDataPlugin.UI_SURFACE_LOCK_SCREEN_AOD) newSession.addOnTargetsAvailableListener(uiExecutor, sessionListener) this.session = newSession Loading
packages/SystemUI/tests/src/com/android/systemui/smartspace/DreamSmartspaceControllerTest.kt +2 −0 Original line number Diff line number Diff line Loading @@ -98,6 +98,8 @@ class DreamSmartspaceControllerTest : SysuiTestCase() { override fun setIsDreaming(isDreaming: Boolean) {} override fun setUiSurface(uiSurface: String) {} override fun setDozeAmount(amount: Float) {} override fun setIntentStarter(intentStarter: BcSmartspaceDataPlugin.IntentStarter?) {} Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/lockscreen/LockscreenSmartspaceControllerTest.kt +8 −3 Original line number Diff line number Diff line Loading @@ -55,21 +55,21 @@ import com.android.systemui.util.mockito.capture import com.android.systemui.util.mockito.eq import com.android.systemui.util.settings.SecureSettings import com.android.systemui.util.time.FakeSystemClock import java.util.Optional import java.util.concurrent.Executor import org.junit.Before import org.junit.Test import org.mockito.ArgumentCaptor import org.mockito.Captor import org.mockito.Mock import org.mockito.Mockito.`when` import org.mockito.Mockito.anyInt import org.mockito.Mockito.clearInvocations import org.mockito.Mockito.mock import org.mockito.Mockito.never import org.mockito.Mockito.spy import org.mockito.Mockito.verify import org.mockito.Mockito.`when` import org.mockito.MockitoAnnotations import java.util.Optional import java.util.concurrent.Executor @SmallTest class LockscreenSmartspaceControllerTest : SysuiTestCase() { Loading Loading @@ -518,6 +518,7 @@ class LockscreenSmartspaceControllerTest : SysuiTestCase() { // THEN the existing session is reused and views are registered verify(smartspaceManager, never()).createSmartspaceSession(any()) verify(smartspaceView2).setUiSurface(BcSmartspaceDataPlugin.UI_SURFACE_LOCK_SCREEN_AOD) verify(smartspaceView2).registerDataProvider(plugin) } Loading Loading @@ -554,6 +555,7 @@ class LockscreenSmartspaceControllerTest : SysuiTestCase() { controller.stateChangeListener.onViewAttachedToWindow(view) verify(smartspaceView).setUiSurface(BcSmartspaceDataPlugin.UI_SURFACE_LOCK_SCREEN_AOD) verify(smartspaceView).registerDataProvider(plugin) verify(smartspaceSession) .addOnTargetsAvailableListener(any(), capture(sessionListenerCaptor)) Loading Loading @@ -642,6 +644,9 @@ class LockscreenSmartspaceControllerTest : SysuiTestCase() { override fun setIsDreaming(isDreaming: Boolean) { } override fun setUiSurface(uiSurface: String) { } override fun setDozeAmount(amount: Float) { } Loading