BasicLoggingApi for single NotInterestedIn Action

PiperOrigin-RevId: 241929477
Change-Id: I666f85bb95f022c09d6791d2b999676e0647cd67
diff --git a/src/main/java/com/google/android/libraries/feed/basicstream/internal/actions/StreamActionApiImpl.java b/src/main/java/com/google/android/libraries/feed/basicstream/internal/actions/StreamActionApiImpl.java
index 280f6ec..48f66d2 100644
--- a/src/main/java/com/google/android/libraries/feed/basicstream/internal/actions/StreamActionApiImpl.java
+++ b/src/main/java/com/google/android/libraries/feed/basicstream/internal/actions/StreamActionApiImpl.java
@@ -133,15 +133,16 @@
       List<StreamDataOperation> dataOperations, UndoAction undoAction) {
     if (!undoAction.hasConfirmationLabel()) {
       dismiss(dataOperations);
-      basicLoggingApi.onNotInterestedInTopic(contentLoggingData, /* wasCommitted = */ true);
+
+      // TODO: use correct value
+      basicLoggingApi.onNotInterestedIn(0, contentLoggingData, /* wasCommitted = */ true);
     } else {
       dismissWithSnackbar(
           undoAction,
           new PendingDismissCallback() {
             @Override
             public void onDismissReverted() {
-              basicLoggingApi.onNotInterestedInTopic(
-                  contentLoggingData, /* wasCommitted = */ false);
+              basicLoggingApi.onNotInterestedIn(0, contentLoggingData, /* wasCommitted = */ false);
             }
 
             @Override
@@ -149,12 +150,9 @@
               dismiss(dataOperations);
               HashSet<StreamUploadableAction> actionSet = new HashSet<>();
               actionSet.add(
-                  StreamUploadableAction.newBuilder()
-                      .setFeatureContentId(contentId)
-                      .setActionType(Type.NOT_INTERESTED_IN_TOPIC)
-                      .build());
+                  StreamUploadableAction.newBuilder().setFeatureContentId(contentId).build());
               actionManager.uploadActions(actionSet);
-              basicLoggingApi.onNotInterestedInTopic(contentLoggingData, /* wasCommitted = */ true);
+              basicLoggingApi.onNotInterestedIn(0, contentLoggingData, /* wasCommitted = */ true);
             }
           });
     }
@@ -170,15 +168,14 @@
       List<StreamDataOperation> dataOperations, UndoAction undoAction) {
     if (!undoAction.hasConfirmationLabel()) {
       dismiss(dataOperations);
-      basicLoggingApi.onNotInterestedInSource(contentLoggingData, /* wasCommitted = */ true);
+      basicLoggingApi.onNotInterestedIn(0, contentLoggingData, /* wasCommitted = */ true);
     } else {
       dismissWithSnackbar(
           undoAction,
           new PendingDismissCallback() {
             @Override
             public void onDismissReverted() {
-              basicLoggingApi.onNotInterestedInSource(
-                  contentLoggingData, /* wasCommitted = */ false);
+              basicLoggingApi.onNotInterestedIn(0, contentLoggingData, /* wasCommitted = */ false);
             }
 
             @Override
@@ -186,13 +183,9 @@
               dismiss(dataOperations);
               HashSet<StreamUploadableAction> actionSet = new HashSet<>();
               actionSet.add(
-                  StreamUploadableAction.newBuilder()
-                      .setFeatureContentId(contentId)
-                      .setActionType(Type.NOT_INTERESTED_IN_SOURCE)
-                      .build());
+                  StreamUploadableAction.newBuilder().setFeatureContentId(contentId).build());
               actionManager.uploadActions(actionSet);
-              basicLoggingApi.onNotInterestedInSource(
-                  contentLoggingData, /* wasCommitted = */ true);
+              basicLoggingApi.onNotInterestedIn(0, contentLoggingData, /* wasCommitted = */ true);
             }
           });
     }
diff --git a/src/main/java/com/google/android/libraries/feed/common/testing/FakeBasicLoggingApi.java b/src/main/java/com/google/android/libraries/feed/common/testing/FakeBasicLoggingApi.java
index a19f413..1308e82 100644
--- a/src/main/java/com/google/android/libraries/feed/common/testing/FakeBasicLoggingApi.java
+++ b/src/main/java/com/google/android/libraries/feed/common/testing/FakeBasicLoggingApi.java
@@ -62,10 +62,7 @@
   public void onMoreButtonClicked(int position) {}
 
   @Override
-  public void onNotInterestedInSource(ContentLoggingData data, boolean wasCommitted) {}
-
-  @Override
-  public void onNotInterestedInTopic(ContentLoggingData data, boolean wasCommitted) {}
+  public void onNotInterestedIn(int type, ContentLoggingData data, boolean wasCommitted) {}
 
   @Override
   public void onOpenedWithContent(int timeToPopulateMs, int contentCount) {}
diff --git a/src/main/java/com/google/android/libraries/feed/host/logging/BasicLoggingApi.java b/src/main/java/com/google/android/libraries/feed/host/logging/BasicLoggingApi.java
index 4a812db..904605b 100644
--- a/src/main/java/com/google/android/libraries/feed/host/logging/BasicLoggingApi.java
+++ b/src/main/java/com/google/android/libraries/feed/host/logging/BasicLoggingApi.java
@@ -80,22 +80,14 @@
   void onMoreButtonClicked(int position);
 
   /**
-   * Called when the user has indicated they aren't interested in the story's source.
-   *
-   * @param data data for content on which swipe was performed.
-   * @param wasCommitted true if the action was committed and thus important to the user model false
-   *     if the action was undone.
-   */
-  void onNotInterestedInSource(ContentLoggingData data, boolean wasCommitted);
-
-  /**
    * Called when the user has indicated they aren't interested in the story's topic.
    *
+   * @param interestType type of content a user is not interested in
    * @param data data for content on which swipe was performed.
    * @param wasCommitted true if the action was committed and thus important to the user model false
    *     if the action was undone.
    */
-  void onNotInterestedInTopic(ContentLoggingData data, boolean wasCommitted);
+  void onNotInterestedIn(int interestType, ContentLoggingData data, boolean wasCommitted);
 
   /**
    * Called when Stream is shown and content was shown to the user. Content could have been cached
diff --git a/src/test/java/com/google/android/libraries/feed/basicstream/internal/actions/StreamActionApiImplTest.java b/src/test/java/com/google/android/libraries/feed/basicstream/internal/actions/StreamActionApiImplTest.java
index c78efe8..4a5cdec 100644
--- a/src/test/java/com/google/android/libraries/feed/basicstream/internal/actions/StreamActionApiImplTest.java
+++ b/src/test/java/com/google/android/libraries/feed/basicstream/internal/actions/StreamActionApiImplTest.java
@@ -555,23 +555,12 @@
         verify(basicLoggingApi).onContentDismissed(contentLoggingData, /*wasCommitted =*/ true);
         break;
       case NOT_INTERESTED_IN_SOURCE:
-        verify(actionManager).dismiss(streamDataOperations, SESSION_ID);
-        verify(basicLoggingApi)
-            .onNotInterestedInSource(contentLoggingData, /*wasCommitted =*/ true);
-        actionSet.add(
-            StreamUploadableAction.newBuilder()
-                .setFeatureContentId(CONTENT_ID)
-                .setActionType(FeedActionMetadata.Type.NOT_INTERESTED_IN_SOURCE)
-                .build());
-        verify(actionManager).uploadActions(actionSet);
-        break;
       case NOT_INTERESTED_IN_TOPIC:
         verify(actionManager).dismiss(streamDataOperations, SESSION_ID);
-        verify(basicLoggingApi).onNotInterestedInTopic(contentLoggingData, /*wasCommitted =*/ true);
+        verify(basicLoggingApi).onNotInterestedIn(0, contentLoggingData, /*wasCommitted =*/ true);
         actionSet.add(
             StreamUploadableAction.newBuilder()
                 .setFeatureContentId(CONTENT_ID)
-                .setActionType(FeedActionMetadata.Type.NOT_INTERESTED_IN_TOPIC)
                 .build());
         verify(actionManager).uploadActions(actionSet);
         break;
@@ -615,12 +604,8 @@
         verify(basicLoggingApi).onContentDismissed(contentLoggingData, /*wasCommitted =*/ false);
         break;
       case NOT_INTERESTED_IN_SOURCE:
-        verify(basicLoggingApi)
-            .onNotInterestedInSource(contentLoggingData, /*wasCommitted =*/ false);
-        break;
       case NOT_INTERESTED_IN_TOPIC:
-        verify(basicLoggingApi)
-            .onNotInterestedInTopic(contentLoggingData, /*wasCommitted =*/ false);
+        verify(basicLoggingApi).onNotInterestedIn(0, contentLoggingData, /*wasCommitted =*/ false);
         break;
       default:
         break;
@@ -657,13 +642,9 @@
         verify(basicLoggingApi).onContentDismissed(contentLoggingData, /*wasCommitted =*/ true);
         break;
       case NOT_INTERESTED_IN_SOURCE:
-        verify(actionManager).dismiss(streamDataOperations, SESSION_ID);
-        verify(basicLoggingApi)
-            .onNotInterestedInSource(contentLoggingData, /*wasCommitted =*/ true);
-        break;
       case NOT_INTERESTED_IN_TOPIC:
         verify(actionManager).dismiss(streamDataOperations, SESSION_ID);
-        verify(basicLoggingApi).onNotInterestedInTopic(contentLoggingData, /*wasCommitted =*/ true);
+        verify(basicLoggingApi).onNotInterestedIn(0, contentLoggingData, /*wasCommitted =*/ true);
         break;
       default:
         break;