Merge "BatteryStatsImpl: Add parcel methods for DisplayBatteryStats."
This commit is contained in:
@@ -160,7 +160,7 @@ public class BatteryStatsImpl extends BatteryStats {
|
|||||||
private static final int MAGIC = 0xBA757475; // 'BATSTATS'
|
private static final int MAGIC = 0xBA757475; // 'BATSTATS'
|
||||||
|
|
||||||
// Current on-disk Parcel version
|
// Current on-disk Parcel version
|
||||||
static final int VERSION = 200;
|
static final int VERSION = 201;
|
||||||
|
|
||||||
// The maximum number of names wakelocks we will keep track of
|
// The maximum number of names wakelocks we will keep track of
|
||||||
// per uid; once the limit is reached, we batch the remaining wakelocks
|
// per uid; once the limit is reached, we batch the remaining wakelocks
|
||||||
@@ -929,6 +929,28 @@ public class BatteryStatsImpl extends BatteryStats {
|
|||||||
screenBrightnessTimers[i].reset(false, elapsedRealtimeUs);
|
screenBrightnessTimers[i].reset(false, elapsedRealtimeUs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Write data to summary parcel
|
||||||
|
*/
|
||||||
|
public void writeSummaryToParcel(Parcel out, long elapsedRealtimeUs) {
|
||||||
|
screenOnTimer.writeSummaryFromParcelLocked(out, elapsedRealtimeUs);
|
||||||
|
screenDozeTimer.writeSummaryFromParcelLocked(out, elapsedRealtimeUs);
|
||||||
|
for (int i = 0; i < NUM_SCREEN_BRIGHTNESS_BINS; i++) {
|
||||||
|
screenBrightnessTimers[i].writeSummaryFromParcelLocked(out, elapsedRealtimeUs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read data from summary parcel
|
||||||
|
*/
|
||||||
|
public void readSummaryFromParcel(Parcel in) {
|
||||||
|
screenOnTimer.readSummaryFromParcelLocked(in);
|
||||||
|
screenDozeTimer.readSummaryFromParcelLocked(in);
|
||||||
|
for (int i = 0; i < NUM_SCREEN_BRIGHTNESS_BINS; i++) {
|
||||||
|
screenBrightnessTimers[i].readSummaryFromParcelLocked(in);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DisplayBatteryStats[] mPerDisplayBatteryStats;
|
DisplayBatteryStats[] mPerDisplayBatteryStats;
|
||||||
@@ -15636,6 +15658,10 @@ public class BatteryStatsImpl extends BatteryStats {
|
|||||||
for (int i=0; i<NUM_SCREEN_BRIGHTNESS_BINS; i++) {
|
for (int i=0; i<NUM_SCREEN_BRIGHTNESS_BINS; i++) {
|
||||||
mScreenBrightnessTimer[i].readSummaryFromParcelLocked(in);
|
mScreenBrightnessTimer[i].readSummaryFromParcelLocked(in);
|
||||||
}
|
}
|
||||||
|
final int numDisplays = in.readInt();
|
||||||
|
for (int i = 0; i < numDisplays; i++) {
|
||||||
|
mPerDisplayBatteryStats[i].readSummaryFromParcel(in);
|
||||||
|
}
|
||||||
mInteractive = false;
|
mInteractive = false;
|
||||||
mInteractiveTimer.readSummaryFromParcelLocked(in);
|
mInteractiveTimer.readSummaryFromParcelLocked(in);
|
||||||
mPhoneOn = false;
|
mPhoneOn = false;
|
||||||
@@ -16135,6 +16161,11 @@ public class BatteryStatsImpl extends BatteryStats {
|
|||||||
for (int i=0; i<NUM_SCREEN_BRIGHTNESS_BINS; i++) {
|
for (int i=0; i<NUM_SCREEN_BRIGHTNESS_BINS; i++) {
|
||||||
mScreenBrightnessTimer[i].writeSummaryFromParcelLocked(out, NOWREAL_SYS);
|
mScreenBrightnessTimer[i].writeSummaryFromParcelLocked(out, NOWREAL_SYS);
|
||||||
}
|
}
|
||||||
|
final int numDisplays = mPerDisplayBatteryStats.length;
|
||||||
|
out.writeInt(numDisplays);
|
||||||
|
for (int i = 0; i < numDisplays; i++) {
|
||||||
|
mPerDisplayBatteryStats[i].writeSummaryToParcel(out, NOWREAL_SYS);
|
||||||
|
}
|
||||||
mInteractiveTimer.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
|
mInteractiveTimer.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
|
||||||
mPowerSaveModeEnabledTimer.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
|
mPowerSaveModeEnabledTimer.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
|
||||||
out.writeLong(mLongestLightIdleTimeMs);
|
out.writeLong(mLongestLightIdleTimeMs);
|
||||||
|
|||||||
Reference in New Issue
Block a user