From a6d4e151d27272cbfeec9d8400982a22b3c23ac9 Mon Sep 17 00:00:00 2001 From: Schneider Victor-tulias Date: Tue, 4 May 2021 17:02:14 -0700 Subject: [PATCH] Update SmartspaceDataPlugin to allow sending SmartspaceTargetEvents. Test: manual bug: 187320188 Change-Id: Idda9b4fb96d863c9c49f6233e1ab4f3d89f2682a --- .../systemui/plugins/BcSmartspaceDataPlugin.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/packages/SystemUI/plugin/bcsmartspace/src/com/android/systemui/plugins/BcSmartspaceDataPlugin.java b/packages/SystemUI/plugin/bcsmartspace/src/com/android/systemui/plugins/BcSmartspaceDataPlugin.java index 32def0309aaa1..b3c437480af7f 100644 --- a/packages/SystemUI/plugin/bcsmartspace/src/com/android/systemui/plugins/BcSmartspaceDataPlugin.java +++ b/packages/SystemUI/plugin/bcsmartspace/src/com/android/systemui/plugins/BcSmartspaceDataPlugin.java @@ -19,6 +19,7 @@ package com.android.systemui.plugins; import android.app.PendingIntent; import android.app.smartspace.SmartspaceAction; import android.app.smartspace.SmartspaceTarget; +import android.app.smartspace.SmartspaceTargetEvent; import android.content.Intent; import android.graphics.drawable.Drawable; import android.os.Parcelable; @@ -45,6 +46,18 @@ public interface BcSmartspaceDataPlugin extends Plugin { /** Unregister a listener. */ void unregisterListener(SmartspaceTargetListener listener); + /** Register a SmartspaceEventNotifier. */ + default void registerSmartspaceEventNotifier(SmartspaceEventNotifier notifier) {} + + /** Push a SmartspaceTargetEvent to the SmartspaceEventNotifier. */ + default void notifySmartspaceEvent(SmartspaceTargetEvent event) {} + + /** Allows for notifying the SmartspaceSession of SmartspaceTargetEvents. */ + interface SmartspaceEventNotifier { + /** Pushes a given SmartspaceTargetEvent to the SmartspaceSession. */ + void notifySmartspaceEvent(SmartspaceTargetEvent event); + } + /** * Create a view to be shown within the parent. Do not add the view, as the parent * will be responsible for correctly setting the LayoutParams