Loading packages/SystemUI/multivalentTests/src/com/android/systemui/smartspace/CommunalSmartspaceControllerTest.kt +1 −3 Original line number Diff line number Diff line Loading @@ -94,8 +94,6 @@ class CommunalSmartspaceControllerTest : SysuiTestCase() { override fun setDozeAmount(amount: Float) {} override fun setIntentStarter(intentStarter: BcSmartspaceDataPlugin.IntentStarter?) {} override fun setFalsingManager(falsingManager: FalsingManager?) {} override fun setDnd(image: Drawable?, description: String?) {} Loading Loading @@ -200,6 +198,6 @@ class CommunalSmartspaceControllerTest : SysuiTestCase() { // And the listener receives an empty list of targets and unregisters the notifier verify(plugin).onTargetsAvailable(emptyList()) verify(plugin).registerSmartspaceEventNotifier(null) verify(plugin).setEventDispatcher(null) } } packages/SystemUI/multivalentTests/src/com/android/systemui/smartspace/DreamSmartspaceControllerTest.kt +1 −3 Original line number Diff line number Diff line Loading @@ -115,8 +115,6 @@ class DreamSmartspaceControllerTest : SysuiTestCase() { override fun setDozeAmount(amount: Float) {} override fun setIntentStarter(intentStarter: BcSmartspaceDataPlugin.IntentStarter?) {} override fun setFalsingManager(falsingManager: FalsingManager?) {} override fun setDnd(image: Drawable?, description: String?) {} Loading Loading @@ -299,6 +297,6 @@ class DreamSmartspaceControllerTest : SysuiTestCase() { // And the listener receives an empty list of targets and unregisters the notifier verify(weatherPlugin).onTargetsAvailable(emptyList()) verify(weatherPlugin).registerSmartspaceEventNotifier(null) verify(weatherPlugin).setEventDispatcher(null) } } packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/lockscreen/LockscreenSmartspaceControllerTest.kt +4 −16 Original line number Diff line number Diff line Loading @@ -273,7 +273,7 @@ class LockscreenSmartspaceControllerTest : SysuiTestCase() { // THEN the session is created verify(smartspaceManager).createSmartspaceSession(any()) // THEN an event notifier is registered verify(plugin).registerSmartspaceEventNotifier(any()) verify(plugin).setEventDispatcher(any()) } @Test Loading Loading @@ -320,10 +320,10 @@ class LockscreenSmartspaceControllerTest : SysuiTestCase() { // THEN the listener receives an empty list of targets and unregisters the notifier verify(plugin).onTargetsAvailable(emptyList()) verify(plugin).registerSmartspaceEventNotifier(null) verify(plugin).setEventDispatcher(null) verify(weatherPlugin).onTargetsAvailable(emptyList()) verify(weatherPlugin).registerSmartspaceEventNotifier(null) verify(datePlugin).registerSmartspaceEventNotifier(null) verify(weatherPlugin).setEventDispatcher(null) verify(datePlugin).setEventDispatcher(null) } @Test Loading Loading @@ -977,10 +977,6 @@ class LockscreenSmartspaceControllerTest : SysuiTestCase() { override fun setDozeAmount(amount: Float) {} override fun setIntentStarter( intentStarter: BcSmartspaceDataPlugin.IntentStarter? ) {} override fun setFalsingManager(falsingManager: FalsingManager?) {} override fun setDnd(image: Drawable?, description: String?) {} Loading Loading @@ -1008,10 +1004,6 @@ class LockscreenSmartspaceControllerTest : SysuiTestCase() { override fun setDozeAmount(amount: Float) {} override fun setIntentStarter( intentStarter: BcSmartspaceDataPlugin.IntentStarter? ) {} override fun setFalsingManager(falsingManager: FalsingManager?) {} } ) Loading @@ -1038,10 +1030,6 @@ class LockscreenSmartspaceControllerTest : SysuiTestCase() { override fun setKeyguardBypassEnabled(enabled: Boolean) {} override fun setIntentStarter( intentStarter: BcSmartspaceDataPlugin.IntentStarter? ) {} override fun setFalsingManager(falsingManager: FalsingManager?) {} override fun setDnd(image: Drawable?, description: String?) {} Loading packages/SystemUI/plugin/bcsmartspace/src/com/android/systemui/plugins/BcSmartspaceDataPlugin.java +22 −19 Original line number Diff line number Diff line Loading @@ -61,21 +61,17 @@ public interface BcSmartspaceDataPlugin extends Plugin { throw new UnsupportedOperationException("Not implemented by " + getClass()); } /** Register a SmartspaceEventNotifier. */ default void registerSmartspaceEventNotifier(SmartspaceEventNotifier notifier) { throw new UnsupportedOperationException("Not implemented by " + getClass()); } /** Sets the event dispatcher for smart space targets. */ void setEventDispatcher(SmartspaceEventDispatcher eventDispatcher); /** Push a SmartspaceTargetEvent to the SmartspaceEventNotifier. */ default void notifySmartspaceEvent(SmartspaceTargetEvent event) { throw new UnsupportedOperationException("Not implemented by " + getClass()); } /** * Overrides how Intents/PendingIntents gets launched. Mostly to support auth from * the lockscreen. */ void setIntentStarter(IntentStarter intentStarter); /** Allows for notifying the SmartspaceSession of SmartspaceTargetEvents. */ interface SmartspaceEventNotifier { /** Pushes a given SmartspaceTargetEvent to the SmartspaceSession. */ void notifySmartspaceEvent(SmartspaceTargetEvent event); } /** Returns the smartspace event notifier */ SmartspaceEventNotifier getEventNotifier(); /** * Create a view to be shown within the parent. Do not add the view, as the parent Loading Loading @@ -171,12 +167,6 @@ public interface BcSmartspaceDataPlugin extends Plugin { */ default void setKeyguardBypassEnabled(boolean enabled) {} /** * Overrides how Intents/PendingIntents gets launched. Mostly to support auth from * the lockscreen. */ void setIntentStarter(IntentStarter intentStarter); /** * When on the lockscreen, use the FalsingManager to help detect errant touches */ Loading Loading @@ -259,6 +249,19 @@ public interface BcSmartspaceDataPlugin extends Plugin { void startPendingIntent(View v, PendingIntent pi, boolean showOnLockscreen); } /** SmartspaceEventDispatcher which also controls controlling intent launching behavior */ interface SmartspaceEventNotifier extends SmartspaceEventDispatcher { /** The intent starter for controlling activity launches */ @Nullable IntentStarter getIntentStarter(); } /** Allows for notifying the SmartspaceSession of SmartspaceTargetEvents. */ interface SmartspaceEventDispatcher { /** Pushes a given SmartspaceTargetEvent to the SmartspaceSession. */ void notifySmartspaceEvent(SmartspaceTargetEvent event); } /** Interface for delegating time updates */ interface TimeChangedDelegate { /** Register the callback to be called when time is updated **/ Loading packages/SystemUI/src/com/android/systemui/communal/smartspace/CommunalSmartspaceController.kt +2 −2 Original line number Diff line number Diff line Loading @@ -130,7 +130,7 @@ constructor( newSession?.addOnTargetsAvailableListener(uiExecutor, sessionListener) this.session = newSession plugin?.registerSmartspaceEventNotifier { e -> session?.notifySmartspaceEvent(e) } plugin.setEventDispatcher { e -> session?.notifySmartspaceEvent(e) } reloadSmartspace() } Loading @@ -152,7 +152,7 @@ constructor( session = null plugin?.registerSmartspaceEventNotifier(null) plugin?.setEventDispatcher(null) plugin?.onTargetsAvailable(emptyList()) Log.d(TAG, "Ending smartspace session for communal") } Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/smartspace/CommunalSmartspaceControllerTest.kt +1 −3 Original line number Diff line number Diff line Loading @@ -94,8 +94,6 @@ class CommunalSmartspaceControllerTest : SysuiTestCase() { override fun setDozeAmount(amount: Float) {} override fun setIntentStarter(intentStarter: BcSmartspaceDataPlugin.IntentStarter?) {} override fun setFalsingManager(falsingManager: FalsingManager?) {} override fun setDnd(image: Drawable?, description: String?) {} Loading Loading @@ -200,6 +198,6 @@ class CommunalSmartspaceControllerTest : SysuiTestCase() { // And the listener receives an empty list of targets and unregisters the notifier verify(plugin).onTargetsAvailable(emptyList()) verify(plugin).registerSmartspaceEventNotifier(null) verify(plugin).setEventDispatcher(null) } }
packages/SystemUI/multivalentTests/src/com/android/systemui/smartspace/DreamSmartspaceControllerTest.kt +1 −3 Original line number Diff line number Diff line Loading @@ -115,8 +115,6 @@ class DreamSmartspaceControllerTest : SysuiTestCase() { override fun setDozeAmount(amount: Float) {} override fun setIntentStarter(intentStarter: BcSmartspaceDataPlugin.IntentStarter?) {} override fun setFalsingManager(falsingManager: FalsingManager?) {} override fun setDnd(image: Drawable?, description: String?) {} Loading Loading @@ -299,6 +297,6 @@ class DreamSmartspaceControllerTest : SysuiTestCase() { // And the listener receives an empty list of targets and unregisters the notifier verify(weatherPlugin).onTargetsAvailable(emptyList()) verify(weatherPlugin).registerSmartspaceEventNotifier(null) verify(weatherPlugin).setEventDispatcher(null) } }
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/lockscreen/LockscreenSmartspaceControllerTest.kt +4 −16 Original line number Diff line number Diff line Loading @@ -273,7 +273,7 @@ class LockscreenSmartspaceControllerTest : SysuiTestCase() { // THEN the session is created verify(smartspaceManager).createSmartspaceSession(any()) // THEN an event notifier is registered verify(plugin).registerSmartspaceEventNotifier(any()) verify(plugin).setEventDispatcher(any()) } @Test Loading Loading @@ -320,10 +320,10 @@ class LockscreenSmartspaceControllerTest : SysuiTestCase() { // THEN the listener receives an empty list of targets and unregisters the notifier verify(plugin).onTargetsAvailable(emptyList()) verify(plugin).registerSmartspaceEventNotifier(null) verify(plugin).setEventDispatcher(null) verify(weatherPlugin).onTargetsAvailable(emptyList()) verify(weatherPlugin).registerSmartspaceEventNotifier(null) verify(datePlugin).registerSmartspaceEventNotifier(null) verify(weatherPlugin).setEventDispatcher(null) verify(datePlugin).setEventDispatcher(null) } @Test Loading Loading @@ -977,10 +977,6 @@ class LockscreenSmartspaceControllerTest : SysuiTestCase() { override fun setDozeAmount(amount: Float) {} override fun setIntentStarter( intentStarter: BcSmartspaceDataPlugin.IntentStarter? ) {} override fun setFalsingManager(falsingManager: FalsingManager?) {} override fun setDnd(image: Drawable?, description: String?) {} Loading Loading @@ -1008,10 +1004,6 @@ class LockscreenSmartspaceControllerTest : SysuiTestCase() { override fun setDozeAmount(amount: Float) {} override fun setIntentStarter( intentStarter: BcSmartspaceDataPlugin.IntentStarter? ) {} override fun setFalsingManager(falsingManager: FalsingManager?) {} } ) Loading @@ -1038,10 +1030,6 @@ class LockscreenSmartspaceControllerTest : SysuiTestCase() { override fun setKeyguardBypassEnabled(enabled: Boolean) {} override fun setIntentStarter( intentStarter: BcSmartspaceDataPlugin.IntentStarter? ) {} override fun setFalsingManager(falsingManager: FalsingManager?) {} override fun setDnd(image: Drawable?, description: String?) {} Loading
packages/SystemUI/plugin/bcsmartspace/src/com/android/systemui/plugins/BcSmartspaceDataPlugin.java +22 −19 Original line number Diff line number Diff line Loading @@ -61,21 +61,17 @@ public interface BcSmartspaceDataPlugin extends Plugin { throw new UnsupportedOperationException("Not implemented by " + getClass()); } /** Register a SmartspaceEventNotifier. */ default void registerSmartspaceEventNotifier(SmartspaceEventNotifier notifier) { throw new UnsupportedOperationException("Not implemented by " + getClass()); } /** Sets the event dispatcher for smart space targets. */ void setEventDispatcher(SmartspaceEventDispatcher eventDispatcher); /** Push a SmartspaceTargetEvent to the SmartspaceEventNotifier. */ default void notifySmartspaceEvent(SmartspaceTargetEvent event) { throw new UnsupportedOperationException("Not implemented by " + getClass()); } /** * Overrides how Intents/PendingIntents gets launched. Mostly to support auth from * the lockscreen. */ void setIntentStarter(IntentStarter intentStarter); /** Allows for notifying the SmartspaceSession of SmartspaceTargetEvents. */ interface SmartspaceEventNotifier { /** Pushes a given SmartspaceTargetEvent to the SmartspaceSession. */ void notifySmartspaceEvent(SmartspaceTargetEvent event); } /** Returns the smartspace event notifier */ SmartspaceEventNotifier getEventNotifier(); /** * Create a view to be shown within the parent. Do not add the view, as the parent Loading Loading @@ -171,12 +167,6 @@ public interface BcSmartspaceDataPlugin extends Plugin { */ default void setKeyguardBypassEnabled(boolean enabled) {} /** * Overrides how Intents/PendingIntents gets launched. Mostly to support auth from * the lockscreen. */ void setIntentStarter(IntentStarter intentStarter); /** * When on the lockscreen, use the FalsingManager to help detect errant touches */ Loading Loading @@ -259,6 +249,19 @@ public interface BcSmartspaceDataPlugin extends Plugin { void startPendingIntent(View v, PendingIntent pi, boolean showOnLockscreen); } /** SmartspaceEventDispatcher which also controls controlling intent launching behavior */ interface SmartspaceEventNotifier extends SmartspaceEventDispatcher { /** The intent starter for controlling activity launches */ @Nullable IntentStarter getIntentStarter(); } /** Allows for notifying the SmartspaceSession of SmartspaceTargetEvents. */ interface SmartspaceEventDispatcher { /** Pushes a given SmartspaceTargetEvent to the SmartspaceSession. */ void notifySmartspaceEvent(SmartspaceTargetEvent event); } /** Interface for delegating time updates */ interface TimeChangedDelegate { /** Register the callback to be called when time is updated **/ Loading
packages/SystemUI/src/com/android/systemui/communal/smartspace/CommunalSmartspaceController.kt +2 −2 Original line number Diff line number Diff line Loading @@ -130,7 +130,7 @@ constructor( newSession?.addOnTargetsAvailableListener(uiExecutor, sessionListener) this.session = newSession plugin?.registerSmartspaceEventNotifier { e -> session?.notifySmartspaceEvent(e) } plugin.setEventDispatcher { e -> session?.notifySmartspaceEvent(e) } reloadSmartspace() } Loading @@ -152,7 +152,7 @@ constructor( session = null plugin?.registerSmartspaceEventNotifier(null) plugin?.setEventDispatcher(null) plugin?.onTargetsAvailable(emptyList()) Log.d(TAG, "Ending smartspace session for communal") } Loading