Loading services/usage/java/com/android/server/usage/UsageStatsService.java +1 −1 Original line number Diff line number Diff line Loading @@ -866,7 +866,7 @@ public class UsageStatsService extends SystemService implements final long token = Binder.clearCallingIdentity(); try { return UsageStatsService.this.queryEventsForPackage(userId, beginTime, endTime, callingPackage); endTime, pkg); } finally { Binder.restoreCallingIdentity(token); } Loading services/usage/java/com/android/server/usage/UsageStatsXmlV1.java +13 −0 Original line number Diff line number Diff line Loading @@ -68,6 +68,7 @@ final class UsageStatsXmlV1 { private static final String SHORTCUT_ID_ATTR = "shortcutId"; private static final String STANDBY_BUCKET_ATTR = "standbyBucket"; private static final String APP_LAUNCH_COUNT_ATTR = "appLaunchCount"; private static final String NOTIFICATION_CHANNEL_ATTR = "notificationChannel"; // Time attributes stored as an offset of the beginTime. private static final String LAST_TIME_ACTIVE_ATTR = "lastTimeActive"; Loading Loading @@ -189,6 +190,11 @@ final class UsageStatsXmlV1 { case UsageEvents.Event.STANDBY_BUCKET_CHANGED: event.mBucketAndReason = XmlUtils.readIntAttribute(parser, STANDBY_BUCKET_ATTR, 0); break; case UsageEvents.Event.NOTIFICATION_INTERRUPTION: final String channelId = XmlUtils.readStringAttribute(parser, NOTIFICATION_CHANNEL_ATTR); event.mNotificationChannelId = (channelId != null) ? channelId.intern() : null; break; } if (statsOut.events == null) { Loading Loading @@ -307,6 +313,13 @@ final class UsageStatsXmlV1 { if (event.mBucketAndReason != 0) { XmlUtils.writeIntAttribute(xml, STANDBY_BUCKET_ATTR, event.mBucketAndReason); } break; case UsageEvents.Event.NOTIFICATION_INTERRUPTION: if (event.mNotificationChannelId != null) { XmlUtils.writeStringAttribute( xml, NOTIFICATION_CHANNEL_ATTR, event.mNotificationChannelId); } break; } xml.endTag(null, EVENT_TAG); Loading services/usage/java/com/android/server/usage/UserUsageStatsService.java +3 −0 Original line number Diff line number Diff line Loading @@ -604,6 +604,9 @@ class UserUsageStatsService { pw.printPair("standbyBucket", event.getStandbyBucket()); pw.printPair("reason", UsageStatsManager.reasonToString(event.getStandbyReason())); } if (event.mNotificationChannelId != null) { pw.printPair("channelId", event.mNotificationChannelId); } pw.printHexPair("flags", event.mFlags); pw.println(); } Loading Loading
services/usage/java/com/android/server/usage/UsageStatsService.java +1 −1 Original line number Diff line number Diff line Loading @@ -866,7 +866,7 @@ public class UsageStatsService extends SystemService implements final long token = Binder.clearCallingIdentity(); try { return UsageStatsService.this.queryEventsForPackage(userId, beginTime, endTime, callingPackage); endTime, pkg); } finally { Binder.restoreCallingIdentity(token); } Loading
services/usage/java/com/android/server/usage/UsageStatsXmlV1.java +13 −0 Original line number Diff line number Diff line Loading @@ -68,6 +68,7 @@ final class UsageStatsXmlV1 { private static final String SHORTCUT_ID_ATTR = "shortcutId"; private static final String STANDBY_BUCKET_ATTR = "standbyBucket"; private static final String APP_LAUNCH_COUNT_ATTR = "appLaunchCount"; private static final String NOTIFICATION_CHANNEL_ATTR = "notificationChannel"; // Time attributes stored as an offset of the beginTime. private static final String LAST_TIME_ACTIVE_ATTR = "lastTimeActive"; Loading Loading @@ -189,6 +190,11 @@ final class UsageStatsXmlV1 { case UsageEvents.Event.STANDBY_BUCKET_CHANGED: event.mBucketAndReason = XmlUtils.readIntAttribute(parser, STANDBY_BUCKET_ATTR, 0); break; case UsageEvents.Event.NOTIFICATION_INTERRUPTION: final String channelId = XmlUtils.readStringAttribute(parser, NOTIFICATION_CHANNEL_ATTR); event.mNotificationChannelId = (channelId != null) ? channelId.intern() : null; break; } if (statsOut.events == null) { Loading Loading @@ -307,6 +313,13 @@ final class UsageStatsXmlV1 { if (event.mBucketAndReason != 0) { XmlUtils.writeIntAttribute(xml, STANDBY_BUCKET_ATTR, event.mBucketAndReason); } break; case UsageEvents.Event.NOTIFICATION_INTERRUPTION: if (event.mNotificationChannelId != null) { XmlUtils.writeStringAttribute( xml, NOTIFICATION_CHANNEL_ATTR, event.mNotificationChannelId); } break; } xml.endTag(null, EVENT_TAG); Loading
services/usage/java/com/android/server/usage/UserUsageStatsService.java +3 −0 Original line number Diff line number Diff line Loading @@ -604,6 +604,9 @@ class UserUsageStatsService { pw.printPair("standbyBucket", event.getStandbyBucket()); pw.printPair("reason", UsageStatsManager.reasonToString(event.getStandbyReason())); } if (event.mNotificationChannelId != null) { pw.printPair("channelId", event.mNotificationChannelId); } pw.printHexPair("flags", event.mFlags); pw.println(); } Loading