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

Commit 26be86cc authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 12391343 from f4bbe5bf to 24Q4-release

Change-Id: I79e89e34bb3d27fd2162ed7af5dc84a9a8e1d8ed
parents 7eb1a6a6 f4bbe5bf
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -218,3 +218,10 @@ flag {
    description: "Enable CameraServiceWatchdog to abort camera HAL to generate HAL tombstones"
    description: "Enable CameraServiceWatchdog to abort camera HAL to generate HAL tombstones"
    bug: "349652177"
    bug: "349652177"
}
}

flag {
    namespace: "camera_platform"
    name: "enable_stream_reconfiguration_for_unchanged_streams"
    description: "Enable stream reconfiguration for unchanged streams"
    bug: "341740105"
}
+9 −0
Original line number Original line Diff line number Diff line
@@ -59,6 +59,15 @@ flag {
    bug: "307588546"
    bug: "307588546"
}
}


flag {
    name: "equal_sco_lea_vc_index_range"
    namespace: "media_audio"
    description:
        "Introduce the same index range for voice calls over SCO and "
        "LE audio"
    bug: "364364777"
}

flag {
flag {
    name: "music_fx_edge_to_edge"
    name: "music_fx_edge_to_edge"
    namespace: "media_audio"
    namespace: "media_audio"
+8 −0
Original line number Original line Diff line number Diff line
@@ -41,6 +41,14 @@ AudioClientToken::~AudioClientToken() {
    // APM has a back pointer to AudioToken, which is accessible on toString().
    // APM has a back pointer to AudioToken, which is accessible on toString().
    // We first remove ourselves to prevent use after free.
    // We first remove ourselves to prevent use after free.
    apm.clear_token_ptr(this);
    apm.clear_token_ptr(this);

    // The client token is released when it is no longer registered with AudioFlinger.
    // However, it is possible that AudioTrackTokens are still active when the client is released
    // after crashing and some of its tracks are draining.  Those track tokens also
    // maintain a pointer to the PowerClientStats keeping that consistent.

    // Stopping the client moves its PowerClientStats from active to historical
    // if it is the last pid associated with the client uid.
    apm.stopClient(mPid);
    apm.stopClient(mPid);
}
}


+9 −9
Original line number Original line Diff line number Diff line
@@ -39,12 +39,12 @@ void PowerClientStats::start(int64_t actualNs) {
void PowerClientStats::stop(int64_t actualNs) {
void PowerClientStats::stop(int64_t actualNs) {
    std::lock_guard l(mMutex);
    std::lock_guard l(mMutex);
    if (--mTokenCount > 0) return;
    if (--mTokenCount > 0) return;
    if (mStartNs != 0) mDeltaNs += actualNs - mStartNs;
    if (mStartNs != 0) mCumulativeNs += actualNs - mStartNs;
    mStartNs = 0;
    mStartNs = 0;
    if (!mStartStats) return;
    if (!mStartStats) return;
    const auto stopStats = PowerStatsCollector::getCollector().getStats(kStatTimeToleranceNs);
    const auto stopStats = PowerStatsCollector::getCollector().getStats(kStatTimeToleranceNs);
    if (stopStats && stopStats != mStartStats) {
    if (stopStats && stopStats != mStartStats) {
        *mDeltaStats += *stopStats - *mStartStats;
        *mCumulativeStats += *stopStats - *mStartStats;
    }
    }
    mStartStats.reset();
    mStartStats.reset();
}
}
@@ -64,15 +64,15 @@ std::string PowerClientStats::toString(bool stats, const std::string& prefix) co
    std::lock_guard l(mMutex);
    std::lock_guard l(mMutex);


    // Adjust delta time and stats if currently running.
    // Adjust delta time and stats if currently running.
    auto deltaStats = mDeltaStats;
    auto cumulativeStats = mCumulativeStats;
    auto deltaNs = mDeltaNs;
    auto cumulativeNs = mCumulativeNs;
    if (mStartNs) deltaNs += systemTime(SYSTEM_TIME_BOOTTIME) - mStartNs;
    if (mStartNs) cumulativeNs += systemTime(SYSTEM_TIME_BOOTTIME) - mStartNs;
    if (mStartStats) {
    if (mStartStats) {
        const auto stopStats = PowerStatsCollector::getCollector().getStats(kStatTimeToleranceNs);
        const auto stopStats = PowerStatsCollector::getCollector().getStats(kStatTimeToleranceNs);
        if (stopStats && stopStats != mStartStats) {
        if (stopStats && stopStats != mStartStats) {
            auto newStats = std::make_shared<PowerStats>(*deltaStats);
            auto newStats = std::make_shared<PowerStats>(*cumulativeStats);
            *newStats += *stopStats - *mStartStats;
            *newStats += *stopStats - *mStartStats;
            deltaStats = newStats;
            cumulativeStats = newStats;
        }
        }
    }
    }


@@ -81,7 +81,7 @@ std::string PowerClientStats::toString(bool stats, const std::string& prefix) co
            .append(std::to_string(mUid))
            .append(std::to_string(mUid))
            .append(" ").append(mediautils::UidInfo::getInfo(mUid)->package)
            .append(" ").append(mediautils::UidInfo::getInfo(mUid)->package)
            .append(" streams: ").append(std::to_string(mTokenCount))
            .append(" streams: ").append(std::to_string(mTokenCount))
            .append(" seconds: ").append(std::to_string(deltaNs * 1e-9));
            .append(" seconds: ").append(std::to_string(cumulativeNs * 1e-9));
    result.append(" {");
    result.append(" {");
    for (auto pid : mPids) {
    for (auto pid : mPids) {
        result.append(" ").append(std::to_string(pid));
        result.append(" ").append(std::to_string(pid));
@@ -93,7 +93,7 @@ std::string PowerClientStats::toString(bool stats, const std::string& prefix) co
    if (stats) {
    if (stats) {
        std::string prefix2(prefix);
        std::string prefix2(prefix);
        prefix2.append("  ");
        prefix2.append("  ");
        result.append("\n").append(deltaStats->normalizedEnergy(prefix2));
        result.append("\n").append(cumulativeStats->normalizedEnergy(prefix2));
    }
    }
    return result;
    return result;
}
}
+6 −4
Original line number Original line Diff line number Diff line
@@ -87,10 +87,12 @@ private:
    int64_t mStartNs GUARDED_BY(mMutex) = 0;
    int64_t mStartNs GUARDED_BY(mMutex) = 0;
    std::shared_ptr<const PowerStats> mStartStats GUARDED_BY(mMutex);
    std::shared_ptr<const PowerStats> mStartStats GUARDED_BY(mMutex);


    // Total actual time app is active (stop - start)
    // Cumulative time while active: sum of deltas of (stop - start).
    int64_t mDeltaNs GUARDED_BY(mMutex) = 0;
    int64_t mCumulativeNs GUARDED_BY(mMutex) = 0;
    // The stats taken for the active time (snapshots are quantized to 500ms accuracy).
    // Cumulative stats while active: sum of deltas of (stop - start),
    std::shared_ptr<PowerStats> mDeltaStats GUARDED_BY(mMutex) = std::make_shared<PowerStats>();
    // where snapshots are quantized to ~500ms accuracy.
    std::shared_ptr<PowerStats> mCumulativeStats GUARDED_BY(mMutex) =
            std::make_shared<PowerStats>();
};
};


} // namespace android::media::psh_utils
} // namespace android::media::psh_utils
Loading