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

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

Merge "Add VTS test for gnss.measurement_corrections@1.0"

parents c5524a61 08642f98
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -27,5 +27,8 @@ cc_test {
        "android.hardware.gnss@1.1",
        "android.hardware.gnss@common-vts-lib",
    ],
    shared_libs: [
        "android.hardware.gnss.measurement_corrections@1.0",
    ],
    test_suites: ["general-tests"],
}
+1 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ cc_binary {
        "AGnssRil.cpp",
        "Gnss.cpp",
        "GnssMeasurement.cpp",
        "GnssMeasurementCorrections.cpp",
        "GnssVisibilityControl.cpp",
        "service.cpp"
    ],
+5 −2
Original line number Diff line number Diff line
@@ -25,11 +25,14 @@
#include "AGnssRil.h"
#include "GnssConfiguration.h"
#include "GnssMeasurement.h"
#include "GnssMeasurementCorrections.h"
#include "GnssVisibilityControl.h"
#include "Utils.h"

using ::android::hardware::Status;
using ::android::hardware::gnss::common::Utils;
using ::android::hardware::gnss::measurement_corrections::V1_0::implementation::
        GnssMeasurementCorrections;
using ::android::hardware::gnss::visibility_control::V1_0::implementation::GnssVisibilityControl;

namespace android {
@@ -248,8 +251,8 @@ Return<sp<V2_0::IGnssMeasurement>> Gnss::getExtensionGnssMeasurement_2_0() {

Return<sp<measurement_corrections::V1_0::IMeasurementCorrections>>
Gnss::getExtensionMeasurementCorrections() {
    // TODO(b/124012850): Implement function.
    return sp<measurement_corrections::V1_0::IMeasurementCorrections>{};
    ALOGD("Gnss::getExtensionMeasurementCorrections");
    return new GnssMeasurementCorrections();
}

Return<sp<visibility_control::V1_0::IGnssVisibilityControl>> Gnss::getExtensionVisibilityControl() {
+62 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2019 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#define LOG_TAG "GnssMeasurementCorrections"

#include "GnssMeasurementCorrections.h"
#include <log/log.h>

namespace android {
namespace hardware {
namespace gnss {
namespace measurement_corrections {
namespace V1_0 {
namespace implementation {

// Methods from V1_0::IMeasurementCorrections follow.
Return<bool> GnssMeasurementCorrections::setCorrections(const MeasurementCorrections& corrections) {
    ALOGD("setCorrections");
    ALOGD("corrections = lat: %f, lng: %f, alt: %f, hUnc: %f, vUnc: %f, toa: %llu, "
          "satCorrections.size: %d",
          corrections.latitudeDegrees, corrections.longitudeDegrees, corrections.altitudeMeters,
          corrections.horizontalPositionUncertaintyMeters,
          corrections.verticalPositionUncertaintyMeters,
          static_cast<unsigned long long>(corrections.toaGpsNanosecondsOfWeek),
          static_cast<int>(corrections.satCorrections.size()));
    for (auto singleSatCorrection : corrections.satCorrections) {
        ALOGD("singleSatCorrection = flags: %d, constellation: %d, svid: %d, cfHz: %f, probLos: %f,"
              " epl: %f, eplUnc: %f",
              static_cast<int>(singleSatCorrection.singleSatCorrectionFlags),
              static_cast<int>(singleSatCorrection.constellation),
              static_cast<int>(singleSatCorrection.svid), singleSatCorrection.carrierFrequencyHz,
              singleSatCorrection.probSatIsLos, singleSatCorrection.excessPathLengthMeters,
              singleSatCorrection.excessPathLengthUncertaintyMeters);
        ALOGD("reflecting plane = lat: %f, lng: %f, alt: %f, azm: %f",
              singleSatCorrection.reflectingPlane.latitudeDegrees,
              singleSatCorrection.reflectingPlane.longitudeDegrees,
              singleSatCorrection.reflectingPlane.altitudeMeters,
              singleSatCorrection.reflectingPlane.azimuthDegrees);
    }

    return true;
}

}  // namespace implementation
}  // namespace V1_0
}  // namespace measurement_corrections
}  // namespace gnss
}  // namespace hardware
}  // namespace android
+48 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2019 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#pragma once

#include <android/hardware/gnss/measurement_corrections/1.0/IMeasurementCorrections.h>
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>

namespace android {
namespace hardware {
namespace gnss {
namespace measurement_corrections {
namespace V1_0 {
namespace implementation {

using ::android::sp;
using ::android::hardware::hidl_array;
using ::android::hardware::hidl_memory;
using ::android::hardware::hidl_string;
using ::android::hardware::hidl_vec;
using ::android::hardware::Return;
using ::android::hardware::Void;

struct GnssMeasurementCorrections : public IMeasurementCorrections {
    // Methods from V1_0::IMeasurementCorrections follow.
    Return<bool> setCorrections(const MeasurementCorrections& corrections) override;
};

}  // namespace implementation
}  // namespace V1_0
}  // namespace measurement_corrections
}  // namespace gnss
}  // namespace hardware
}  // namespace android
Loading