Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 04d9defc authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add @utf8InCpp to String fields"

parents e0ff63e3 cfca8a75
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -32,7 +32,6 @@ parcelable GnssMeasurement {
  int accumulatedDeltaRangeState;
  double accumulatedDeltaRangeM;
  double accumulatedDeltaRangeUncertaintyM;
  float carrierFrequencyHz;
  long carrierCycles;
  double carrierPhase;
  double carrierPhaseUncertainty;
+17 −17
Original line number Diff line number Diff line
@@ -20,21 +20,21 @@ package android.hardware.gnss;
parcelable GnssSignalType {
  android.hardware.gnss.GnssConstellationType constellation;
  double carrierFrequencyHz;
  String codeType;
  const String CODE_TYPE_A = "A";
  const String CODE_TYPE_B = "B";
  const String CODE_TYPE_C = "C";
  const String CODE_TYPE_D = "D";
  const String CODE_TYPE_I = "I";
  const String CODE_TYPE_L = "L";
  const String CODE_TYPE_M = "M";
  const String CODE_TYPE_N = "N";
  const String CODE_TYPE_P = "P";
  const String CODE_TYPE_Q = "Q";
  const String CODE_TYPE_S = "S";
  const String CODE_TYPE_W = "W";
  const String CODE_TYPE_X = "X";
  const String CODE_TYPE_Y = "Y";
  const String CODE_TYPE_Z = "Z";
  const String CODE_TYPE_UNKNOWN = "UNKNOWN";
  @utf8InCpp String codeType;
  const @utf8InCpp String CODE_TYPE_A = "A";
  const @utf8InCpp String CODE_TYPE_B = "B";
  const @utf8InCpp String CODE_TYPE_C = "C";
  const @utf8InCpp String CODE_TYPE_D = "D";
  const @utf8InCpp String CODE_TYPE_I = "I";
  const @utf8InCpp String CODE_TYPE_L = "L";
  const @utf8InCpp String CODE_TYPE_M = "M";
  const @utf8InCpp String CODE_TYPE_N = "N";
  const @utf8InCpp String CODE_TYPE_P = "P";
  const @utf8InCpp String CODE_TYPE_Q = "Q";
  const @utf8InCpp String CODE_TYPE_S = "S";
  const @utf8InCpp String CODE_TYPE_W = "W";
  const @utf8InCpp String CODE_TYPE_X = "X";
  const @utf8InCpp String CODE_TYPE_Y = "Y";
  const @utf8InCpp String CODE_TYPE_Z = "Z";
  const @utf8InCpp String CODE_TYPE_UNKNOWN = "UNKNOWN";
}
+0 −19
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package android.hardware.gnss;

import android.hardware.gnss.GnssConstellationType;
import android.hardware.gnss.GnssSignalType;
import android.hardware.gnss.GnssMultipathIndicator;

@@ -476,24 +475,6 @@ parcelable GnssMeasurement {
     */
    double accumulatedDeltaRangeUncertaintyM;

    /**
     * Carrier frequency of the signal tracked, for example it can be the
     * GPS central frequency for L1 = 1575.45 MHz, or L2 = 1227.60 MHz, L5 =
     * 1176.45 MHz, varying GLO channels, etc. If the field is not set, it
     * is the primary common use central frequency, e.g. L1 = 1575.45 MHz
     * for GPS.
     *
     * For an L1, L5 receiver tracking a satellite on L1 and L5 at the same
     * time, two raw measurement structs must be reported for this same
     * satellite, in one of the measurement structs, all the values related
     * to L1 must be filled, and in the other all of the values related to
     * L5 must be filled.
     *
     * If the data is available, gnssMeasurementFlags must contain
     * HAS_CARRIER_FREQUENCY.
     */
    float carrierFrequencyHz;

    /**
     * The number of full carrier cycles between the satellite and the
     * receiver. The reference frequency is given by the field
+17 −17
Original line number Diff line number Diff line
@@ -46,67 +46,67 @@ parcelable GnssSignalType {
    /**
     * GNSS signal code type "A" representing GALILEO E1A, GALILEO E6A, IRNSS L5A, IRNSS SA.
     */
    const String CODE_TYPE_A = "A";
    const @utf8InCpp String CODE_TYPE_A = "A";

    /**
     * GNSS signal code type "B" representing GALILEO E1B, GALILEO E6B, IRNSS L5B, IRNSS SB.
     */
    const String CODE_TYPE_B = "B";
    const @utf8InCpp String CODE_TYPE_B = "B";

    /**
     * GNSS signal code type "C" representing GPS L1 C/A,  GPS L2 C/A, GLONASS G1 C/A,
     * GLONASS G2 C/A, GALILEO E1C, GALILEO E6C, SBAS L1 C/A, QZSS L1 C/A, IRNSS L5C.
     */
    const String CODE_TYPE_C = "C";
    const @utf8InCpp String CODE_TYPE_C = "C";

    /**
     * GNSS signal code type "D" representing BDS B1C D.
     */
    const String CODE_TYPE_D = "D";
    const @utf8InCpp String CODE_TYPE_D = "D";

    /**
     * GNSS signal code type "I" representing GPS L5 I, GLONASS G3 I, GALILEO E5a I, GALILEO E5b I,
     * GALILEO E5a+b I, SBAS L5 I, QZSS L5 I, BDS B1 I, BDS B2 I, BDS B3 I.
     */
    const String CODE_TYPE_I = "I";
    const @utf8InCpp String CODE_TYPE_I = "I";

    /**
     * GNSS signal code type "L" representing GPS L1C (P), GPS L2C (L), QZSS L1C (P), QZSS L2C (L),
     * LEX(6) L.
     */
    const String CODE_TYPE_L = "L";
    const @utf8InCpp String CODE_TYPE_L = "L";

    /**
     * GNSS signal code type "M" representing GPS L1M, GPS L2M.
     */
    const String CODE_TYPE_M = "M";
    const @utf8InCpp String CODE_TYPE_M = "M";

    /**
     * GNSS signal code type "N" representing GPS L1 codeless, GPS L2 codeless.
     */
    const String CODE_TYPE_N = "N";
    const @utf8InCpp String CODE_TYPE_N = "N";

    /**
     * GNSS signal code type "P" representing GPS L1P, GPS L2P, GLONASS G1P, GLONASS G2P, BDS B1C P.
     */
    const String CODE_TYPE_P = "P";
    const @utf8InCpp String CODE_TYPE_P = "P";

    /**
     * GNSS signal code type "Q" representing GPS L5 Q, GLONASS G3 Q, GALILEO E5a Q, GALILEO E5b Q,
     * GALILEO E5a+b Q, SBAS L5 Q, QZSS L5 Q, BDS B1 Q, BDS B2 Q, BDS B3 Q.
     */
    const String CODE_TYPE_Q = "Q";
    const @utf8InCpp String CODE_TYPE_Q = "Q";

    /**
     * GNSS signal code type "S" represents GPS L1C (D), GPS L2C (M), QZSS L1C (D), QZSS L2C (M),
     * LEX(6) S.
     */
    const String CODE_TYPE_S = "S";
    const @utf8InCpp String CODE_TYPE_S = "S";

    /**
     * GNSS signal code type "W" representing GPS L1 Z-tracking, GPS L2 Z-tracking.
     */
    const String CODE_TYPE_W = "W";
    const @utf8InCpp String CODE_TYPE_W = "W";

    /**
     * GNSS signal code type "X" representing GPS L1C (D+P), GPS L2C (M+L), GPS L5 (I+Q),
@@ -114,22 +114,22 @@ parcelable GnssSignalType {
     * GALILEO E6 (B+C), SBAS L5 (I+Q), QZSS L1C (D+P), QZSS L2C (M+L), QZSS L5 (I+Q),
     * LEX(6) (S+L), BDS B1 (I+Q), BDS B1C (D+P), BDS B2 (I+Q), BDS B3 (I+Q), IRNSS L5 (B+C).
     */
    const String CODE_TYPE_X = "X";
    const @utf8InCpp String CODE_TYPE_X = "X";

    /**
     * GNSS signal code type "Y" representing GPS L1Y, GPS L2Y.
     */
    const String CODE_TYPE_Y = "Y";
    const @utf8InCpp String CODE_TYPE_Y = "Y";

    /**
     * GNSS signal code type "Z" representing GALILEO E1 (A+B+C), GALILEO E6 (A+B+C), QZSS L1-SAIF.
     */
    const String CODE_TYPE_Z = "Z";
    const @utf8InCpp String CODE_TYPE_Z = "Z";

    /**
     * GNSS signal code type "UNKNOWN" representing the GNSS Measurement's code type is unknown.
     */
    const String CODE_TYPE_UNKNOWN = "UNKNOWN";
    const @utf8InCpp String CODE_TYPE_UNKNOWN = "UNKNOWN";

    /**
     * The type of code that is currently being tracked in the GNSS signal.
@@ -145,5 +145,5 @@ parcelable GnssSignalType {
     * "A channel"). In the future, if for instance a code "G" was added in the official RINEX
     * standard, "G" could be specified here.
     */
    String codeType;
    @utf8InCpp String codeType;
}
+38 −20
Original line number Diff line number Diff line
@@ -25,14 +25,17 @@ namespace hardware {
namespace gnss {
namespace common {

using IGnss = aidl::android::hardware::gnss::IGnss;
using IGnssMeasurementCallback = aidl::android::hardware::gnss::IGnssMeasurementCallback;
using GnssMeasurement = aidl::android::hardware::gnss::GnssMeasurement;
using aidl::android::hardware::gnss::ElapsedRealtime;
using aidl::android::hardware::gnss::GnssClock;
using aidl::android::hardware::gnss::GnssData;
using aidl::android::hardware::gnss::GnssMeasurement;
using aidl::android::hardware::gnss::IGnss;
using aidl::android::hardware::gnss::IGnssMeasurementCallback;

using GnssSvFlags = V1_0::IGnssCallback::GnssSvFlags;
using GnssMeasurementFlagsV1_0 = V1_0::IGnssMeasurementCallback::GnssMeasurementFlags;
using GnssMeasurementFlagsV2_1 = V2_1::IGnssMeasurementCallback::GnssMeasurementFlags;
using GnssMeasurementStateV2_0 = V2_0::IGnssMeasurementCallback::GnssMeasurementState;
using ElapsedRealtime = aidl::android::hardware::gnss::ElapsedRealtime;
using ElapsedRealtimeFlags = V2_0::ElapsedRealtimeFlags;
using GnssConstellationTypeV2_0 = V2_0::GnssConstellationType;
using IGnssMeasurementCallbackV2_0 = V2_0::IGnssMeasurementCallback;
@@ -137,38 +140,53 @@ GnssDataV2_0 Utils::getMockMeasurementV2_0() {
    return gnssData;
}

aidl::android::hardware::gnss::GnssData Utils::getMockMeasurement() {
GnssData Utils::getMockMeasurement() {
    aidl::android::hardware::gnss::GnssSignalType signalType = {
            .constellation = aidl::android::hardware::gnss::GnssConstellationType::GLONASS,
            .carrierFrequencyHz = 1.59975e+09,
            .codeType = aidl::android::hardware::gnss::GnssSignalType::CODE_TYPE_C,
    };
    aidl::android::hardware::gnss::GnssMeasurement measurement = {
            .flags = GnssMeasurement::HAS_CARRIER_FREQUENCY,
            .svid = 6,
    GnssMeasurement measurement = {
            .flags = GnssMeasurement::HAS_AUTOMATIC_GAIN_CONTROL |
                     GnssMeasurement::HAS_CARRIER_FREQUENCY | GnssMeasurement::HAS_CARRIER_PHASE |
                     GnssMeasurement::HAS_CARRIER_PHASE_UNCERTAINTY |
                     GnssMeasurement::HAS_FULL_ISB | GnssMeasurement::HAS_FULL_ISB_UNCERTAINTY |
                     GnssMeasurement::HAS_SATELLITE_ISB |
                     GnssMeasurement::HAS_SATELLITE_ISB_UNCERTAINTY,
            .svid = 13,
            .signalType = signalType,
            .timeOffsetNs = 0.0,
            .receivedSvTimeInNs = 8195997131077,
            .receivedSvTimeUncertaintyInNs = 15,
            .antennaCN0DbHz = 30.0,
            .basebandCN0DbHz = 26.5,
            .agcLevelDb = 2.3,
            .pseudorangeRateMps = -484.13739013671875,
            .pseudorangeRateUncertaintyMps = 1.0379999876022339,
            .accumulatedDeltaRangeState = GnssMeasurement::ADR_STATE_UNKNOWN,
            .accumulatedDeltaRangeM = 0.0,
            .accumulatedDeltaRangeUncertaintyM = 0.0,
            .accumulatedDeltaRangeM = 1.52,
            .accumulatedDeltaRangeUncertaintyM = 2.43,
            .multipathIndicator = aidl::android::hardware::gnss::GnssMultipathIndicator::UNKNOWN,
            .state = GnssMeasurement::STATE_CODE_LOCK | GnssMeasurement::STATE_BIT_SYNC |
                     GnssMeasurement::STATE_SUBFRAME_SYNC | GnssMeasurement::STATE_TOW_DECODED |
                     GnssMeasurement::STATE_GLO_STRING_SYNC |
                     GnssMeasurement::STATE_GLO_TOD_DECODED};
                     GnssMeasurement::STATE_GLO_TOD_DECODED,
            .fullInterSignalBiasNs = 21.5,
            .fullInterSignalBiasUncertaintyNs = 792.0,
            .satelliteInterSignalBiasNs = 233.9,
            .satelliteInterSignalBiasUncertaintyNs = 921.2,
    };

    aidl::android::hardware::gnss::GnssClock clock = {.timeNs = 2713545000000,
                                                      .fullBiasNs = -1226701900521857520,
                                                      .biasNs = 0.59689998626708984,
                                                      .biasUncertaintyNs = 47514.989972114563,
                                                      .driftNsps = -51.757811607455452,
                                                      .driftUncertaintyNsps = 310.64968328491528,
                                                      .hwClockDiscontinuityCount = 1};
    GnssClock clock = {.gnssClockFlags = GnssClock::HAS_FULL_BIAS | GnssClock::HAS_FULL_BIAS |
                                         GnssClock::HAS_BIAS_UNCERTAINTY | GnssClock::HAS_DRIFT |
                                         GnssClock::HAS_DRIFT_UNCERTAINTY,
                       .timeNs = 35854545000000,
                       .fullBiasNs = -234621900521857520,
                       .biasNs = 0.2352389998626708984,
                       .biasUncertaintyNs = 274.989972114563,
                       .driftNsps = -124.3742360,
                       .driftUncertaintyNsps = 239.6234285828,
                       .hwClockDiscontinuityCount = 999};

    ElapsedRealtime timestamp = {
            .flags = ElapsedRealtime::HAS_TIMESTAMP_NS | ElapsedRealtime::HAS_TIME_UNCERTAINTY_NS,
@@ -176,9 +194,9 @@ aidl::android::hardware::gnss::GnssData Utils::getMockMeasurement() {
            // This is an hardcoded value indicating a 1ms of uncertainty between the two clocks.
            // In an actual implementation provide an estimate of the synchronization uncertainty
            // or don't set the field.
            .timeUncertaintyNs = 1000000};
            .timeUncertaintyNs = 1020400};

    aidl::android::hardware::gnss::GnssData gnssData = {
    GnssData gnssData = {
            .measurements = {measurement}, .clock = clock, .elapsedRealtime = timestamp};
    return gnssData;
}