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

Commit ca99b686 authored by Makoto Onuki's avatar Makoto Onuki
Browse files

Fix divide by zero

Fix: 190638632
Test: Boot
Change-Id: Ib21141ef549f11692258cf8f062cea0bbfba84c1
parent 271c6006
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -14309,7 +14309,7 @@ public class ActivityManagerService extends IActivityManager.Stub
    private boolean checkExcessivePowerUsageLPr(final long uptimeSince, boolean doCpuKills,
            final long cputimeUsed, final String processName, final String description,
            final int cpuLimit, final ProcessRecord app) {
        if (DEBUG_POWER) {
        if (DEBUG_POWER && (uptimeSince > 0)) {
            StringBuilder sb = new StringBuilder(128);
            sb.append("CPU for ");
            sb.append(description);
+3 −3
Original line number Diff line number Diff line
@@ -4289,8 +4289,8 @@ public final class ProcessList {

                if (state.getSetProcState() >= ActivityManager.PROCESS_STATE_SERVICE) {
                    long lastCpuTime = r.mProfile.mLastCpuTime.get();
                    if (lastCpuTime != 0) {
                    long uptimeSince = curUptime - service.mLastPowerCheckUptime;
                    if (lastCpuTime != 0 && uptimeSince > 0) {
                        long timeUsed = r.mProfile.mCurCpuTime.get() - lastCpuTime;
                        long cpuTimeToken = proto.start(ProcessOomProto.Detail.SERVICE_RUN_TIME);
                        proto.write(ProcessOomProto.Detail.CpuRunTime.OVER_MS, uptimeSince);
@@ -4427,7 +4427,7 @@ public final class ProcessList {

                if (state.getSetProcState() >= ActivityManager.PROCESS_STATE_SERVICE) {
                    long lastCpuTime = r.mProfile.mLastCpuTime.get();
                    if (lastCpuTime != 0) {
                    if (lastCpuTime != 0 && uptimeSince > 0) {
                        long timeUsed = r.mProfile.mCurCpuTime.get() - lastCpuTime;
                        pw.print(prefix);
                        pw.print("    ");