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

Commit b90e86f5 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Fix/suppress bugprone-branch-clone warnings" am: 55d91e6a am:...

Merge "Fix/suppress bugprone-branch-clone warnings" am: 55d91e6a am: 378fc2d0 am: a910fba9 am: 729c0d2d

Original change: https://android-review.googlesource.com/c/platform/frameworks/av/+/2120684



Change-Id: I53de86697846e7b6d1c86143b9d2cd31f4480b2e
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 1ada233d 729c0d2d
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -566,9 +566,7 @@ AAUDIO_API aaudio_result_t AAudioStream_getTimestamp(AAudioStream* stream,
                                      int64_t *timeNanoseconds)
{
    AudioStream *audioStream = convertAAudioStreamToAudioStream(stream);
    if (framePosition == nullptr) {
        return AAUDIO_ERROR_NULL;
    } else if (timeNanoseconds == nullptr) {
    if (framePosition == nullptr || timeNanoseconds == nullptr) {
        return AAUDIO_ERROR_NULL;
    } else if (clockid != CLOCK_MONOTONIC && clockid != CLOCK_BOOTTIME) {
        return AAUDIO_ERROR_ILLEGAL_ARGUMENT;
+0 −1
Original line number Diff line number Diff line
@@ -83,7 +83,6 @@ aaudio_result_t AAudioStreamParameters::validate() const {
    switch (mSessionId) {
        case AAUDIO_SESSION_ID_NONE:
        case AAUDIO_SESSION_ID_ALLOCATE:
            break;
        default:
            break;
    }
+2 −0
Original line number Diff line number Diff line
@@ -72,6 +72,7 @@ nsecs_t MediaMetricsService::roundTime(nsecs_t timeNs)
bool MediaMetricsService::useUidForPackage(
        const std::string& package, const std::string& installer)
{
    // NOLINTBEGIN(bugprone-branch-clone)
    if (strchr(package.c_str(), '.') == nullptr) {
        return false;  // not of form 'com.whatever...'; assume internal and ok
    } else if (strncmp(package.c_str(), "android.", 8) == 0) {
@@ -85,6 +86,7 @@ bool MediaMetricsService::useUidForPackage(
    } else {
        return true;  // we're not sure where it came from, use uid only.
    }
    // NOLINTEND(bugprone-branch-clone)
}

/* static */
+4 −6
Original line number Diff line number Diff line
@@ -99,16 +99,14 @@ bool statsd_audiorecord(const std::shared_ptr<const mediametrics::Item>& item,
    }

    int32_t error_code = -1;
    if (item->getInt32("android.media.audiorecord.errcode", &error_code)) {
        metrics_proto.set_error_code(error_code);
    } else if (item->getInt32("android.media.audiorecord.lastError.code", &error_code)) {
    if (item->getInt32("android.media.audiorecord.errcode", &error_code) ||
        item->getInt32("android.media.audiorecord.lastError.code", &error_code)) {
        metrics_proto.set_error_code(error_code);
    }

    std::string error_function;
    if (item->getString("android.media.audiorecord.errfunc", &error_function)) {
        metrics_proto.set_error_function(error_function);
    } else if (item->getString("android.media.audiorecord.lastError.at", &error_function)) {
    if (item->getString("android.media.audiorecord.errfunc", &error_function) ||
        item->getString("android.media.audiorecord.lastError.at", &error_function)) {
        metrics_proto.set_error_function(error_function);
    }