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

Commit 5512504b authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix format of subsystem power stats" into oc-dr1-dev

parents 1659b400 307edcd9
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -5606,8 +5606,10 @@ public abstract class BatteryStats implements Parcelable {
                        pw.print(',');
                        if (rec.stepDetails.statPlatformIdleState != null) {
                            pw.print(rec.stepDetails.statPlatformIdleState);
                            if (rec.stepDetails.statSubsystemPowerState != null) {
                                pw.print(',');
                            }
                        }
                        pw.println();

                        if (rec.stepDetails.statSubsystemPowerState != null) {
                            pw.print(rec.stepDetails.statSubsystemPowerState);
+32 −26
Original line number Diff line number Diff line
@@ -301,8 +301,13 @@ static jint getSubsystemLowPowerStats(JNIEnv* env, jobject /* clazz */, jobject
            if (status != Status::SUCCESS)
                return;

            if (subsystems.size() > 0) {
                int added = snprintf(offset, remaining, "SubsystemPowerState ");
                offset += added;
                remaining -= added;
                total_added += added;

                for (size_t i = 0; i < subsystems.size(); i++) {
                int added;
                    const PowerStateSubsystem &subsystem = subsystems[i];

                    added = snprintf(offset, remaining,
@@ -322,7 +327,7 @@ static jint getSubsystemLowPowerStats(JNIEnv* env, jobject /* clazz */, jobject
                    for (size_t j = 0; j < subsystem.states.size(); j++) {
                        const PowerStateSubsystemSleepState& state = subsystem.states[j];
                        added = snprintf(offset, remaining,
                                     "state_%zu name=%s time=%" PRIu64 " count=%" PRIu64 " last entry TS(ms)=%" PRIu64 " ",
                                         "state_%zu name=%s time=%" PRIu64 " count=%" PRIu64 " last entry=%" PRIu64 " ",
                                         j + 1, state.name.c_str(), state.residencyInMsecSinceBoot,
                                         state.totalTransitions, state.lastEntryTimestampMs);
                        if (added < 0) {
@@ -347,6 +352,7 @@ static jint getSubsystemLowPowerStats(JNIEnv* env, jobject /* clazz */, jobject
                    }
                }
            }
        }
        );

        if (!ret.isOk()) {