Fix wrong integer type in AIDL bcradio utils lib

Bug: 310029333
Test: atest broadcastradio_utils_aidl_test
Change-Id: I929049c0991a557f518853ecebd5ba67973e4274
diff --git a/broadcastradio/aidl/vts/src/VtsHalBroadcastradioAidlTargetTest.cpp b/broadcastradio/aidl/vts/src/VtsHalBroadcastradioAidlTargetTest.cpp
index 9633ebb..ee0c639 100644
--- a/broadcastradio/aidl/vts/src/VtsHalBroadcastradioAidlTargetTest.cpp
+++ b/broadcastradio/aidl/vts/src/VtsHalBroadcastradioAidlTargetTest.cpp
@@ -193,7 +193,7 @@
 
 MATCHER_P(InfoHasId, id,
           std::string(negation ? "does not contain" : "contains") + " " + id.toString()) {
-    vector<int> ids = bcutils::getAllIds(arg.selector, id.type);
+    vector<int64_t> ids = bcutils::getAllIds(arg.selector, id.type);
     return ids.end() != find(ids.begin(), ids.end(), id.value);
 }
 
@@ -697,7 +697,7 @@
     LOG(DEBUG) << "Current program info: " << infoCb.toString();
 
     // it should tune exactly to what was requested
-    vector<int> freqs = bcutils::getAllIds(infoCb.selector, IdentifierType::AMFM_FREQUENCY_KHZ);
+    vector<int64_t> freqs = bcutils::getAllIds(infoCb.selector, IdentifierType::AMFM_FREQUENCY_KHZ);
     EXPECT_NE(freqs.end(), find(freqs.begin(), freqs.end(), freq))
             << "FM freq " << freq << " kHz is not sent back by callback.";
 }
@@ -829,7 +829,7 @@
     LOG(DEBUG) << "Current program info: " << infoCb.toString();
 
     // it should tune exactly to what was requested
-    vector<int> freqs = bcutils::getAllIds(infoCb.selector, IdentifierType::DAB_FREQUENCY_KHZ);
+    vector<int64_t> freqs = bcutils::getAllIds(infoCb.selector, IdentifierType::DAB_FREQUENCY_KHZ);
     EXPECT_NE(freqs.end(), find(freqs.begin(), freqs.end(), freq))
             << "DAB freq " << freq << " kHz is not sent back by callback.";
 }
@@ -1152,7 +1152,7 @@
     int expectedResultSize = 0;
     uint64_t expectedFreq = 0;
     for (const auto& program : *completeList) {
-        vector<int> amfmIds =
+        vector<int64_t> amfmIds =
                 bcutils::getAllIds(program.selector, IdentifierType::AMFM_FREQUENCY_KHZ);
         EXPECT_LE(amfmIds.size(), 1u);
         if (amfmIds.size() == 0) {
@@ -1238,7 +1238,8 @@
     }
 
     for (const auto& program : *list) {
-        vector<int> nameIds = bcutils::getAllIds(program.selector, IdentifierType::HD_STATION_NAME);
+        vector<int64_t> nameIds =
+                bcutils::getAllIds(program.selector, IdentifierType::HD_STATION_NAME);
         EXPECT_LE(nameIds.size(), 1u);
         if (nameIds.size() == 0) {
             continue;
diff --git a/broadcastradio/common/utilsaidl/include/broadcastradio-utils-aidl/Utils.h b/broadcastradio/common/utilsaidl/include/broadcastradio-utils-aidl/Utils.h
index 25c96d0..a34ee10 100644
--- a/broadcastradio/common/utilsaidl/include/broadcastradio-utils-aidl/Utils.h
+++ b/broadcastradio/common/utilsaidl/include/broadcastradio-utils-aidl/Utils.h
@@ -121,7 +121,7 @@
 /**
  * Returns all IDs of a given type.
  */
-std::vector<int> getAllIds(const ProgramSelector& sel, const IdentifierType& type);
+std::vector<int64_t> getAllIds(const ProgramSelector& sel, const IdentifierType& type);
 
 /**
  * Checks, if a given selector is supported by the radio module.
diff --git a/broadcastradio/common/utilsaidl/src/Utils.cpp b/broadcastradio/common/utilsaidl/src/Utils.cpp
index 4ab04d2..3de1866 100644
--- a/broadcastradio/common/utilsaidl/src/Utils.cpp
+++ b/broadcastradio/common/utilsaidl/src/Utils.cpp
@@ -178,8 +178,8 @@
     return getId(sel, type);
 }
 
-vector<int> getAllIds(const ProgramSelector& sel, const IdentifierType& type) {
-    vector<int> ret;
+vector<int64_t> getAllIds(const ProgramSelector& sel, const IdentifierType& type) {
+    vector<int64_t> ret;
 
     // iterate through primaryId and secondaryIds
     for (auto it = begin(sel); it != end(sel); it++) {
diff --git a/broadcastradio/common/utilsaidl/test/BroadcastRadioUtilsTest.cpp b/broadcastradio/common/utilsaidl/test/BroadcastRadioUtilsTest.cpp
index b633ff0..81f9470 100644
--- a/broadcastradio/common/utilsaidl/test/BroadcastRadioUtilsTest.cpp
+++ b/broadcastradio/common/utilsaidl/test/BroadcastRadioUtilsTest.cpp
@@ -237,13 +237,22 @@
     sel.secondaryIds.push_back(
             utils::makeIdentifier(IdentifierType::AMFM_FREQUENCY_KHZ, secondaryFrequencyKHz));
 
-    std::vector<int> allIds = utils::getAllIds(sel, IdentifierType::AMFM_FREQUENCY_KHZ);
+    std::vector<int64_t> allIds = utils::getAllIds(sel, IdentifierType::AMFM_FREQUENCY_KHZ);
 
     ASSERT_EQ(allIds.size(), 2u);
     EXPECT_NE(std::find(allIds.begin(), allIds.end(), kFmFrequencyKHz), allIds.end());
     EXPECT_NE(std::find(allIds.begin(), allIds.end(), secondaryFrequencyKHz), allIds.end());
 }
 
+TEST(BroadcastRadioUtilsTest, GetAllIdsWithIdLongerThan32Bit) {
+    ProgramSelector sel = utils::makeSelectorDab(kDabSidExt, kDabEnsemble, kDabFrequencyKhz);
+
+    std::vector<int64_t> allIds = utils::getAllIds(sel, IdentifierType::DAB_SID_EXT);
+
+    ASSERT_EQ(allIds.size(), 1u);
+    EXPECT_NE(std::find(allIds.begin(), allIds.end(), kDabSidExt), allIds.end());
+}
+
 TEST(BroadcastRadioUtilsTest, GetAllIdsWithIdNotFound) {
     ProgramSelector sel = utils::makeSelectorDab(kDabSidExt, kDabEnsemble, kDabFrequencyKhz);