Loading packages/SystemUI/src/com/android/systemui/statusbar/lockscreen/LockscreenSmartspaceController.kt +1 −2 Original line number Diff line number Diff line Loading @@ -24,7 +24,6 @@ import android.app.smartspace.SmartspaceTarget import android.content.ContentResolver import android.content.Context import android.content.Intent import android.content.pm.UserInfo import android.database.ContentObserver import android.net.Uri import android.os.Handler Loading Loading @@ -203,7 +202,7 @@ class LockscreenSmartspaceController @Inject constructor( } private fun connectSession() { if (plugin == null || session != null) { if (plugin == null || session != null || smartspaceViews.isEmpty()) { return } Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/lockscreen/LockscreenSmartspaceControllerTest.kt +14 −0 Original line number Diff line number Diff line Loading @@ -448,6 +448,20 @@ class LockscreenSmartspaceControllerTest : SysuiTestCase() { verify(smartspaceView2).registerDataProvider(plugin) } @Test fun testConnectAttemptBeforeInitializationShouldNotCreateSession() { // GIVEN an uninitalized smartspaceView // WHEN the device is provisioned `when`(deviceProvisionedController.isDeviceProvisioned()).thenReturn(true) `when`(deviceProvisionedController.isCurrentUserSetup()).thenReturn(true) deviceProvisionedListener.onDeviceProvisionedChanged() // THEN no calls to createSmartspaceSession should occur verify(smartspaceManager, never()).createSmartspaceSession(any()) // THEN no listeners should be registered verify(configurationController, never()).addCallback(any()) } private fun connectSession() { val view = controller.buildAndConnectView(fakeParent) smartspaceView = view as SmartspaceView Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/lockscreen/LockscreenSmartspaceController.kt +1 −2 Original line number Diff line number Diff line Loading @@ -24,7 +24,6 @@ import android.app.smartspace.SmartspaceTarget import android.content.ContentResolver import android.content.Context import android.content.Intent import android.content.pm.UserInfo import android.database.ContentObserver import android.net.Uri import android.os.Handler Loading Loading @@ -203,7 +202,7 @@ class LockscreenSmartspaceController @Inject constructor( } private fun connectSession() { if (plugin == null || session != null) { if (plugin == null || session != null || smartspaceViews.isEmpty()) { return } Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/lockscreen/LockscreenSmartspaceControllerTest.kt +14 −0 Original line number Diff line number Diff line Loading @@ -448,6 +448,20 @@ class LockscreenSmartspaceControllerTest : SysuiTestCase() { verify(smartspaceView2).registerDataProvider(plugin) } @Test fun testConnectAttemptBeforeInitializationShouldNotCreateSession() { // GIVEN an uninitalized smartspaceView // WHEN the device is provisioned `when`(deviceProvisionedController.isDeviceProvisioned()).thenReturn(true) `when`(deviceProvisionedController.isCurrentUserSetup()).thenReturn(true) deviceProvisionedListener.onDeviceProvisionedChanged() // THEN no calls to createSmartspaceSession should occur verify(smartspaceManager, never()).createSmartspaceSession(any()) // THEN no listeners should be registered verify(configurationController, never()).addCallback(any()) } private fun connectSession() { val view = controller.buildAndConnectView(fakeParent) smartspaceView = view as SmartspaceView Loading