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

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

release-request-276f9f52-87fd-4915-bd79-9a2f0ee77433-for-git_oc-release-409021...

release-request-276f9f52-87fd-4915-bd79-9a2f0ee77433-for-git_oc-release-4090213 snap-temp-L31600000073091223

Change-Id: Ic5fbf99968bf0b8b562509ce8980cfeceffc1301
parents bff37e40 4e39ff92
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -44,8 +44,20 @@ Stream::~Stream() {
}

// static
Result Stream::analyzeStatus(const char* funcName, int status, int ignoreError, int ignoreError2) {
    if (status != 0 && status != -ignoreError && status != -ignoreError2) {
Result Stream::analyzeStatus(const char* funcName, int status) {
    static const std::vector<int> empty;
    return analyzeStatus(funcName, status, empty);
}

template <typename T>
inline bool element_in(T e, const std::vector<T>& v) {
    return std::find(v.begin(), v.end(), e) != v.end();
}

// static
Result Stream::analyzeStatus(const char* funcName, int status,
                             const std::vector<int>& ignoreErrors) {
    if (status != 0 && (ignoreErrors.empty() || !element_in(-status, ignoreErrors))) {
        ALOGW("Error from HAL stream in function %s: %s", funcName, strerror(-status));
    }
    switch (status) {
+6 −3
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@
#ifndef ANDROID_HARDWARE_AUDIO_V2_0_STREAM_H
#define ANDROID_HARDWARE_AUDIO_V2_0_STREAM_H

#include <vector>

#include <android/hardware/audio/2.0/IStream.h>
#include <hardware/audio.h>
#include <hidl/Status.h>
@@ -79,8 +81,9 @@ struct Stream : public IStream, public ParametersUtil {
    Return<Result> close()  override;

    // Utility methods for extending interfaces.
    static Result analyzeStatus(
            const char* funcName, int status, int ignoreError = OK, int ignoreError2 = OK);
    static Result analyzeStatus(const char* funcName, int status);
    static Result analyzeStatus(const char* funcName, int status,
                                const std::vector<int>& ignoreErrors);

   private:
    audio_stream_t *mStream;
+6 −6
Original line number Diff line number Diff line
@@ -416,15 +416,15 @@ Return<uint32_t> StreamIn::getInputFramesLost() {
// static
Result StreamIn::getCapturePositionImpl(audio_stream_in_t* stream,
                                        uint64_t* frames, uint64_t* time) {
    // HAL may have a stub function, always returning ENOSYS, don't
    // spam the log in this case.
    static const std::vector<int> ignoredErrors{ENOSYS};
    Result retval(Result::NOT_SUPPORTED);
    if (stream->get_capture_position != NULL) return retval;
    int64_t halFrames, halTime;
    retval = Stream::analyzeStatus(
        "get_capture_position",
    retval = Stream::analyzeStatus("get_capture_position",
                                   stream->get_capture_position(stream, &halFrames, &halTime),
        // HAL may have a stub function, always returning ENOSYS, don't
        // spam the log in this case.
        ENOSYS);
                                   ignoredErrors);
    if (retval == Result::OK) {
        *frames = halFrames;
        *time = halTime;
+8 −7
Original line number Diff line number Diff line
@@ -487,16 +487,17 @@ Return<Result> StreamOut::flush() {
Result StreamOut::getPresentationPositionImpl(audio_stream_out_t* stream,
                                              uint64_t* frames,
                                              TimeSpec* timeStamp) {
    // Don't logspam on EINVAL--it's normal for get_presentation_position
    // to return it sometimes. EAGAIN may be returned by A2DP audio HAL
    // implementation. ENODATA can also be reported while the writer is
    // continuously querying it, but the stream has been stopped.
    static const std::vector<int> ignoredErrors{EINVAL, EAGAIN, ENODATA};
    Result retval(Result::NOT_SUPPORTED);
    if (stream->get_presentation_position == NULL) return retval;
    struct timespec halTimeStamp;
    retval = Stream::analyzeStatus(
        "get_presentation_position",
    retval = Stream::analyzeStatus("get_presentation_position",
                                   stream->get_presentation_position(stream, frames, &halTimeStamp),
        // Don't logspam on EINVAL--it's normal for get_presentation_position
        // to return it sometimes. EAGAIN may be returned by A2DP audio HAL
        // implementation.
        EINVAL, EAGAIN);
                                   ignoredErrors);
    if (retval == Result::OK) {
        timeStamp->tvSec = halTimeStamp.tv_sec;
        timeStamp->tvNSec = halTimeStamp.tv_nsec;
+1 −1
Original line number Diff line number Diff line
@@ -130,7 +130,7 @@ deee1dc4948f33af207e1008aba0f6cc07afb7900eab53f33192c8cac137eefc android.hardwar
efc83df3f962b93c7c0290d691d7d300dabe12683e2cde3591fb3c0beedce20f android.hardware.power@1.0::types
9b5aa499ec3b4226f15f48f5ed08896e2fc0676f978c9e199c1da21daaf002a6 android.hardware.radio@1.0::IRadio
5c8efbb9c451a59737ed2c6c20230aae4745839ca01d8088d6dcc9020e52d2c5 android.hardware.radio@1.0::IRadioIndication
c5f22264a31562e009bb284287051b7998fc46cd3294df61c9e6a1d622184993 android.hardware.radio@1.0::IRadioResponse
69f6b4b8ec40ca02ccc7bb8227a097135c20c00bd94c822e421cd9af1267252c android.hardware.radio@1.0::IRadioResponse
de3ab9f73b1073cd677b19d886fb927e9381b30161a704712d2b30f875873f5c android.hardware.radio@1.0::ISap
d183e406ef0897df2117a9dde384e8e6ea4fa6ab1c7f6f28e65b87011218c9ea android.hardware.radio@1.0::ISapCallback
96986fbd22f0e6ca752e1fcdc0a64bda213995a81f5f36bc4faf3532d9306b97 android.hardware.radio@1.0::types
Loading