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

Commit 02989899 authored by Lee Shombert's avatar Lee Shombert
Browse files

Fix a debug-output formatting error

The function that prints the list of pids watched by the ANR tracing
feature is supposed to inject a comma between pids.  A variable
assignment was missing in the original code.

Tested with the following command:
`adb shell am trace-timer pid=2000,2001 expire=20`

Bug: 352085328
Flag: com.android.server.utils.anr_timer_trace
Test: atest
 * FrameworksServicesTests:com.android.server.am
 * FrameworksServicesTests:AnrTimerTest
Change-Id: Ib3a70bc27299ad2458cd6a3936e2b6632d6dd884
parent 3f64dc81
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -349,7 +349,7 @@ class AnrTimerTracer {
        return nullptr;
    }

    // Return the currently watched pids.  The lock must be held.
    // Return the currently watched pids as a comma-separated list.  The lock must be held.
    std::string watchedPidsLocked() const {
        if (watched_.size() == 0) return "none";
        bool first = true;
@@ -357,6 +357,7 @@ class AnrTimerTracer {
        for (auto i = watched_.cbegin(); i != watched_.cend(); i++) {
            if (first) {
                result += StringPrintf("%d", *i);
                first = false;
            } else {
                result += StringPrintf(",%d", *i);
            }