Merge "Package wakeup alarms are now on screen-off timebase" into oc-mr1-dev

am: 0a1ae1bc56

Change-Id: Ie4b8379cd5bc6622ecc07868cdcf4eac0af1cf61
This commit is contained in:
Adam Bookatz
2017-08-07 23:33:44 +00:00
committed by android-build-merger
3 changed files with 14 additions and 6 deletions

View File

@@ -206,8 +206,15 @@ public abstract class BatteryStats implements Parcelable {
* - CPU frequency time per uid
* New in version 22:
* - BLE scan result background count, BLE unoptimized scan time
* - Background partial wakelock time & count
* New in version 23:
* - Logging smeared power model values
* New in version 24:
* - Fixed bugs in background timers and BLE scan time
* New in version 25:
* - Package wakeup alarms are now on screen-off timebase
*/
static final String CHECKIN_VERSION = "24";
static final String CHECKIN_VERSION = "25";
/**
* Old version, we hit 9 and ran out of room, need to remove.

View File

@@ -119,7 +119,7 @@ public class BatteryStatsImpl extends BatteryStats {
private static final int MAGIC = 0xBA757475; // 'BATSTATS'
// Current on-disk Parcel version
private static final int VERSION = 162 + (USE_OLD_HISTORY ? 1000 : 0);
private static final int VERSION = 163 + (USE_OLD_HISTORY ? 1000 : 0);
// Maximum number of items we will record in the history.
private static final int MAX_HISTORY_ITEMS;
@@ -8043,6 +8043,7 @@ public class BatteryStatsImpl extends BatteryStats {
/**
* Number of times wakeup alarms have occurred for this app.
* On screen-off timebase starting in report v25.
*/
ArrayMap<String, Counter> mWakeupAlarms = new ArrayMap<>();
@@ -8071,7 +8072,7 @@ public class BatteryStatsImpl extends BatteryStats {
mWakeupAlarms.clear();
for (int i=0; i<numWA; i++) {
String tag = in.readString();
mWakeupAlarms.put(tag, new Counter(mBsi.mOnBatteryTimeBase, in));
mWakeupAlarms.put(tag, new Counter(mBsi.mOnBatteryScreenOffTimeBase, in));
}
int numServs = in.readInt();
@@ -8110,7 +8111,7 @@ public class BatteryStatsImpl extends BatteryStats {
public void noteWakeupAlarmLocked(String tag) {
Counter c = mWakeupAlarms.get(tag);
if (c == null) {
c = new Counter(mBsi.mOnBatteryTimeBase);
c = new Counter(mBsi.mOnBatteryScreenOffTimeBase);
mWakeupAlarms.put(tag, c);
}
c.stepAtomic();
@@ -11867,7 +11868,7 @@ public class BatteryStatsImpl extends BatteryStats {
p.mWakeupAlarms.clear();
for (int iwa=0; iwa<NWA; iwa++) {
String tag = in.readString();
Counter c = new Counter(mOnBatteryTimeBase);
Counter c = new Counter(mOnBatteryScreenOffTimeBase);
c.readSummaryFromParcelLocked(in);
p.mWakeupAlarms.put(tag, c);
}

View File

@@ -488,7 +488,7 @@ public class BatteryStatsSensorTest extends TestCase {
bi.noteStartSensorLocked(UID, SENSOR_ID);
clocks.realtime += 111;
clocks.uptime += 1111;
clocks.uptime += 111;
// Timebase and timer was on so times have increased.
assertEquals(111_000, timer.getTotalTimeLocked(1000*clocks.realtime, which));