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

Commit d3afb53b authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 4481641 from 0a01e751 to pi-release

Change-Id: Ifa1059bd800f761dc9cbd38b30485a447f213008
parents f9bfb598 0a01e751
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ class BluetoothAddressTest : public ::testing::Test {

void BluetoothAddressTest::FileWriteString(const char* path,
                                           const char* string) {
  int fd = open(path, O_CREAT | O_RDWR);
  int fd = open(path, O_CREAT | O_RDWR, 0600);
  EXPECT_TRUE(fd > 0) << "err = " << strerror(errno);

  size_t length = strlen(string);
+1 −0
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@ hidl_interface {
    srcs: [
        "IGnss.hal",
        "IGnssCallback.hal",
        "IGnssMeasurement.hal",
    ],
    interfaces: [
        "android.hardware.gnss@1.0",
+41 −2
Original line number Diff line number Diff line
@@ -18,17 +18,56 @@ package android.hardware.gnss@1.1;

import @1.0::IGnss;

import IGnssMeasurement;
import IGnssCallback;

/** Represents the standard GNSS (Global Navigation Satellite System) interface. */
interface IGnss extends @1.0::IGnss {
    /**
     * Opens the interface and provides the callback routines
     * to the implementation of this interface.
     * Opens the interface and provides the callback routines to the implementation of this
     * interface.
     *
     * @param callback Callback interface for IGnss.
     *
     * @return success Returns true on success.
     */
    setCallback_1_1(IGnssCallback callback) generates (bool success);

    /**
     * Sets the GnssPositionMode parameter, its associated recurrence value,
     * the time between fixes, requested fix accuracy, time to first fix.
     *
     * @param mode Parameter must be one of MS_BASED or STANDALONE. It is allowed by the platform
     *     (and it is recommended) to fallback to MS_BASED if MS_ASSISTED is passed in, and MS_BASED
     *     is supported.
     * @param recurrence GNSS postion recurrence value, either periodic or single.
     * @param minIntervalMs Represents the time between fixes in milliseconds.
     * @param preferredAccuracyMeters Represents the requested fix accuracy in meters.
     * @param preferredTimeMs Represents the requested time to first fix in milliseconds.
     * @param lowPowerMode When true, HAL must make strong tradeoffs to substantially restrict power
     *     use. Specifically, in the case of a several second long minIntervalMs, the GNSS chipset
     *     must not, on average, run power hungry operations like RF and signal searches for more
     *     than one second per interval, and must make exactly one call to gnssSvStatusCb(), and
     *     either zero or one call to GnssLocationCb() at each interval. When false, HAL must
     *     operate in the nominal mode (similar to V1.0 where this flag wasn't present) and is
     *     expected to make power and performance tradoffs such as duty-cycling when signal
     *     conditions are good and more active searches to reacquire GNSS signals when no signals
     *     are present.
     *
     * @return success Returns true if successful.
     */
    setPositionMode_1_1(GnssPositionMode mode,
                        GnssPositionRecurrence recurrence,
                        uint32_t minIntervalMs,
                        uint32_t preferredAccuracyMeters,
                        uint32_t preferredTimeMs,
                        bool lowPowerMode)
             generates (bool success);

   /**
    * This method returns the IGnssMeasurement interface.
    *
    * @return gnssMeasurementIface Handle to the IGnssMeasurement interface.
    */
    getExtensionGnssMeasurement_1_1() generates (IGnssMeasurement gnssMeasurementIface);
};
 No newline at end of file
+49 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2017 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.
 */

package android.hardware.gnss@1.1;

import @1.0::IGnssMeasurement;
import @1.0::IGnssMeasurementCallback;

/**
 * Extended interface for GNSS Measurements support.
 */
interface IGnssMeasurement extends @1.0::IGnssMeasurement {

    /**
     * Initializes the interface and registers the callback routines with the HAL. After a
     * successful call to 'setCallback_1_1' the HAL must begin to provide updates at an average
     * output rate of 1Hz (occasional intra-measurement time offsets in the range from 0-2000msec
     * can be tolerated.)
     *
     * @param callback Handle to GnssMeasurement callback interface.
     * @param enableFullTracking If true, GNSS chipset must switch off duty cycling. In such mode
     *     no clock discontinuities are expected and, when supported, carrier phase should be
     *     continuous in good signal conditions. All constellations and frequency bands that the
     *     chipset supports must be reported in this mode. The GNSS chipset is allowed to consume
     *     more power in this mode. If false, API must behave as in HAL V1_0, optimizing power via
     *     duty cycling, constellations and frequency limits, etc.
     *
     * @return initRet Returns SUCCESS if successful. Returns ERROR_ALREADY_INIT if a callback has
     *     already been registered without a corresponding call to 'close'. Returns ERROR_GENERIC
     *     for any other error. The HAL must not generate any other updates upon returning this
     *     error code.
     */
    setCallback_1_1(IGnssMeasurementCallback callback, bool enableFullTracking)
         generates (GnssMeasurementStatus initRet);

};
+23 −4
Original line number Diff line number Diff line
@@ -22,7 +22,12 @@
#include <chrono>

// Implementations for the main test class for GNSS HAL
GnssHalTest::GnssHalTest() : info_called_count_(0), name_called_count_(0), notify_count_(0) {}
GnssHalTest::GnssHalTest()
    : info_called_count_(0),
      capabilities_called_count_(0),
      location_called_count_(0),
      name_called_count_(0),
      notify_count_(0) {}

void GnssHalTest::SetUp() {
    gnss_hal_ = ::testing::VtsHalHidlTargetTestBase::getService<IGnss>();
@@ -56,7 +61,6 @@ std::cv_status GnssHalTest::wait(int timeoutSeconds) {
    return status;
}

// Actual (test) callback handlers
Return<void> GnssHalTest::GnssCallback::gnssSetSystemInfoCb(
    const IGnssCallback::GnssSystemInfo& info) {
    ALOGI("Info received, year %d", info.yearOfHw);
@@ -66,7 +70,14 @@ Return<void> GnssHalTest::GnssCallback::gnssSetSystemInfoCb(
    return Void();
}

// Actual (test) callback handlers
Return<void> GnssHalTest::GnssCallback::gnssSetCapabilitesCb(uint32_t capabilities) {
    ALOGI("Capabilities received %d", capabilities);
    parent_.capabilities_called_count_++;
    parent_.last_capabilities_ = capabilities;
    parent_.notify();
    return Void();
}

Return<void> GnssHalTest::GnssCallback::gnssNameCb(const android::hardware::hidl_string& name) {
    ALOGI("Name received: %s", name.c_str());
    parent_.name_called_count_++;
@@ -74,3 +85,11 @@ Return<void> GnssHalTest::GnssCallback::gnssNameCb(const android::hardware::hidl
    parent_.notify();
    return Void();
}

Return<void> GnssHalTest::GnssCallback::gnssLocationCb(const GnssLocation& location) {
    ALOGI("Location received");
    parent_.location_called_count_++;
    parent_.last_location_ = location;
    parent_.notify();
    return Void();
}
Loading