Address ANAPIC review comments

- GnssMeasurementFlags extends v1.0
- add gnssSetCapabilitiesCb_2_1

Fixes: 149501257
Test: VTS tests pass on cuttlefish
Change-Id: I21dd284297d5f458945e7b5fa5e6ed0dab6a5dde
diff --git a/gnss/2.1/IGnssCallback.hal b/gnss/2.1/IGnssCallback.hal
index f7b7477..94be915 100644
--- a/gnss/2.1/IGnssCallback.hal
+++ b/gnss/2.1/IGnssCallback.hal
@@ -36,6 +36,13 @@
     };
 
     /**
+     * Callback to inform framework of the GNSS HAL implementation's capabilities.
+     *
+     * @param capabilities Capability parameter is a bit field of the Capabilities enum.
+     */
+    gnssSetCapabilitiesCb_2_1(bitfield<Capabilities> capabilities);
+
+    /**
      * Extends a GnssSvInfo, adding a basebandCN0DbHz.
      */
     struct GnssSvInfo {
diff --git a/gnss/2.1/IGnssMeasurementCallback.hal b/gnss/2.1/IGnssMeasurementCallback.hal
index 1aee272..0e6abbd 100644
--- a/gnss/2.1/IGnssMeasurementCallback.hal
+++ b/gnss/2.1/IGnssMeasurementCallback.hal
@@ -28,31 +28,7 @@
     /**
      * Flags to indicate what fields in GnssMeasurement are valid.
      */
-    enum GnssMeasurementFlags : uint32_t {
-        /**
-         * A valid 'snr' is stored in the data structure.
-         */
-        HAS_SNR = 1 << 0,
-        /**
-         * A valid 'carrier frequency' is stored in the data structure.
-         */
-        HAS_CARRIER_FREQUENCY = 1 << 9,
-        /**
-         * A valid 'carrier cycles' is stored in the data structure.
-         */
-        HAS_CARRIER_CYCLES = 1 << 10,
-        /**
-         * A valid 'carrier phase' is stored in the data structure.
-         */
-        HAS_CARRIER_PHASE = 1 << 11,
-        /**
-         * A valid 'carrier phase uncertainty' is stored in the data structure.
-         */
-        HAS_CARRIER_PHASE_UNCERTAINTY = 1 << 12,
-        /**
-         * A valid automatic gain control is stored in the data structure.
-         */
-        HAS_AUTOMATIC_GAIN_CONTROL = 1 << 13,
+    enum GnssMeasurementFlags : @1.0::IGnssMeasurementCallback.GnssMeasurementFlags {
         /**
          * A valid receiver inter-signal bias is stored in the data structure.
          */
@@ -104,8 +80,8 @@
          * The receiver inter-signal bias (ISB) in nanoseconds.
          *
          * This value is the estimated receiver-side inter-system (different from the constellation
-         * in GnssClock.referenceSignalForIsb) bias and inter-frequency (different from the carrier
-         * frequency in GnssClock.referenceSignalForIsb) bias. The reported receiver ISB
+         * in GnssClock.referenceSignalTypeForIsb) bias and inter-frequency (different from the
+         * carrier frequency in GnssClock.referenceSignalTypeForIsb) bias. The reported receiver ISB
          * must include signal delays caused by
          *
          * - Receiver inter-constellation bias
@@ -114,7 +90,7 @@
          *
          * The value does not include the inter-frequency Ionospheric bias.
          *
-         * The receiver ISB of GnssClock.referenceSignalForIsb is defined to be 0.0 nanoseconds.
+         * The receiver ISB of GnssClock.referenceSignalTypeForIsb is defined to be 0.0 nanoseconds.
          */
         double receiverInterSignalBiasNs;
 
@@ -127,8 +103,8 @@
          * The satellite inter-signal bias in nanoseconds.
          *
          * This value is the satellite-and-control-segment-side inter-system (different from the
-         * constellation in GnssClock.referenceSignalForIsb) bias and inter-frequency (different
-         * from the carrier frequency in GnssClock.referenceSignalForIsb) bias, including:
+         * constellation in GnssClock.referenceSignalTypeForIsb) bias and inter-frequency (different
+         * from the carrier frequency in GnssClock.referenceSignalTypeForIsb) bias, including:
          *
          * - Master clock bias (e.g., GPS-GAL Time Offset (GGTO), GPT-UTC Time Offset (TauGps),
          *   BDS-GLO Time Offset (BGTO))
@@ -136,7 +112,7 @@
          * - Satellite inter-signal bias, which includes satellite inter-frequency bias (GLO only),
          *   and satellite inter-code bias (e.g., Differential Code Bias (DCB)).
          *
-         * The receiver ISB of GnssClock.referenceSignalForIsb is defined to be 0.0 nanoseconds.
+         * The receiver ISB of GnssClock.referenceSignalTypeForIsb is defined to be 0.0 nanoseconds.
          */
         double satelliteInterSignalBiasNs;
 
diff --git a/gnss/2.1/default/Gnss.cpp b/gnss/2.1/default/Gnss.cpp
index c1af103..2b327a9 100644
--- a/gnss/2.1/default/Gnss.cpp
+++ b/gnss/2.1/default/Gnss.cpp
@@ -339,7 +339,7 @@
     const auto capabilities = Capabilities::MEASUREMENTS | Capabilities::MEASUREMENT_CORRECTIONS |
                               Capabilities::LOW_POWER_MODE | Capabilities::SATELLITE_BLACKLIST |
                               Capabilities::ANTENNA_INFO;
-    auto ret = sGnssCallback_2_1->gnssSetCapabilitiesCb_2_0(capabilities);
+    auto ret = sGnssCallback_2_1->gnssSetCapabilitiesCb_2_1(capabilities);
     if (!ret.isOk()) {
         ALOGE("%s: Unable to invoke callback", __func__);
     }
diff --git a/gnss/2.1/vts/functional/gnss_hal_test.cpp b/gnss/2.1/vts/functional/gnss_hal_test.cpp
index 83c4c3c..da7a62b 100644
--- a/gnss/2.1/vts/functional/gnss_hal_test.cpp
+++ b/gnss/2.1/vts/functional/gnss_hal_test.cpp
@@ -215,6 +215,12 @@
     return Void();
 }
 
+Return<void> GnssHalTest::GnssCallback::gnssSetCapabilitiesCb_2_1(uint32_t capabilities) {
+    ALOGI("Capabilities (v2.1) received %d", capabilities);
+    capabilities_cbq_.store(capabilities);
+    return Void();
+}
+
 Return<void> GnssHalTest::GnssCallback::gnssNameCb(const android::hardware::hidl_string& name) {
     ALOGI("Name received: %s", name.c_str());
     name_cbq_.store(name);
diff --git a/gnss/2.1/vts/functional/gnss_hal_test.h b/gnss/2.1/vts/functional/gnss_hal_test.h
index 3472edb..9e6e162 100644
--- a/gnss/2.1/vts/functional/gnss_hal_test.h
+++ b/gnss/2.1/vts/functional/gnss_hal_test.h
@@ -109,6 +109,7 @@
         // New in v2.1
         Return<void> gnssSvStatusCb_2_1(
                 const hidl_vec<IGnssCallback_2_1::GnssSvInfo>& svInfoList) override;
+        Return<void> gnssSetCapabilitiesCb_2_1(uint32_t capabilities) override;
 
       private:
         Return<void> gnssLocationCbImpl(const GnssLocation_2_0& location);