Fix format of subsystem power stats

The Subsystem power stats string in batteryStats dumpsys has an extra
newline that is causing PowerBug to skip the line when parsing the
history information.
Also, the string for subsystem power stats is missing a heading title
and has some redundant text

This commit fixes these format errors so powerbug can read and parse that
line successfully

Bug: 63447034
Test: Manual testing + Read the bugreport by historian and verify output

Change-Id: Idf971823dd5f769e653b4788b00fc025593d0d3d
Signed-off-by: Ahmed ElArabawy <arabawy@google.com>
diff --git a/core/java/android/os/BatteryStats.java b/core/java/android/os/BatteryStats.java
index b178d81..19fb15c 100644
--- a/core/java/android/os/BatteryStats.java
+++ b/core/java/android/os/BatteryStats.java
@@ -5606,8 +5606,10 @@
                         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);