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

Commit 2a78bf88 authored by Mikhail Naganov's avatar Mikhail Naganov Committed by android-build-merger
Browse files

Merge "Fix a crash happening in NBLog's 'writeHistToFile'" into oc-dr1-dev

am: 4f771e05

Change-Id: I5f98efcc60004463862425b9bc4305ad2bd2369d
parents ef28fdb8 4f771e05
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -917,10 +917,10 @@ inline void writeHistToFile(const std::vector<int64_t> &samples, bool append) {
    static const char* const kName = (char *)"/data/misc/audioserver/sample_results.txt";
    static const char* const kName = (char *)"/data/misc/audioserver/sample_results.txt";
    // stores deltas between the samples
    // stores deltas between the samples
    std::vector<int64_t> intervals;
    std::vector<int64_t> intervals;
    if (samples.size() == 0) return;
    for (size_t i = 1; i < samples.size(); ++i) {
    for (size_t i = 1; i < samples.size(); ++i) {
        intervals.push_back(deltaMs(samples[i - 1], samples[i]));
        intervals.push_back(deltaMs(samples[i - 1], samples[i]));
    }
    }
    if (intervals.empty()) return;
    // Deletes maximum value in a histogram. Temp quick fix.
    // Deletes maximum value in a histogram. Temp quick fix.
    // FIXME: need to find root cause of approx. 35th element from the end
    // FIXME: need to find root cause of approx. 35th element from the end
    // consistently being an outlier in the first histogram of a flush
    // consistently being an outlier in the first histogram of a flush