Loading core/java/com/android/internal/statusbar/IStatusBarService.aidl +2 −1 Original line number Diff line number Diff line Loading @@ -67,7 +67,8 @@ interface IStatusBarService in NotificationVisibility[] noLongerVisibleKeys); void onNotificationExpansionChanged(in String key, in boolean userAction, in boolean expanded); void onNotificationDirectReplied(String key); void onNotificationSmartRepliesAdded(in String key, in int replyCount); void onNotificationSmartSuggestionsAdded(String key, int smartReplyCount, int smartActionCount, boolean generatedByAsssistant); void onNotificationSmartReplySent(in String key, in int replyIndex, in CharSequence reply, boolean generatedByAssistant); void onNotificationSettingsViewed(String key); void setSystemUiVisibility(int displayId, int vis, int mask, String cause); Loading packages/SystemUI/src/com/android/systemui/statusbar/SmartReplyController.java +7 −3 Original line number Diff line number Diff line Loading @@ -88,10 +88,14 @@ public class SmartReplyController { return mSendingKeys.contains(key); } public void smartRepliesAdded(final NotificationData.Entry entry, int replyCount) { /** * Smart Replies and Actions have been added to the UI. */ public void smartSuggestionsAdded(final NotificationData.Entry entry, int replyCount, int actionCount, boolean generatedByAssistant) { try { mBarService.onNotificationSmartRepliesAdded(entry.notification.getKey(), replyCount); mBarService.onNotificationSmartSuggestionsAdded( entry.notification.getKey(), replyCount, actionCount, generatedByAssistant); } catch (RemoteException e) { // Nothing to do, system going down } Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java +13 −3 Original line number Diff line number Diff line Loading @@ -1474,9 +1474,19 @@ public class NotificationContentView extends FrameLayout { if (mExpandedChild != null) { mExpandedSmartReplyView = applySmartReplyView(mExpandedChild, smartRepliesAndActions, entry); if (mExpandedSmartReplyView != null && smartRepliesAndActions.smartReplies != null) { mSmartReplyController.smartRepliesAdded( entry, smartRepliesAndActions.smartReplies.choices.length); if (mExpandedSmartReplyView != null) { if (smartRepliesAndActions.smartReplies != null || smartRepliesAndActions.smartActions != null) { int numSmartReplies = smartRepliesAndActions.smartReplies == null ? 0 : smartRepliesAndActions.smartReplies.choices.length; int numSmartActions = smartRepliesAndActions.smartActions == null ? 0 : smartRepliesAndActions.smartActions.actions.size(); boolean fromAssistant = smartRepliesAndActions.smartReplies == null ? smartRepliesAndActions.smartActions.fromAssistant : smartRepliesAndActions.smartReplies.fromAssistant; mSmartReplyController.smartSuggestionsAdded(entry, numSmartReplies, numSmartActions, fromAssistant); } } } if (mHeadsUpChild != null) { Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/SmartReplyControllerTest.java +7 −4 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ public class SmartReplyControllerTest extends SysuiTestCase { private static final String TEST_CHOICE_TEXT = "A Reply"; private static final int TEST_CHOICE_INDEX = 2; private static final int TEST_CHOICE_COUNT = 4; private static final int TEST_ACTION_COUNT = 3; private Notification mNotification; private NotificationData.Entry mEntry; Loading Loading @@ -117,12 +118,14 @@ public class SmartReplyControllerTest extends SysuiTestCase { } @Test public void testShowSmartReply_logsToStatusBar() throws RemoteException { mSmartReplyController.smartRepliesAdded(mEntry, TEST_CHOICE_COUNT); public void testShowSmartSuggestions_logsToStatusBar() throws RemoteException { final boolean generatedByAsssistant = true; mSmartReplyController.smartSuggestionsAdded(mEntry, TEST_CHOICE_COUNT, TEST_ACTION_COUNT, generatedByAsssistant); // Check we log the result to the status bar service. verify(mIStatusBarService).onNotificationSmartRepliesAdded(mSbn.getKey(), TEST_CHOICE_COUNT); verify(mIStatusBarService).onNotificationSmartSuggestionsAdded(mSbn.getKey(), TEST_CHOICE_COUNT, TEST_ACTION_COUNT, generatedByAsssistant); } @Test Loading services/core/java/com/android/server/notification/NotificationDelegate.java +6 −1 Original line number Diff line number Diff line Loading @@ -45,7 +45,12 @@ public interface NotificationDelegate { void onNotificationExpansionChanged(String key, boolean userAction, boolean expanded); void onNotificationDirectReplied(String key); void onNotificationSettingsViewed(String key); void onNotificationSmartRepliesAdded(String key, int replyCount); /** * Notifies that smart replies and actions have been added to the UI. */ void onNotificationSmartSuggestionsAdded(String key, int smartReplyCount, int smartActionCount, boolean generatedByAssistant); /** * Notifies a smart reply is sent. Loading Loading
core/java/com/android/internal/statusbar/IStatusBarService.aidl +2 −1 Original line number Diff line number Diff line Loading @@ -67,7 +67,8 @@ interface IStatusBarService in NotificationVisibility[] noLongerVisibleKeys); void onNotificationExpansionChanged(in String key, in boolean userAction, in boolean expanded); void onNotificationDirectReplied(String key); void onNotificationSmartRepliesAdded(in String key, in int replyCount); void onNotificationSmartSuggestionsAdded(String key, int smartReplyCount, int smartActionCount, boolean generatedByAsssistant); void onNotificationSmartReplySent(in String key, in int replyIndex, in CharSequence reply, boolean generatedByAssistant); void onNotificationSettingsViewed(String key); void setSystemUiVisibility(int displayId, int vis, int mask, String cause); Loading
packages/SystemUI/src/com/android/systemui/statusbar/SmartReplyController.java +7 −3 Original line number Diff line number Diff line Loading @@ -88,10 +88,14 @@ public class SmartReplyController { return mSendingKeys.contains(key); } public void smartRepliesAdded(final NotificationData.Entry entry, int replyCount) { /** * Smart Replies and Actions have been added to the UI. */ public void smartSuggestionsAdded(final NotificationData.Entry entry, int replyCount, int actionCount, boolean generatedByAssistant) { try { mBarService.onNotificationSmartRepliesAdded(entry.notification.getKey(), replyCount); mBarService.onNotificationSmartSuggestionsAdded( entry.notification.getKey(), replyCount, actionCount, generatedByAssistant); } catch (RemoteException e) { // Nothing to do, system going down } Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java +13 −3 Original line number Diff line number Diff line Loading @@ -1474,9 +1474,19 @@ public class NotificationContentView extends FrameLayout { if (mExpandedChild != null) { mExpandedSmartReplyView = applySmartReplyView(mExpandedChild, smartRepliesAndActions, entry); if (mExpandedSmartReplyView != null && smartRepliesAndActions.smartReplies != null) { mSmartReplyController.smartRepliesAdded( entry, smartRepliesAndActions.smartReplies.choices.length); if (mExpandedSmartReplyView != null) { if (smartRepliesAndActions.smartReplies != null || smartRepliesAndActions.smartActions != null) { int numSmartReplies = smartRepliesAndActions.smartReplies == null ? 0 : smartRepliesAndActions.smartReplies.choices.length; int numSmartActions = smartRepliesAndActions.smartActions == null ? 0 : smartRepliesAndActions.smartActions.actions.size(); boolean fromAssistant = smartRepliesAndActions.smartReplies == null ? smartRepliesAndActions.smartActions.fromAssistant : smartRepliesAndActions.smartReplies.fromAssistant; mSmartReplyController.smartSuggestionsAdded(entry, numSmartReplies, numSmartActions, fromAssistant); } } } if (mHeadsUpChild != null) { Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/SmartReplyControllerTest.java +7 −4 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ public class SmartReplyControllerTest extends SysuiTestCase { private static final String TEST_CHOICE_TEXT = "A Reply"; private static final int TEST_CHOICE_INDEX = 2; private static final int TEST_CHOICE_COUNT = 4; private static final int TEST_ACTION_COUNT = 3; private Notification mNotification; private NotificationData.Entry mEntry; Loading Loading @@ -117,12 +118,14 @@ public class SmartReplyControllerTest extends SysuiTestCase { } @Test public void testShowSmartReply_logsToStatusBar() throws RemoteException { mSmartReplyController.smartRepliesAdded(mEntry, TEST_CHOICE_COUNT); public void testShowSmartSuggestions_logsToStatusBar() throws RemoteException { final boolean generatedByAsssistant = true; mSmartReplyController.smartSuggestionsAdded(mEntry, TEST_CHOICE_COUNT, TEST_ACTION_COUNT, generatedByAsssistant); // Check we log the result to the status bar service. verify(mIStatusBarService).onNotificationSmartRepliesAdded(mSbn.getKey(), TEST_CHOICE_COUNT); verify(mIStatusBarService).onNotificationSmartSuggestionsAdded(mSbn.getKey(), TEST_CHOICE_COUNT, TEST_ACTION_COUNT, generatedByAsssistant); } @Test Loading
services/core/java/com/android/server/notification/NotificationDelegate.java +6 −1 Original line number Diff line number Diff line Loading @@ -45,7 +45,12 @@ public interface NotificationDelegate { void onNotificationExpansionChanged(String key, boolean userAction, boolean expanded); void onNotificationDirectReplied(String key); void onNotificationSettingsViewed(String key); void onNotificationSmartRepliesAdded(String key, int replyCount); /** * Notifies that smart replies and actions have been added to the UI. */ void onNotificationSmartSuggestionsAdded(String key, int smartReplyCount, int smartActionCount, boolean generatedByAssistant); /** * Notifies a smart reply is sent. Loading