Merge "Revert "Revert "Breaking history writing out of BatteryStatsImpl"""