Lines Matching refs:stats

67         final UsageStats stats = statsOut.getOrCreateUsageStats(pkg);
70 stats.mLastTimeUsed = statsOut.beginTime + XmlUtils.readLongAttribute(
73 stats.mTotalTimeInForeground = XmlUtils.readLongAttribute(parser, TOTAL_TIME_ACTIVE_ATTR);
74 stats.mLastEvent = XmlUtils.readIntAttribute(parser, LAST_EVENT_ATTR);
121 private static void writeUsageStats(XmlSerializer xml, final IntervalStats stats,
127 usageStats.mLastTimeUsed - stats.beginTime);
136 private static void writeConfigStats(XmlSerializer xml, final IntervalStats stats,
142 configStats.mLastTimeActive - stats.beginTime);
156 private static void writeEvent(XmlSerializer xml, final IntervalStats stats,
161 XmlUtils.writeLongAttribute(xml, TIME_ATTR, event.mTimeStamp - stats.beginTime);
182 * @param statsOut The stats object to populate with the data from the XML file.
222 * Writes the stats object to an XML file. The {@link XmlSerializer}
227 * @param stats The stats object to write to the XML file.
229 public static void write(XmlSerializer xml, IntervalStats stats) throws IOException {
230 XmlUtils.writeLongAttribute(xml, END_TIME_ATTR, stats.endTime - stats.beginTime);
233 final int statsCount = stats.packageStats.size();
235 writeUsageStats(xml, stats, stats.packageStats.valueAt(i));
241 final int configCount = stats.configurations.size();
243 boolean active = stats.activeConfiguration.equals(stats.configurations.keyAt(i));
244 writeConfigStats(xml, stats, stats.configurations.valueAt(i), active);
249 final int eventCount = stats.events != null ? stats.events.size() : 0;
251 writeEvent(xml, stats, stats.events.valueAt(i));