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

Commit 64fc30f1 authored by Ben Miles's avatar Ben Miles
Browse files

Fix Process-Runtime field in crash dropbox headers

It was subtracting SystemClock.uptimeMillis() from a SystemClock.elapsedRealtime(), one of which includes time spent in deep sleep and one doesn't.

This changes the logic to use uptime for both, so the Process-Runtime will be the equal to the millis since boot not including time spent in deep sleep.

Fixes: 217357881
Test: atest FrameworksServicesTests:ActivityManagerTest
Change-Id: I3931a1df6f81992dea3c61cfb05094281cc3d605
parent 2b310720
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -8632,8 +8632,8 @@ public class ActivityManagerService extends IActivityManager.Stub
            sb.append("Foreground: ")
                    .append(process.isInterestingToUserLocked() ? "Yes" : "No")
                    .append("\n");
            if (process.getStartTime() > 0) {
                long runtimeMillis = SystemClock.elapsedRealtime() - process.getStartTime();
            if (process.getStartUptime() > 0) {
                long runtimeMillis = SystemClock.uptimeMillis() - process.getStartUptime();
                sb.append("Process-Runtime: ").append(runtimeMillis).append("\n");
            }
        }